Android UI App Code

MainActivity

package com.arcgis.com.servir_flier;

import android.app.Activity; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.RadioButton; import android.widget.TextView; import android.widget.Toast;

public class MainActivity extends AppCompatActivity { Button button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);

    Button button = (Button) findViewById(R.id.button_continue);
    View.OnClickListener listener = new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent in=new Intent(MainActivity.this,Dynamic.class);
            startActivity(in);
            RadioButton radioYes = (RadioButton)findViewById(R.id.radio_yes);
            RadioButton radioNo = (RadioButton)findViewById(R.id.radio_no);
            if(radioYes.isChecked()){
                Intent intent = new Intent(MainActivity.this, Dynamic.class);
                MainActivity.this.startActivity(intent);
            }else if(radioNo.isChecked()){
                Intent intent = new Intent(MainActivity.this, ER.class);
                MainActivity.this.startActivity(intent);
            }else{
                Toast.makeText(getApplicationContext(), "Select the radio button",Toast.LENGTH_LONG).show();
            }
        }
    };

    button.setOnClickListener(listener);

}

}

ER(Emergency Responder)

package com.arcgis.com.servir_flier;

import android.content.Intent; import android.net.Uri; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.webkit.ValueCallback; import android.webkit.WebChromeClient; import android.webkit.WebView;

public class ER extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_er);
    WebView wv = (WebView) findViewById(R.id.webview);
    wv.getSettings().setJavaScriptEnabled(true);
    wv.setWebChromeClient(new WebChromeClient() {
        public void onProgressChanged(WebView view, int progress) {


        }

        //The undocumented magic method override
        //Eclipse will swear at you if you try to put @Override here
        // For Android 3.0+
        public void openFileChooser(ValueCallback<Uri> uploadMsg) {


            Intent i = new Intent(Intent.ACTION_GET_CONTENT);
            i.addCategory(Intent.CATEGORY_OPENABLE);
            i.setType("image/*");
            startActivityForResult(Intent.createChooser(i, "File Chooser"),1);
        }

        // For Android 3.0+
        public void openFileChooser(ValueCallback uploadMsg, String acceptType) {
            Intent i = new Intent(Intent.ACTION_GET_CONTENT);
            i.addCategory(Intent.CATEGORY_OPENABLE);
            i.setType("*/*");
            startActivityForResult(
                    Intent.createChooser(i, "File Browser"),
                    1);
        }

        //For Android 4.1
        public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) {
            Intent i = new Intent(Intent.ACTION_GET_CONTENT);
            i.addCategory(Intent.CATEGORY_OPENABLE);
            i.setType("image/*");
            startActivityForResult(Intent.createChooser(i, "File Chooser"), 1);

        }


    });

    wv.loadUrl("file:///android_asset/html/index1.html");

}

}

Dynamic(for public)

package com.arcgis.com.servir_flier;

import android.content.Intent; import android.net.Uri; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.webkit.ValueCallback; import android.webkit.WebChromeClient; import android.webkit.WebView;

public class Dynamic extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_er);
    WebView wv = (WebView) findViewById(R.id.webview);
    wv.getSettings().setJavaScriptEnabled(true);
    wv.setWebChromeClient(new WebChromeClient());

    wv.loadUrl("file:///android_asset/html/index2.html");

}

}

Python Model Code

Import arcpy module

import arcpy

Script arguments

v_Number_ = arcpy.GetParameterAsText(0) if v_Number_ == '#' or not v_Number_: v_Number_ = "%Number%" # provide a default value if unspecified

Local variables:

Structure_Building_poly = "Structure_Building_poly" v1_ft_flood = "1 ft flood" Input_false_raster_or_constant_value_2 = "1" Flood3 = "\\Mac\Home\Documents\ArcGIS\ESS507.gdb\Flood3" RasterT_Flood11 = "\\Mac\Home\Documents\ArcGIS\ESS507.gdb\RasterT_Flood31" Intersect_2 = "\\Mac\Home\Documents\ArcGIS\ESS507.gdb\Intersect" Private_Schools = "Private_Schools" Huntsville_City_Schools = "Huntsville_City_Schools" Private_Schools_Merge = "Private_Schools_Merge" Huntsville_City_Schools_Inte = "\\Mac\Home\Documents\ArcGIS\ESS507.gdb\Huntsville_City_Schools_Inte" national_shapefile_obs_shp = "\\Mac\Home\Downloads\national_shapefile_obs\national_shapefile_obs.shp" Huntsville_City_Limits = "Huntsville_City_Limits" national_shapefile_obs_Clip = "\\Mac\Home\Documents\ArcGIS\ESS507.gdb\national_shapefile_obs_Clip" national_shapefile_obs_Clip_ = "\\Mac\Home\Documents\ArcGIS\ESS507.gdb\national_shapefile_obs_Clip_"

Process: Set Null

arcpy.gp.SetNull_sa(v1_ft_flood, Input_false_raster_or_constant_value_2, Flood3, "VALUE >185")

Process: Raster to Polygon

arcpy.RasterToPolygon_conversion(Flood3, RasterT_Flood11, "SIMPLIFY", "VALUE")

Process: Intersect

arcpy.Intersect_analysis("Structure_Building_poly #;\\Mac\Home\Documents\ArcGIS\ESS507.gdb\RasterT_Flood31 #", Intersect_2, "ALL", "", "INPUT")

Process: Intersect (3)

arcpy.Intersect_analysis("\\Mac\Home\Documents\ArcGIS\ESS507.gdb\RasterT_Flood31 #;Private_Schools_Merge #", Huntsville_City_Schools_Inte, "ALL", "", "INPUT")

Process: Clip

arcpy.Clip_analysis(national_shapefile_obs_shp, Huntsville_City_Limits, national_shapefile_obs_Clip, "")

Process: Select

arcpy.Select_analysis(national_shapefile_obs_Clip, national_shapefile_obs_Clip_, "Observed = MAX")

Built With

Share this project:

Updates