Home
- San Diego State University
Contents
1. correctWrongPane LinearLayout Ab correctWrongTextView Correct Ab correctWrongExplanationView Tex Figure 7 4 Quiz screen layout structure Xml code for UI Refer Appendix B JAVA code for Logical flow QuizActivity java Below code inflates the quizview xml Override protected void onCreate Bundle savedInstanceState super onCreate savedInstanceState setContentView R layout quizview 36 initialize The code logic to perform a check to see if the chosen answer is correct wrong is indicating the same to user is written below Override public void onCheckedChanged RadioGroup group int checkedId switch group getld case R id AnswerOne if checkedId R id ansOneB correctWrongPane setVisibility View VISIBLE answerText setText WRONG answerExplanationText setText There are 100 senators in the US Senate n Correct answer B else correctWrongPane setVisibility View VISIBLE answerText setText CORRECT answerExplanationText setText break case R id AnswerTwo if checkedId R id ansTwoD correctWrongPane setVisibility View VISIBLE answerText setText WRONG answerExplanationText setText There are 2 senators per state in the US Senate n Correct answer D else correctWrongPane setVisibility View VISIBLE answerText setText CORRECT answerExplanationText setText break case R id AnswerThree 37 if c
2. android visibility invisible gt lt LinearLayout android id id quickPane android layout_width fill_parent android layout_height fill_parent android background color LightBlue android orientation vertical android visibility gone gt lt LinearLayout android layout_width fill_parent android layout_height 0dp android layout_weight 4 android orientation vertical gt lt TextView android id id regionName android layout_width Wrap_content android layout_height wrap_content android layout_gravity center android text Senators of USA android textAppearance android attr textAppearanceLarge gt 62 63 lt TextView android layout_width wrap_content android layout_height wrap_content android layout_gravity center android layout_marginTop 1 0dp android text Quick Facts android textAppearance android attr textAppearanceSmall gt lt View android layout_width fill_parent android layout_height 3dp android background color Black gt lt include layout layout list_item gt lt ListView android id id quickList android layout_width fill_parent android layout_height wrap_content android layout_marginTop 3dp gt lt ListView gt lt LinearLayout gt lt LinearLayout android layout_width fill_parent android layout_height 0dp android layout_weight android gravity bottom android orientation vertical gt lt But
3. n d 14 SENATOR GOV States based senator information for more than 100 years http www senate gov states accessed March 2013 n d APPENDIX A USER MANUAL 43 44 Follow the below instruction to set up the development environment for android application Initial Steps 1 Download an IDE We could use any IDE for the application development I have used Eclipse as the IDE for U S senator application development Download the latest version of the software here http www eclipse org downloads packages release indigo r Before downloading the IDE choose the version that corresponds to your OS of choice 2 Install Eclipse Make sure to take note of the installation directory and workspace for later reference 3 Download and install the Java Runtime Environment JRE Make sure to download JRE if you don t have it installed already User can find the download file here http www oracle com technetwork java javase downloads jre 6u25 download 346243 html 4 Download and install the Java Development Kit If the user don t have Java installed in the development PC They can download the file from the link below http www oracle com technetwork java javase downloads jdk 7u3 download 1501626 html Android SDK installation steps 1 Install the Android SDK The SDK starter package includes the Android SDK and AVD Manager This is a tool could be used to download some required SDK components i
4. Spinner Sub tem CI Text Fields CI Layouts CI Time 4 Date CI Transitions CI Advanced Other CI Custom amp Library Views Graphical Layout westcoastus xml Wi Problems Javadoc Declaration 4 Search El Console 23 DLogCat History Android Figure B 2 Shows westcoastus xml graphical layout eastus xml This xml is used to create the map of all the eastern states in US with their on click action listeners eastus xml lt xml version 0 encoding utf 8 gt lt LinearLayout xmlns android http schemas android com apk res android android layout_width match_parent android layout_height match_parent android background color LightYellow android orientation horizontal gt lt RelativeLayout android layout_width fill_parent android layout_height match_parent android orientation vertical gt lt ImageView android id id westusmap android layout_width fill_parent android layout_height fill_parent android background drawable east_map android visibility visible gt lt ImageView android id id westusstates android layout_width fill_parent android layout_height fill_parent android background drawable east_colormap android visibility invisible gt lt Image View android id id selectedstate android layout_width fill_parent android layout_height fill_parent android alpha 20
5. android gravity center android text Rep android textSize dimen rep_dem_ind_size gt lt TextView android id id demNum android layout_width 0dp android layout_height fill_parent android layout_gravity bottom android layout_weight android background color Red android gravity center android text Dem android textSize dimen rep_dem_ind_size gt lt TextView android id id indNum android layout_width 0dp android layout_height fill_parent android layout_gravity bottom android layout_weight android background color Gray android gravity center android text Ind android textSize dimen rep_dem_ind_size gt lt LinearLayout gt lt LinearLayout gt Graphical representation Below is the Graphical representation of US map xml in eclipse 58 eoe Java SenatorsThesis res layout main xml Eclipse SDK Users lavanyavangalkrit O al Hi Package Explorer 3 BY Ye a Contact adapter a tab xml 7 ContactsActivit a button state xm la y 5 senators inesis lat Vv 8 src a a gt Nexus One v F Ar AppTheme Senator TJ com thesis senatorsthesis H IJ AdvancedSearchActivity java gt Form Widgets HE gt EastUSActivity java 0 a ww Large Medium smst Button gt J MidwestUSActivity java gt 3 QuizActivity java IJ Senators java 3 SouthUSActivity java gt IJ Tuto
6. match_parent android layout_height 0dp android layout_weight 3 gt lt LinearLayout android layout_width match_parent android layout_height match_parent android orientation vertical gt lt TextView android id id QuestionOne android layout_width match_parent android layout_height match_parent android text 1 How many senators serve in the US senate gt lt RadioGroup android id id AnswerOne android layout_width wrap_content android layout_height wrap_content gt lt RadioButton android id id ansOneA android layout_width wrap_content android layout_height wrap_content android checked true android text 107 gt lt RadioButton android id id ansOneB android layout_width wrap_content android layout_height wrap_content android text 00 gt lt RadioButton android id id ansOneC android layout_width wrap_content android layout_height wrap_content android text 107 gt lt RadioButton android id id ansOneD 72 android layout_width wrap_content android layout_height wrap_content android text 97 gt lt RadioGroup gt lt TextView android id id QuestionTwo android layout_width match_parent android layout_height match_parent android text 2 How many senators serve from every State gt lt RadioGroup android id id AnswerTwo android layout_width Wrap_content android layout_height
7. wrap_content gt lt RadioButton android id id ansTwoeA android layout_width Wrap_content android layout_height wrap_content android checked true android text 3 gt lt RadioButton android id id ansTwoB android layout_width Wrap_content android layout_height wrap_content android text Depends on the state Size gt lt RadioButton android id id ansTwoC android layout_width wrap_content android layout_height wrap_content android text 1 gt lt RadioButton android id id ansTwoD android layout_width Wrap_content android layout_height wrap_content android text 2 gt lt RadioGroup gt lt TextView android id id QuestionThree android layout_width match_parent android layout_height match_parent 73 android text 3 How many years do the Senators serve in the Senate gt lt RadioGroup android id id AnswerThree android layout_width wrap_content android layout_height wrap_content gt lt RadioButton android id id ansThreeA android layout_width Wrap_content android layout_height wrap_content android checked true android text 3 yrs gt lt RadioButton android id id ansThreeB android layout_width wrap_content android layout_height wrap_content android text 4 yrs gt lt RadioButton android id id ansThreeC android layout_width Wrap_content android layout_height wrap_content android t
8. I Hay R 3 Jan 3 1983 98th 102nd Pete wilson R Jan 3 1 Agnes 102nd John Seymour R Jan 7 1 1992 appointed 102nd Dianne Feinstein D Present Class 3 Bist 33rd william m Gwin6 0 Mar 3 1861 37th 39th James A McDougall 0 Mar 3 1867 40th 42nd Cornelius Cole R war 3 1873 43rd 45th Aaron A R mar 3 1879 46th 48th James T Farley D Mar 3 1885 2 49th Sist Leland Stanford R Sist 63rd George C Perkins R 64th 66th James D Phelan D 67th 72nd Samuel w Shortridge g 73rd 75th William Gibbs wcadoo D Zah 76th pe O 77th Bist ridan Downey D Bist 82nd Richard m Nixon R 82nd 90th Thomas H Kuchel R Sist 102nd Alan Cranston p 103rd Barbara Boxer D Jun 2i 1893 pied war 3 1915 Appointed then elected war 3 1921 1921 Mar 3 1933 1933 Nov 8 1938 Resigned Jan 3 1939 gt Appointed Nov 30 1950 Resigned Jan 1 1953 Resi Jan 3 1969 appointed then elected Jan 3 1993 Present 4 Figure 6 2 California state senator text file 60069 5 Senators 1 xIsx ME MB A Q Search in Sheet 2 Levi Ankeny R R Wesley L Jones R R Elijah S Grammer R R Homer T Bone D D Warren G Magnuson D T Slade Gorton IlI R R 1 2 3 4 5 6 rf 8 9 Figure 6 3 Senator information for state of Washington 23 Thomas H Carter
9. RR William A Clark D D Joseph M Dixon R R Thomas J Walsh D D John E Erickson D D James E Murray D D Lee W Metcalf D D Paul G Hatfield D D Max S Baucus D D Wilbur F Sanders AR Lee Mantle R SR R William A Clark D D Paris Gibson D D Thomas H Carter RR Henry L Myers D D Burton K Wheeler D Zales N Ecton R R Michael J Mansfielc D Mar 4 1895 Mar 4 1901 Mar 4 1907 Mar 4 1913 Mar 13 1933 Nov 7 1934 Jan 3 1961 Jan 22 1978 Dec 15 19783 Jan 1 1890 Jan 16 18951 Mar 4 1899 Mar 7 1901 Mar 4 1905 Mar 4 1911 Mar 4 1923 Jan 3 1947 Jan 3 1947 Jan 3 1953 Jan 3 1953 Jan 3 1977 Jan 3 1977 Jan 3 1989 Jan 3 1989 Jan 3 2007 Figure 6 5 Senator information for state of Idaho X Mar 3 1901 Mar 4 1901 Mar 3 1907 Mar 4 1907 Jan 19 1940 Died Jan 27 1940 Nov 10 1945 Appointed then elected died Nov 17 1945 Nov 5 1946 Appointed Nov 6 1946 Jan 3 1949 Jan 3 1949 Oct 8 1949 Died Oct 14 1949 Jul 23 1962 Appointed then elected died Aug 6 1962 Jan 3 1973 Appointed then elected Jan 3 1973 Jan 3 1991 Jan 3 1991 Jan 3 2009 Jan 3 2009 Present Dec 18 1890 Mar 3 1891 Mar 4 1891 Mar 3 1897 Mar 4 1897 Mar 3 1903 Mar 4 1903 Oct 17 1912 Died Nov 18 1912 Feb 5 1913 Appointed Feb 6 1913 Jan 13 1918 Di
10. Sia ds ITS TOP FIGURES ii RI it ACKNOWLEDGEMENTS ccssccssesscesoretecesesscoeeseceaoesoneonee CHAPTER 1 INTRODUCTION escri id 2 SENATOR a ia 2 1 Senator OY Wisin 2 LADO Senate asana par a ana a kaa wah 2 1 2 Composition and Election Term 2 2 Senator SeniOrity aaa 2 2 1 Deterministic Factors for Seniority 2 2 2 Seniority Based Benefit 2 3 Senator Classes Based On State 2 3 1 Evolution of Class Based Senate Election 2 3 2 List of States Based on Senate Classes 2 4 Powers of Senator over House Y TECHNOLOG ES 3 1 Android OvervieW iii ias 3 1 1 About Android Aen 3 1 2 Name Android a 3 1 3 Evolution of Android 3 1 4 Phone Manufactures that Use Android 3 1 5 Android Version cuida 3 1 6 Android Architecture aa 3 1 7 Dalvik Virtual Machine 3 2 Android Software Development Kit 3 2 1 Overcome of Traditionally Challenges vil 3 2 2 Android Emulator vestida 13 3 23 Android Debus Bi Id E ag ANA A 13 3 2 4 Android Development Tools ADT asanes nma 14 JE CLIPS a Ka AN cs KN ath Gust A A a a ai 14 SAS SEWAAN Men AA SA Ra a Kn AE AA DG tts 15 4 THE REQUIREMENTS evitara 16 ANDA a a EMS gs a
11. US senate Al ppg O 107 109 107 A 97 2 How many senators serve from every State A Depends on the state Size 2 CI Text Fields 3 How many years do the Senators serve in the Layouts Senate A Oo Composite CI Images amp Media CI Time amp Date CI Transitions CI Advanced Other CI Custom Library Views Graphical Layout B quizview xml Problems Javadoc Declaration 7 Search E Console WB LogCat X Histor Saved Filters Ed Search for messages Accepts Java regexes Prefix with pid All messages no filters Les Time PID TID Application Figure B 6 Shows quizview xml graphical layout
12. amp Media IG main xml CI Time 4 Date A midwestus xml CI Transitions la quizview xml Advanced LA o la tutorialview xml D Other El westcoastus xml CI Custom amp Library Views gt 3 menu gt 5 values gt gt values sw600dp gt values sw720dp land RadioButton CheckedTextView i Problems Javadoc Graphical Layout southus xml Declaration Search E Console WB LogCat X F History gt gt values v11 J gt Gvalues v14 Saved Filters E Search for messages Accepts Java regexes Prefix with pid app gt amp xml All messages no filters A e Les Time PID TID Application d AndroidManifest xml e ic_launcher web png B proguard project txt E project properties Figure B 4 Shows southus xml graphical layout midwestus xml This xml is used to create the map of all the mid west states in US with their on click action listener midwestus xml lt xml version 1 0 encoding utf 8 gt lt LinearLayout xmlns android http schemas android com apk res android android layout_width match_parent android layout_height match_parent 68 android background color LightYellow android orientation horizontal gt lt RelativeLayout android layout_width fill_parent android layout_height match_parent android orientation vertical gt lt Image View android id id westusmap android layout_width fill_parent androi
13. downloaded from Professor Eckberg s website and run on specific devices as discussed in the technology and the requirements chapter When the application is opened on the users device a whole U S map is displayed The user is given an option to tap on any part of the U S map The map is divided into four regions and each region is divided into two or three divisions The four regions are used by the United States Census Bureau Below is a List of regions and the divisions that belong to these regions as found in 13 e Region 1 Northeast e Division 1 New England Maine New Hampshire Vermont Massachusetts Rhode Island Connecticut e Division 2 Mid Atlantic New York Pennsylvania New Jersey e Region 2 Midwest Prior to June 1984 the Midwest Region was designated as the North Central Region e Division 3 East North Central Wisconsin Michigan Illinois Indiana Ohio e Division 4 West North Central Missouri North Dakota South Dakota Nebraska Kansas Minnesota Iowa e Region 3 South e Division 5 South Atlantic Delaware Maryland District of Columbia Virginia West Virginia North Carolina South Carolina Georgia Florida e Division 6 East South Central Kentucky Tennessee Mississippi Alabama e Division 7 West South Central Oklahoma Texas Arkansas Louisiana e Region 4 West e Division 8 Mountain Mountain Idaho Montana Wyoming Nevada Utah Colora
14. senator URL Sd iia 22 Figure 6 2 California state senator text levitra 23 Figure 6 3 Senator information for state of Washington oooconoccnonccnocnnooncnononannnonn cono ncconcnnnno 23 Figure 6 4 Senator information for state of Montana aaa 24 Figure 6 5 Senator information for state Of Idaho ea 24 Figure 6 6 Senator information for state Of WYOMING coooccccoccccooncnnnonnnononcnnnnncnnnoncnnnnnccnnnnccnns 25 Figure 7 1 Senator application project structure in eclipse aa 27 Figure 7 2 Main US map layout structure s0eo0ee00eenno anna an anon nan nenen id 28 Figure 7 3 Tutorial screen layout structure asias 34 Figure 7 4 Quiz screen layout structure ilatina 35 Figure 7 5 Advanced search screen layout structure cit tiated syed 38 Figure 9 1 Interactive instruction ALE AG A a os 41 Figure A 1 Screen shot of SDK starter package includes the Android SDK and AVD ING Ra Nak A stot KANG NE BAN AA Mn aaa a KT ANE EA TKA 44 Figure A 2 Steps to find and execute SDK manager ee 45 Figure A 3 Android platform version choice ccesscecoreecesseccesseesoeteccenteecensseceneescentecee 45 Figure A 4 Screen shot of how to open Eclipse eceeeccecssececseececseececseecesseeeesseeeessteeeenaeeees 46 Figure A 5 Screen shot of the dialog to type ADT Plugin maaa 46 Figure A 6 Screenshot of dev
15. the internal database This database is built into the application using SQLite Database The screen shot below showcases the Structure of the Project in Eclipse Each of the functionalities in the application is grouped as Packages Figure 7 1 7 2 MAIN APPLICATION SCREEN FLOW SCREENS This session discusses about the flow of the application for each of the screen designed as part of the layouts using XML and the corresponding connections to make it interactive Each sub section will display the screen its description How to get to that screen and the next action that needs to be performed on that screen to show the flow of the application The code corresponding to the development of the screen both XML and JAVA will be provided in each of the below sections 7 2 1 Main Screen Description The main screen is displayed at the start of the application This screen displays the U S map with current senators count based on the political parties In the right pane it displays the current list of all the senators in U S along with the party they represent How to get to the current screen after downloading the application Tap on the Senator Icon to open the application HE Package Explorer 23 v is SenatorsThesis vsr v 8 com thesis senatorsthesis gt IJ AdvancedSearchActivity java gt IT EastUSActivity java gt J MidwestUSActivity java gt J QuizActivity java gt 5 Senators java gt J SouthUSActivity java g
16. wishes to develop on For our application purpose it would be beneficial to download Android platform 2 3 API 9 to Android 4 1 API 16 For further information on android versions refer chapter 3 and click Install packages You will be prompted with a pop up check off Accept and click Install Packages Toots SOK Path Packages dh Name APL Rev Status wa Android 3 1 API ID a Android 3 0 APT 11 4 wi Android 2 33 API 10 Y dh SOK Platform 10 2 amp notinstales 7 6 Samples for SOK 10 1 amp Not metoled ly OpenSense SOK for Phones by HTC 10 2 amp Not instolted 44 intel Atom 186 System image by inte Corporation 10 1 Not wstolled dy Dual Sereen APis by KYOCERA Corporation 10 1 Hno d 44 ReaD by LGE 10 1 Hna ez dy Drend by Motorola Mobdity Inc 10 1 Net ineton dy Ord RAZA by Motoris Mobility Inc 10 4 4 Notinstoh iy MTETO by Motorola Mobility in 10 2 Hnos ly M7217 by Motorola Mobility Inc 10 1 Hno 7382 by Motoralo Mobility inc 10 2 Hno EN KTS by Motorsia Mabriity Inc 10 1 Not amp EDK 20 by Sony Ericsson Mobile Communications 10 Not wnstailed By Android 2 2 APIS Gi Android 2 1 APIT WK Android 1 6 APTA Show 4 Updates New Installed Obsolete Select New or Updates Install 3 packages Son by Y API level Repostory Oeselect As Octete 1 package Figure A 3 Android platform version choice 46 Download and Install the Android Development Tools ADT plugin for Eclipse Google provides a custo
17. 1851 32nd 34th John B weller D Jan 30 1852 Mar 3 1857 35th 36th David C Broderick D Mar 4 1857 sept 16 1859 Died 36th Henry P Haun D Nov 3 1859 Mar 4 1860 Appointed 36th 37th milton S Latham D Mar 5 1860 mar 3 1863 38th 40th John Conness R Mar 4 1863 Mar 3 1869 41st 43rd Eugene Casserly 0 _ Mar 4 1869 Nov 29 1873 Resigned 43rd John 5 Hager D Dec 23 1873 Mar 3 1875 44th 46th Newton Booth IR R Mar 4 1875 Mar 3 1881 47th 49th John F Miller R Mar 4 1881 Mar 8 1886 Died 49th George Hearst 0 Mar 23 1886 Aug 4 1886 Appointed 4och abram p williams R Aug 4 1886 Mar 3 1887 30th Sist George Hearst D war 4 1887 Feb 28 1891 Died Sand Charles N Felton R Mar 19 1891 Mar 3 1893 53rd 55th stephen m white D 4 1893 Mar 3 1899 56th 58th Thomas R Bard R Feb 7 19001 war 3 1905 59th Gist Frank P Flint R Mar 4 1905 Mar 3 1911 62nd 64th John D works R Mar 4 1911 war 3 1917 65th 79th Hiram w Johnson R Mar 16 19172 Aug 6 1945 Died 79th 85th william F Knowland R Aug 26 1945 Jan 3 1959 Appointed then elected 86th 88th Clair Engle 0 Jan 3 1959 jul 30 1964 Died 88th pierre E G Salinger 0 Aug 4 1964 Dec 31 1964 Appointed resigned 88th Gist George L Murphy R Jan 1 19653 Jan 2 1971 Resigned Gist 94th John V Tunney D Jan 2 19714 Jan 1 1977 Resigned gath 97th Samuel
18. Java Files gt amp assets gt E bin gt libs v S res gt drawable hdpi gt gt drawable Idpi gt gt drawable mdpi gt gt drawable xhdpi gt gt drawable xxhdpi C Text Fields Y layout Layouts IG advancedsearch xml CI Composite A atie nenga ME a oe C Images amp Media a list_item xml la main xml CI Time amp Date C Transitions IG quizview xml E Advanced a southus xml tutorialview xml Other f CI Custom amp Library Views Gl westcoastus xml gt 3 menu Graphical Layout midwestus xml gt amp values gt values sw600dp gt values sw720dp land Problems Javadoc B Declaration Search E Console WW LogCat X 7 History gt values v11 gt G values v14 Saved Filters E4 Search for messages Accepts Java regexes Prefix with pid ap gt amp xmi All messages no filters e Les Time PID TID Application G AndroidManifest xml Wi ic_launcher web png proguard project txt project properties Figure B 5 Shows midwestus xml graphical layout The quiz features XML layout is displayed in the below section with the XML code and graphical layout quizview xml lt xml version 1 0 encoding utf 8 gt lt LinearLayout xmlns android http schemas android com apk res android 71 android layout_width match_parent android layout_height match_parent android orientation vertical gt lt Scroll View android layout_width
19. U S SENATOR ELECTION HISTORY AND ANDROID APPLICATION A Thesis Presented to the Faculty of San Diego State University In Partial Fulfillment of the Requirements for the Degree Master of Science in Computer Science by Lavanya Vangalkrishnakumar Spring 2013 SAN DIEGO STATE UNIVERSITY The Undersigned Faculty Committee Approves the Thesis of Lavanya Vangalkrishnakumar U S Senator Election History And Android Application p gt Ae 7 pe gg Carl Eckberg Chair 7 Department of Computer Science HAH William Root Department of Computer Science LED Michael O Sallivan Department of Mathematics and Statistics 4 17 13 Approval Date Copyright 2013 by Lavanya Vangalkrishnakumar All Rights Reserved 111 iv DEDICATION I dedicate this thesis to my husband Dr Ravikiran Gopalan I give my deepest expression of love and appreciation for the encouragement that you gave me and the sacrifices you made for me during my graduate program Thank you for all the motivation you had given to pursue my masters and for your company during all the late nights I was working to get my thesis completed ABSTRACT OF THE THESIS U S Senator Election History An Android Application by Lavanya Vangalkrishnakumar Master of Science in Computer Science San Diego State University 2013 The United States current senate composition for the 113 congress totals to 53 members of
20. View b H quickPane LinearLayout ili LinearLayout Ab repNum TextView Rep Ab demNum TextView Dem AblindNum TextView Ind Figure 7 2 Main US map layout structure The main screen layout uses a combination of nested linear layout with relative layout to get the appropriate display There are various widget views that are used to display an image and different information text The complete code snippet of the main xml file is given in Appendix B Some of the core logic for inflating the XML layout and other connection related to the initial screen is discussed below The corresponding JAVA code snippets are displayed The code snippet of the logic that inflates the main xml is given below senator java Refer this class file for complete code private Regions selectedRegion Override protected void onCreate Bundle savedInstanceState super onCreate savedInstanceState setContentView R layout main 29 initialize Once the layout is loaded the handle for all the views widgets is obtained Handle for different widget is performed in initialize method senator java Refer this class file for complete code usMap ImageView find ViewByld R id usmap usMapRegions Image View findViewByld R id regionsusmap activeRegion ImageView findViewByld R id activeregion usMapDrawable usMap getBackground usMapBitmap BitmapDrawable usMap getBackground getBitmap quic
21. a quizview xml CI Advanced GQ southus xml la tutorialview xml Other p CI Custom amp Library Views a westcoastus xml gt amp menu Graphical Layout eastus xml gt values e gt values sw600dp gt 5 values sw720dp land gt values v11 gt gt values v14 gt amp xmi IG AndroidManifest xml e ic_launcher web png B proguard project txt B project properties Figure B 3 Shows estus xml graphical layout 3 Problems Javadoc a Declaration Search El Console X D LogCat 5 History Android southus xml This xml is used to create the map of all the southern states in US with their on click action listeners southus xml lt xml version 1 0 encoding utf 8 gt lt LinearLayout xmlns android http schemas android com apk res android android layout_width match_parent android layout_height match_parent android background color LightYellow android orientation horizontal gt 65 lt RelativeLayout android layout_width fill_parent android layout_height match_parent android orientation vertical gt lt Image View android id id westusmap android layout_width fill_parent android layout_height fill_parent android background drawable south_map android visibility visible gt lt Image View android id id westusstates android layout_width fill_parent android layout_height fill_parent android background drawable south_colo
22. atible device Always uses preferred AVD if set below launches on compatible device A oe eo Select a preferred Android Virtual Device for deployment Jt JUnit Plug in Test 4 OSG Framework _AVD Name Target Name Platform API Level CPU ABI 3 ARM armeabi Y GoogleaPIS Googie APIs Google Inc 2 3 3 10 Emulator launch parameters If no compatible and active devices or AVD s are found then an AVD might be launched Provide options for the A Apply Revert Filter matched 9 of 9 items O Gale Figure A 11 Shows the screenshot of emulator device option How to Run on Emulator Every time you run the application android will prompt you to choose a running device emulator option The AVD you created in AVD Manager will be listed as shown above and can be used to run the application ENE ees gt Select a device compatible with target Google APIs Google Inc Choose a running Android device Serial Number AVD Name Target Debug State O Launch a new Android Virtual Device AVD Name Target Name Platform APILevel Details GoogieAPis Google APIs Google Inc 2 33 10 Refresh Manager use same device for future launches Or Figure A 12 Shows the screen shot of emulator option 32 How to Run on Device To run the application on your device you will have to install the device driver Then connect the device to the system an
23. ble software Hide tems that are already installed Group items by category What n grand instales Show only software apphcable to target emaronment Contact all update ses duning instal to find required software 2 cme Figure A 6 Screenshot of developer tools option Figure A6 screenshot of developer tools option Finally Read and accept the License Agreements When you are done click Finish and restart Eclipse Note you may encounter a Security Warning message notifying you of unsigned content If you do click OK Configure ADT plugin In Eclipse select Window gt Preferences Then select Android from the panel on the left Choose if you want to opt into sending usage statistics and click Proceed Figure A7 screenshot to select Android from the panel on the left 48 B Preterences type filter test O Value must be an existing directory e General Android Preferences Andro Ant SDK Locatson Browse Help aT IT ZN A 0 IAS ply or OK inst Update Browse For Folder ha Java Phag in Development Run Debug Team XML Computer e Network de metadata 4 j android sdk a add ons de platforms de platform tools de samples de temp de tools de eclipse SDK 37 wind2 de Workspaecel Pa and ods T Moke Ner Folder Go ca Cancel Figure A 7 Screenshot to select Android from the panel on the left In the SDK Location field click Browse and choose the directory
24. ce oso ois a Ge Rises aks cle ach tala aon ee nee wa 16 4 2 Plaform Requirements 17 4 3 Functional Requirements iss sicisisescsasacesaccissscaceaspesaatelaceadcossasesdancassdeaapenaccesseeenes 17 ANA Yoli 19 6 DATA COLLECTION AND PREPARATION OF DATA aaa 21 7 APPLICATION DEVELOPMENT WITH FEATURES naaa 26 Tal implementa N ss sasa gage aa ag ta AA E ag A Ngan ae ag d aga neuen 26 7 2 Main Application Screen Flow Screens menemankan aan 26 T2 Man A Sin an a ga aan a an a aana eg Sada E aa na aa a a ag aan 26 722 Region Selection SCTECN 2 6 5 a A AA ANA EN GAN EAEE 31 7 2 3 State Selection Sereen ici nda 34 72A T tonal Serena nn Ken a KG Aa KR cul cag a E NA AG AI nn Kana 34 TPAO VASTE K a o a aaa sath Bk AN EAEE 35 1 2 0 Advanced Search OS CICON A eg ee ee ae 38 CONCULSION AND OBSTRACLES diarias 40 9 FUTURE WORK essa aa AB AA A aa AA Aa ai 41 REFERENCES do AA 42 APPENDIX USER MANUAL O de ans a ee Ss 43 BL APPLICATION CODE ana Bank E carat an tas ama Dk ang eats 53 1X LIST OF FIGURES PAGE Figure 2 1 Senate classes in cacho state il ede 7 Figure Sol Android Moga Gea na dre ia ae te ae Sela aa eae 9 Figure 3 2 Android Version ss an aa a is e eee 11 Figure 3 3 o A na ieee eames eee AAA KA tata tact nian 12 Figure 3 4 Simplified android software VIEW ea nenen ae 13 PISure AMOO LO Cnn alr aaa sasa A ee tla A A aa else ase A ai 14 Figure 6 1 State based
25. d it will be listed in the Android Device Chooser window Select a device compatible with target Google APIs Google Inc Choose a running Android device AVD Name Target Name Platform API Level CPU ABI GoogleAPIS Google APIs Google Inc 2 3 3 10 ARM armeabi use same device for future launches Figure A 13 Screen shot to run on device APPENDIX B APPLICATION CODE 53 54 This section discusses different XML and JAVA files that are used in developing this application When the application loads the US map loads with current party strength Below is the XML code and graphical layout that was developed for populating it main xml lt xml version 1 0 encoding utf 8 gt lt LinearLayout xmlns android http schemas android com apk res android android layout_width match_parent android layout_height match_parent android orientation vertical gt lt LinearLayout android layout_width fill_parent android layout_height 0dp android layout_weight 9 android orientation horizontal gt lt RelativeLayout android layout_width 0dp android layout_height wrap_content android layout_weight 4 android orientation vertical gt lt ImageView android id id usmap android layout_width fill_parent android layout_height fill_parent android background drawable blankusmapgrey android visibility visible gt lt Image View android id 0 id regionsusmap andr
26. d layout_height fill_parent android back ground drawable midwest_map android visibility visible gt lt ImageView android id id westusstates android layout_width fill_parent android layout_height fill_parent android background drawable midwest_colormap android visibility invisible gt lt Image View android id id selectedstate android layout_width fill_parent android layout_height fill_parent android alpha 20 android visibility invisible gt lt LinearLayout android id id quickPane android layout_width fill_parent android layout_height fill_parent android background color LightBlue android orientation vertical android visibility gone gt lt LinearLayout android layout_width fill_parent android layout_height 0dp android layout_weight 4 android orientation vertical gt lt TextView android id id regionName android layout_width Wrap_content 69 android layout_height wrap_content android layout_gravity center android text Senators of USA android textAppearance android attr textAppearanceLarge gt lt TextView android layout_width Wrap_content android layout_height wrap_content android layout_gravity center android layout_marginTop 0dp android text Quick Facts android textAppearance android attr textAppearanceSmall gt lt View android layout_width fill_parent android layout_height 3dp an
27. d virtual devices AVD e Programming Language JAVA e Database SQLite e User Interface UD XML Important point to note it s possible to develop Android applications without Eclipse and the Android Developer Tools plug in but you would need to know your way around the Android SDK Next subsection will discuss in detail about each of the technologies its purpose and usage 3 1 ANDROID OVERVIEW This section gives an overall idea about android its meaning evolution plugins platform and its architecture The section also covers the different set of tools that comes as part of the android software development kit SDK like debugger libraries and a handset emulator that was an integral part of the development environment 3 1 1 About Android Android is a complete operating environment based upon the Linux V2 6 kernel Initially the deployment target for Android was the mobile phone arena including smart phones and lower cost flip phone devices However Android s full range of computing services and rich functional support has the potential to extend beyond the mobile phone market Android being an open source software stack for mobile devices it offers you a great deal of customization in widgets and over millions of apps Most of them are free of cost and can be installed on your phone just by clicking on install tab of the respective app in the Google Play Store app Below is the android logo as found in 5 See Figu
28. do Arizona New Mexico e Division 9 Pacific Alaska Washington Oregon California Hawaii 4 2 PLATFORM REQUIREMENTS In platform requirements there is specification of programming language and other technologies used to develop this application JAVA is used as the programming language for development of this application Android SDK with other related plugins that are mentioned in the technology chapter are used as the development environment The testing of this application is done in Android Nexus Tablet with Jellybean Version and Samsung Galaxy S3 with Ice cream sandwich on phones The operating system used for Development was Mac OS an Apple Product 4 3 FUNCTIONAL REQUIREMENTS The functional requirements of this application refer to the specification of the functions the application should perform and other features the application should possess Dr Carl Eckberg gave all the basic functional requirements and I organized them with some additional features The list of functional requirements is given below 18 Once the application is downloaded on the device the user should be able to click on the Senator Launcher Icon to launch the application When the user starts the application the user must be able to see the whole U S map with the current party based strength for the entire country Tapping on the U S map must be recognized as one of the four regions namely West South Midwest Northeast All the four hi
29. download during the SDK installation step If you want the AVD to run another version of the OS you must download appropriate version packages in the SDK Manager The rest of the options relate to the specific features that you wish to customize the AVD with These features represent hardware features present on physical Android devices For instance you may customize the screen resolution of the emulated device availability of GPS You can even specify a custom battery level state to test particular usage scenarios that app users may encounter Once the user is satisfied with the configuration of the AVD click Create AVD Steps for running the application a In your project in eclipse go to Run Configurations Navigate Search Project Window Help M i Bad i O Q i G ia iavigator E Y G ppg ME 1 soceAndroidapp i Run As gt Run Configurations Organize Favorites common gt mai ara Figure A 10 Show the screenshot of run configuration option b In the target tabchoose the option Always prompt to pick the device and click Run 51 Create manage and run configurations Android Application Q Cex G 7 i RT Android Application Deployment Target Selection Mode ET SOGEANdroidapp O Always prompt to pick device Ju Android JUnit Test Sl KAN Eclipse Application compatible devices Java Applet Active devices and AVD s ED Java Application O Automatically pick comp
30. droid background color Black gt lt include layout layout list_item gt lt ListView android id id quickList android layout_width fill_parent android layout_height wrap_content android layout_marginTop 3dp gt lt ListView gt lt LinearLayout gt lt LinearLayout android layout_width fill_parent android layout_height 0dp android layout_weight android gravity bottom android orientation vertical gt lt Button android id id cancelButton android layout_width match_parent android layout_height wrap_content android layout_gravity bottom android text Hide android textSize dimen quick_pane_text_size gt lt Button android id id moreButton android layout_width match_parent 70 android layout_height wrap_content android layout_gravity bottom android text More android textSize dimen quick_pane_text_size gt lt LinearLayout gt lt LinearLayout gt lt RelativeLayout gt lt LinearLayout gt Graphical representation Below is the Graphical representation of Mid west states xml in eclipse v SenatorsThesis vu ee amp Senators of USA gt E com thesis senatorsthesis RadioButton CheckedTextview gt B com thesis senatorsthesis adapter gt JB com thesis senatorsthesis database Spinner gt 8 com thesis senatorsthesis model pa gt mi Android 4 2 P wi Android Dependencies 5 gt E3 gen Generated
31. e gt lt Button android id id moreButton android layout_width match_parent android layout_height wrap_content android layout_gravity bottom android text More android textSize dimen quick_pane_text_size gt lt LinearLayout gt lt LinearLayout gt lt RelativeLayout gt lt LinearLayout gt Graphical representation 61 Below is the Graphical representation of westcoastus states xml in eclipse PS library gt 2 SampleList Y S SenatorsThesis v Bsre gt E com thesis senatorsthesis gt E com thesis senatorsthesis adapter gt E com thesis senatorsthesis database gt E com thesis senatorsthesis model gt m Android 4 2 P wi Android Dependencies gt E3 gen Generated Java Files gt amp assets gt E gt bin gt B libs Yf res gt gt drawable hdpi gt drawable ldpi gt 2 drawable mdpi gt gt drawable xhdpi gt gt drawable xxhdpi Y layout l advancedsearch xml la eastus xml la list_item xml main xml la midwestus xml la quizview xml la southus xml la tutorialview xml fl westcoastus xml gt 2 menu gt values gt values sw600dp b gt values sw720dp land gt values v11 gt values v14 gt amp xml d AndroidManifest xml ic launcher web png proguard project txt project properties 7 rorm wiagers LE ey Senators of USA Testy sew Large Medium sms Button Small OFF Y CheckBox RadioButton CheckedTextView
32. eam sandwich and above in both phone and tablet Have a basic plan for the flow of the application with the placement of different widgets Make sure user interface is intuitive and provide an instruction guide to help users maneuver the application and explore all the features Develop the main screen of the application so that there is a starting point for the application Develop the layout of a particular screen and the corresponding background connection using java to display the screen Add the xml data collected to the development environment to populate the collected information regions wise 20 13 When the user taps on to a specific region of the U S map display the states that belong to that region Further tapping on to a particular state in the group display the senator related details The step by step flow in the application gives user a path to follow and help them use the application 14 Provide a user quiz feature that helps them recollect the information in the application 21 CHAPTER 6 DATA COLLECTION AND PREPARATION OF DATA This thesis application needed a large amount of data to be collected for different state senators over a century Please note that some of the states like Arizona the data provided is from the 20 century The application need data based on each state in the U S Professor Carl Eckberg Department of computer Science guided me in organizing the information which could be displayed
33. ection Term The United States is made up of 50 states Two senators represent each state irrespective of the population of the state For instance Rhode Island being the smallest of size around 1 045 sq miles has two senators elected for that state On the other hand Texas being the largest state still has only two senators that are elected The two senators from a given state each serve a staggered term of six years The intention is to present states large in area or population from dominating smaller states 2 2 SENATOR SENIORITY Each of the senators elected has a description about their seniority Each senator is either classified as a senior or junior Seniority in the senate plays a valuable role as the number of benefits is based on the continuous length of the duration served along with ties broken by a series of factors 2 2 1 Deterministic Factors for Seniority Continuous Service Main factor e Former Senator e Former Representative e Former President of the United States e Former Vice President of the United States e Former Cabinet member e Former state Governor e Population of state based on the most recent census when the senator took office e Alphabetical by last name in case two senators came from the same state on the same day and have identical credentials as found in 3 The above mentioned factors are used to break the tie when there are two senators who have served in the same previous role length
34. ed Jan 22 1918 Jan 14 19221 Appointed then elected resigned Jan 15 19211 Jun 24 1928 Died Jun 30 1928 Mar 3 1933 Appointed then elected Mar 4 1933 Jan 3 1939 Jan 3 1939 Jan 3 1945 Jan 3 1945 Jan 3 1951 Jan 3 1951 Jan 3 1957 Jan 3 1957 Jan 3 1981 Jan 3 1981 Jan 3 1993 Jan 3 1993 Jan 3 1999 Jan 3 1999 Present ll Coma 24 TERAS xa 2 fx 51st 52nd Yer Search in Sheet gt Lester C Hunt D D Edward D Crippa R Joseph C O Mah D John Joseph Hick D Milward L Simps R Gifford P Hanser R Alan K Simpson R c D Jun 24 1954 Nov 29 1954 Jan 3 19612 Nov 7 1962 Jan 3 1967 Mar 3 1893 Mar 3 1917 Nov 3 1933 Jan 3 1953 Jan 3 1959 Jan 3 1977 Jan 3 1995 Jun 4 2007 Present Mar 3 1895 Nov 24 1929 Nov 30 1930 Jan 3 1937 Jan 3 1943 Jan 3 1949 Jun 19 1954 Nov 28 1954 Jan 3 1961 Nov 6 1962 Jan 3 1967 Dec 31 1978 Jan 3 1997 Figure 6 6 Senator information for state of Wyoming 25 26 CHAPTER 7 APPLICATION DEVELOPMENT WITH FEATURES 7 1 IMPLEMENTAION This application is developed using Eclipse IDE and Android SDK plugins All the layouts are written using the XML files connections to inflate the layout and perform the action corresponding to the tapping is written using the JAVA programming language The data that is populated during each tap is retrieved from
35. ed on election by the state legislatures until the Seventeenth Amendment required direct popular election of Senators 2 3 2 List of States Based on Senate Classes e Class 1 States with a Class 1 senator Arizona California Connecticut Delaware Florida Hawaii Indiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Jersey New Mexico New York North Dakota Ohio Pennsylvania Rhode Island Tennessee Texas Utah Vermont Virginia Washington West Virginia Wisconsin and Wyoming Class 1 senators consist of the 33 senators who were last elected in November 2012 whose seats are scheduled for re election in November 2018 as found in 4 e Class 2 States with a Class 2 senator Alabama Alaska Arkansas Colorado Delaware Georgia Idaho Illinois Iowa Kansas Kentucky Louisiana Maine Massachusetts Michigan Minnesota Mississippi Montana Nebraska New Hampshire New Jersey New Mexico North Carolina Oklahoma Oregon Rhode Island South Carolina South Dakota Tennessee Texas Virginia West Virginia and Wyoming Class 2 senators consist of the 33 senators whose seats are scheduled for re election in November 2014 and whose terms end in January 2015 as found in 4 e Class 3 States with a Class 3 senator Alabama Alaska Arizona Arkansas California Colorado Connecticut Florida Georgia Hawaii Idaho Illinois Indiana lowa Kansas Kentucky Lou
36. ed to the senate This screen is used to refresh the knowledge about the senator that is specified in chapter two of this document How to get to the current screen Tapping on the Tutorial button on the main screen as part of the quick facts pane See Figure 7 3 Structure ta Outline W 1 ScrollView LinearLayout Bb tutorialText TextView Figure 7 3 Tutorial screen layout structure Xml code snippet for UI Refer Appendix B JAVA code for Logical flow TutorialActivity java Below code inflates the tutorialview xml Override protected void onCreate Bundle savedInstanceState super onCreate savedInstanceState setContentView R layout tutorialview initialize 34 35 The code below is used to initialize the widget view in the above mentioned xml private void initialize tutorialText TextView findViewB yld R id tutorialText tutorialText setText getResources getString R string tutorialText 7 2 5 Quiz Screen Description The quiz screen display a screen where the user can take a quiz This feature in the application can be a fun way to test the knowledge they have obtained using this application How to get to the current screen Tapping on the Take the quiz button on the main screen as part of the quick facts pane Internally the application has more than 5 collections in the quiz Figure 7 4 Structure t Outline LinearLayout t ScrollView a LinearLayout
37. eloper tools option ea 47 Figure A 7 Screenshot to select Android from the panel on the left 48 Figure A 8 Screen shot in Eclipse navigate to Window gt AVD Manager 49 Figure A 9 Screenshot how to create AVD A SS 49 Figure A 10 Show the screenshot of run configuration OptioOnN aaa 50 Figure A 11 Shows the screenshot of emulator device Option aa 51 Figure A 12 Shows the screen shot of emulator OptioOn aaa 51 Figure A 13 Screen shot to run on device 0 A RA A rt 52 Figure B 1 Shows main xml graphical layout ena naaa aan 58 Figure B 2 Shows westcoastus xml graphical layout ena nana aana nane nane nana aan 61 Figure B 3 Shows estus xml graphical la O A anana nana anana nane vases 64 Figure B 4 Shows southus xml graphical layout naaa aan aaa aan 67 Figure B 5 Shows midwestus xml graphical layout aee nena nenen n nean anna anane aan 70 Figure B 6 Shows quizview xml graphical layout 0oseeneeaaee aana nen anana nana an anana anane aen 75 xi ACKNOWLEDGEMENTS I thank my advisor Dr Carl Eckberg for giving me an opportunity to work on this thesis project and for his constant guidance support and motivation throughout this Thesis I would also like to thank Professor Root William and Professor Michael O S
38. evice emulator so that Android applications can be tested without a real Android phone You can create Android virtual devices AVD via the Android SDK which runs in this emulator The Android SDK contains the Android debug bridge adb tool which allows connecting to a virtual or real Android device Most of these tools are command line based 3 2 1 Overcome of Traditionally Challenges Historically two areas where mobile applications have struggled to keep pace with their desktop counterparts are graphics media and data storage methods Android addresses the graphics challenge with built in support for 2 D and 3 D graphics including the OpenGL library The data storage burden is eased because the Android platform includes the popular open source SQLite database Figure 3 4 13 Applications Built in phone contacts browser Third party Custom Application frameworks Telephone Mgr Location Mar Notification Mgr Content providers Windowina Resource Mgr etc Libraries Andnod runtime Graphics media database WebKit etc Dalvik Virtual Machine Linus Kernel Power File system drivers process management etc Figure 3 4 Simplified android software view 3 2 2 Android Emulator The Android SDK includes a mobile device emulator a virtual mobile device that runs on your computer The emulator lets you develop and test Android applications without using a physical device as found in 8 The emulator supports a var
39. ext 6 yrs gt lt RadioButton android id id ansThreeD android layout_width wrap_content android layout_height wrap_content android text Lifelong gt lt RadioGroup gt lt TextView android id id QuestionFour android layout_width match_parent android layout_height match_parent android text 4 How many classes from every state gt lt RadioGroup android id id AnswerFour android layout_width Wrap_content android layout_height wrap_content gt lt RadioButton android id id ansFourA 74 android layout_width wrap_content android layout_height wrap_content android checked true android text 2 gt lt RadioButton android id id ansFourB android layout_width Wwrap_content android layout_height wrap_content android text 4 gt lt RadioButton android id id ansFourC android layout_width Wrap_content android layout_height wrap_content android text 1 gt lt RadioButton android id id ansFourD android layout_width wrap_content android layout_height wrap_content android text 3 gt lt RadioGroup gt lt LinearLayout gt lt ScrollView gt lt LinearLayout android id id correctWrongPane android layout_width match_parent android layout_height 0dp android layout_weight android background color LightBlue android orientation vertical gt lt TextView android id id correctWrongTextView android
40. ghlighted regions must be color coded The entire list of current senators must be displayed as Quick Facts on the right hand pane when the user taps on the US map Tapping and holding a specific region must display a division maps with the states that belong to that division of the region Tapping on a particular state must display the list of senators of that state When the user taps on the Take a Quiz button a quiz screen must be displayed When the user takes the quiz based on the options selected in the quiz a message must be displayed to indicate if the answer chosen was correct wrong When the user taps on the Tutorial button a tutorial screen about the senate and his her responsibilities must be displayed When the user taps on the Read me button a instruction screen on how to use the application and its features must be displayed When the user taps on the Advanced Search button an advanced search screen must be displayed with All as default option In the Advanced Search screen user must be able to filter based on the state In the Advanced Search screen user must be able to filter based on the senate class User must be able to arrange the senator name in both ascending and descending order User must be able to use the application both on phone and tablet on both Ice cream sandwich and Jellybean 19 CHAPTER 5 ANALYSIS I had analyzed all the requirements needed f
41. he available screen width For the first generation of tablets running Android 3 0 the proper way to declare tablet layouts was to put them in a directory with the x1arge configuration qualifier for example res layout xlarge e A set of four generalized densities ldpi low mdpi medium hdpi high and xhdpi extra high 3 1 6 Android Architecture Android runs atop a Linux kernel Android applications are written in the Java programming language and they run within a virtual machine VM It s important to note that the VM is not a JVM as you might expect but is the Dalvik Virtual Machine an open source technology Each Android application runs within an instance of the Dalvik VM which in turn resides within a Linux kernel managed process as shown in Figure 3 3 3 1 7 Dalvik Virtual Machine The Android system uses a special virtual machine i e the Dalvik Virtual Machine to run Java based applications Dalvik uses its own byte code format which is different from Java byte code Therefore we cannot directly run Java class files on Android they need to get converted in to the Dalvik byte code format 3 2 ANDROID SOFTWARE DEVELOPMENT KIT The Android Software Development Kit SDK contains the necessary tools to create compile and package an Android application The Android SDK also provides an 12 Linux Kernel Linux process Dalvik Virtual Machine Android application Figure 3 3 Android architecture Android d
42. heckedId R id ansThreeC correctWrongPane setVisibility View VISIBLE answerText setText WRONG answerExplanationText setText TheSenators serve in the Senate for 6 years n Correct answer C else correctWrongPane setVisibility View VISIBLE answerText setText CORRECT answerExplanationText setText break case R id AnswerFour if checkedId R id ansFourA correctWrongPane setVisibility View VISIBLE answerText setText WRONG answerExplanationText setText There are two classes for every Senate n Correct answer A else correctWrongPane setVisibility View VISIBLE answerText setText CORRECT answerExplanationText setText break default break 38 7 2 6 Advanced Search Screen Description The advanced search screen displays the advanced feature where the user can filter the senator details based on different options on the screen By default all the states of the U S along with the complete list of the senators are displayed This screen also displays a column named comments which indicates special circumstances during the senators elected term if any The different options in the advanced search feature are mentioned below 1 Filter the list of senators based on the state 2 Arrange the senator names in ascending or descending order using the last name 3 Filter the list of senators based on the senate class How to get to the current scree
43. hical layout Below is the List of all the XML Files along with the Graphical representation of each region creation for this application Westcoastus xml This xml is used to create the map of all the western states in US with their on click action listeners westcoastus xml lt xml version 1 0 encoding utf 8 gt lt LinearLayout xmlns android http schemas android com apk res android android layout_width match_parent android layout_height match_parent android background color LightYellow android orientation horizontal gt lt RelativeLayout android layout_width fill_parent 59 android layout_height match_parent android orientation vertical gt lt ImageView android id id westusmap android layout_width fill_parent android layout_height fill_parent android background drawable west_map android visibility visible gt lt ImageView android id id westusstates android layout_width fill_parent android layout_height fill_parent android back ground drawable west_colormap android visibility invisible gt lt ImageView android id id selectedstate android layout_width fill_parent android layout_height fill_parent android alpha 20 android visibility invisible gt lt LinearLayout android id id quickPane android layout_width fill_parent android layout_height fill_parent android background color LightBlue and
44. iety of options that you can specify when launching the emulator to control its appearance or behavior Figure 3 5 is a sample image of an emulator as found in 9 3 2 3 Android Debug Bridge Android Debug Bridge adb is a versatile command line tool that lets you communicate with an emulator instance or connected Android powered device It is a client server program that provides three components e Aclient which runs on your development machine You can invoke a client from a shell by issuing an adb command Other Android tools such as the ADT plugin and DDMS also create adb clients e A server which runs as a background process on your development machine The server manages communication between the client and the adb daemon running on an emulator or device e A daemon which runs as a background process on each emulator or device instance Above discussed points can be referred from 10 14 PPS Ja Jai FE Pe rN FIFI ha rd t lacas des re dos YA mera era a pa gt y y 1 we p pen TY A jan ar Figure 3 5 Android emulator 3 2 4 Android Development Tools ADT Android Development Tools ADT is a plugin for the Eclipse IDE that is designed to give a powerful integrated environment in which we can build Android applications ADT extends the capabilities of Eclipse to let us quickly set up new Android projects create an application UI add packages based on the Android Framework API debug your applica
45. in a more user friendly way Below are the links of different states from the senator gov site 14 an official site for U S senators In addition I have also added more relevant columns for each state based senator list Figure 6 1 Initially when the application starts a U S map is displayed Based on the user s selection regional division map is displayed Then the state selection displays the information provided in each of the links above The information provided in the links is saved as a flat file The screen shot of the text file for the state of California is in Figure 6 2 Each of the text files has both the classes of the senator of a particular state Using the text file for senators of each state the xml formatted files were generated using the conversion software Below is the sample screen shot for senators of Washington State Montana Idaho and Wyoming Figures 6 3 6 6 State based U S Senator List Links in Ascending order S No State URL 1 Alabama http www senate gov states AL senators htm 2 Alaska http www senate gov states AK senators htm 3 Arizona http www senate gov states AZ senators htm 4 Arkansas http www senate gov states AR senators htm 5 California http www senate gov states CA senators htm 6 Colorado http www senate gov states CO senators htm 7 Connectic
46. in will display the main screen Tapping and holding will take the user to the next screen How to get to the current screen Tapping and holding on any region on the main screen will display the current screen Single tap will just highlight the region and tapping the highlighted region will display the main screen Next Action to be performed Tapping on to the regions state divisions available will display the senator related information of that state Xml code for UI Refer Appendix B JAVA code for Logical flow EastUS Activity java Below code inflates the eastus xml Override protected void onCreate Bundle savedInstanceState super onCreate savedInstanceState setContentView R layout eastus initialize Once the xml is inflated handle for each widget view is obtained using the below code This is code in the initialize method private void initialize westUS Image View findViewB yld R id westusmap westUS Drawable westUS getBackground westUSBitmap BitmapDrawable westUS getBackground getBitmap listView ListView findViewByld R id quickList quickPane LinearLayout findViewByld R id quickPane cancelButton Button findViewByld R id cancelButton 32 moreButton Button findViewByld R id moreButton regionName TextView findViewByld R id regionName westUSStates ImageView findViewByld R id westusstates selectedState ImageView findViewByld R id selectedsta
47. involved as found in 3 2 3 SENATOR CLASSES BASED ON STATE Purpose The class system is a way to determine which senate seats will be available for election in a given year The class system is divided into three groups namely class 1 class 2 and class3 Each of the 50 states belongs to two of the class systems 2 3 1 Evolution of Class Based Senate Election The political leaders and statesmen who participated in the American Revolution by signing the United States Declaration of Independence decided to stagger the elections so that a third of the Senate was up for election every two years The idea behind this staggered approach was to ensure stability in the senate and encourage senators to deliberate measures over time rather than risk a rapid turnover of the entire chamber every six years They also wanted more frequent elections as opposed to waiting every six years to prevent senators from permanently combining for sinister purposes The three classes were specified based on article 1 of United States constitution The plan of execution for the terms of each senate class was that the seats of the first Class shall be vacated at the expiration of the second year of the second Class at the Expiration of the fourth year and of the third Class at the Expiration of the sixth year so that one third may be chosen every second year Upon the expiration of a senator s term of any length someone starts a new six year term as senator bas
48. isiana Maryland Missouri Nevada New Hampshire New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania South Carolina South Dakota Utah Vermont Washington and Wisconsin Class 3 senators consist of the 33 senators whose seats are scheduled for re election in November 2016 and whose terms end in January 2017 as found in 4 Below is the pictorial representation of the state based classes of the senate Figure 2 1 2 4 POWERS OF SENATOR OVER HOUSE Below is the list of powers of the senate when compared to the house e Consenting to treaties as a precondition to their ratification Map shows the classes in each US State Classes and 2 Classes 1 and 3 Classes 2 and 3 Figure 2 1 Senate classes in each state Consenting to or confirming appointments of Cabinet secretaries federal judges other federal executive officials military officers regulatory officials ambassadors and other federal uniformed officers as well as trial of federal officials impeached by the House A bestselling book about senate years back was advice and consent The senate is both more deliberative and more prestigious than the House of Representatives due to its longer terms smaller size and statewide constituencies which historically led to a more collegial and less partisan atmosphere The house has its own authority for example spending plans must originate in the house The nations founding father found governme
49. kPane LinearLayout find ViewByld R id quickPane cancelButton Button findViewByld R id cance Button moreButton Button findViewB yld R id moreButton quizButton Button findViewByld R id quizButton listView ListView findViewByld R id quickList RepView TextView find ViewBylId R id repNum DemView TextView findViewB yld R id demNum IndView TextView findViewByld R id indNum After getting the handle of different widgets the on click listeners are set so that the appropriate action are lined to the widgets senator java Refer this class file for complete code Set on click listners cancelButton setOnClickListener this moreButton setOnClickListener this quizButton setOnClickListener this usMap setOnTouchListener this usMap setOnLongClickListener this The database is initialized by clearing the statistic and opening the database for use senator java Refer this class file for complete code Statistics clear datasource new SenatorDataSource this datasource open The code below is the method that is used to display the quick fact details based on the region tapped 30 senator java Refer this class file for complete code protected void SetUpQuickPane Regions regions int visible quickPane setVisibility visible activeRegion setVisibility visible if visible View VISIBLE ArrayAdapter lt Senator gt adapter ArrayAdapter lt Senator gt
50. list View getAdapter switch regions case WEST quickPane setBackgroundColor getResources getColor R color LightBlue activeRegion setBackgroundResource R drawable regions_west_colormap break case MIDWEST quickPane setBackgroundColor getResources getColor R color LightYellow activeRegion setBackgroundResource R drawable regions_midwest_colormap break case SOUTH quickPane setBackgroundColor getResources getColor R color LightPink activeRegion setBackgroundResource R drawable regions_south_colormap break case EAST quickPane setBackgroundColor getResources getColor R color LightCyan activeRegion setBackgroundResource R drawable regions_east_colormap break default break adapter notifyDataSetChanged else clear numTaps 31 7 2 2 Region Selection Screen Description This screen displays the region based selection Based on the tap the application recognizes the region and highlights that region as West Northeast Midwest and South Internally below the visible U S map is a color coordinated map based on the region which is invisible to the user When the user taps on to a particular region the hidden map below recognizes the color of the x and y coordinate tapped and checks to see which region the tapped area belongs to and then displays an image of that map with the regions named and color coded Note Tapping on it will display the highlighted region and tapping it once aga
51. m plugin for Eclipse called ADT that aids developers in creating Android applications faster and more efficiently Open Eclipse and select Help gt Install New Software Figure A4 show the screen shot of how to Open Eclipse and select Help gt Install New Software 9 0 Q WG DA S Wion poner 7 Heip Contents a P Search Dynamic Help Key Asust t n Tips and T heat Sheet Check for Updates About Eclipse SOK Figure A 4 Screen shot of how to open Eclipse Then click Add option In the pop up dialog type ADT Plugin in the Name field and enter the below URL in the location field https dl ssl google com android eclipse pe or select a site hd Add Add Repository Name ADT Plugin Locaton hMtps di ssl google com androsd echpse Figure A 5 Screen shot of the dialog to type ADT Plugin Figure AS show the screen shot of the dialog to type ADT Plugin in the Name field and enter the following URL in the location field Then Click OK If you re having issues in downloading the plugin use http instead of https Select the Developer Tools option and click Next Once the tools are downloaded click Next 47 Name Veruon Y ii Developer Took Y 4 gt Androed DOMS 170 0 v201203161636 291853 Y 4 gt Androed Developement Tools 17 v201203161636 291853 Y 4 gt Andresd Hierarchy Viewer 120 Y y Andre Tracenew Select All Deselect Al 4 tems selected Detads Show only the latest vernons of arada
52. n Tapping on the Advanced search button on the main screen as part of the quick facts pane Figure 7 5 Structure Outline LinearLayout Ej include list item ki iii LinearLayout ES NameToggle Switch EM Congress loggle Switch StateToggle Spinner e ClassOfToggle Spinner TermStartToggle Switch EN TermEndToggle Switch EH CommentsToggle Switch E quickList ListView Figure 7 5 Advanced search screen layout structure Xml code for UI Refer Appendix B JAVA code for Logical flow Below is the code to inflate the advancedsearch xml layout AdvancedSearchActivity java Override protected void onCreate Bundle savedInstanceState super onCreate savedInstanceState setContentView R layout advancedsearch initialize 39 40 CHAPTER 8 CONCULSION AND OBSTRACLES In this chapter the obstacles faced during the application development and an overall conclusion is discussed The obstacles were twofold One making the powerful tools of databases compatible with android and two understanding the political context for the project Databases are powerful tools for data mining searching and sorting of large sets of data This tool is usually used in a PC environment Adapting this tool to the emerging format of android mobile OS presented a major challenge Advanced tools existed to make these two disparate tools compatible I had to make myself familiar with SQLite which wa
53. nate seniority https en wikipedia org wiki Seniority_in_the_United_States_Senate accessed January 2013 n d 4 WIKIPEDIA United States senate class https en wikipedia org wiki Seniority_in_the_United_States_Senate accessed January 2013 n d 5 GOHARSH Android version and logo information http www goharsh com cell phone what is android accessed February 2013 n d 6 AROKIAIT About Android http www arokiait com whatis android htm accessed February 2013 n d 7 WIKIPEDIA Android Operating system evolution details http en wikipedia org wiki Android_ 28operating_system 29 accessed January 2013 n d 8 ANDROID DEVELOPER GUIDE Android emulator http developer android com tools help emulator html accessed January 2012 n d 9 ANDROID DEVELOPER GUIDE Emulator tool http developer android com tools devices emulator html accessed February 2013 n d 10 ANDROID DEVELOPER GUIDE Android debug bridge http developer android com tools help adb html accessed February 2013 n d 11 ANDROID DEVELOPER GUIDE Android developer tool http developer android com tools sdk eclipse adt html accessed February 2013 n d 12 VOGELLE TUTORIAL SQLite Tutorial http www vogella com articles AndroidSQLite article html accessed February 2013 n d 13 WIKIPEDIA United States Census bureau s list of regions https en wikipedia org wiki List_of_regions_of_United_states accessed March 2013
54. nt android layout_marginTop 3dp gt lt ListView gt lt LinearLayout gt 56 lt LinearLayout android layout_width fill_parent android layout_height 0dp android layout_weight 2 android gravity bottom android orientation vertical gt lt Button android id id cancelButton android layout_width match_parent android layout_height wrap_content android layout_gravity bottom android text Tutorial android textSize dimen quick_pane_text_size gt lt Button android id id quizButton android layout_width match_parent android layout_height wrap_content android layout_gravity bottom android text Take a Quiz android textSize dimen quick_pane_text_size gt lt Button android id id moreButton android layout_width match_parent android layout_height wrap_content android layout_gravity bottom android text Advanced Search android textSize dimen quick_pane_text_size gt lt LinearLayout gt lt LinearLayout gt lt LinearLayout gt lt LinearLayout android layout_width fill_parent android layout_height 0dp android layout_weight android layout_alignParentBottom true android layout_alignParentLeft true android orientation horizontal gt lt TextView android id id repNum android layout_width 0dp android layout_height fill_parent 57 android layout_gravity bottom android layout_weight J android background color Blue
55. nt Senate is both a more deliberative and its members are more prestigious than the House of Representatives due to its longer terms smaller size and statewide constituencies which historically led to a more collegial and less partisan atmosphere CHAPTER 3 TECHNOLOGY The U S senate application is developed on the technology that supports mobile tablet based applications development In the mobile world the front runners like iPhone and Android form the major market shareholders U S senator application is targeted for students and teacher of different grades who would like refreshing their memory on U S senators of different states over different time periods This application is developed specifically for Android based Mobiles Tablet Based on the 3 quarter result of mobile market in 2012 Android forms 72 2 of the mobile market out ranking its competitors The application is developed using Android SDK and JAVA programming language Most of the Android native applications are developed using JAVA Android NDK forms the lower layer of the Architecture and uses C for development purpose The application uses SQLlite for database related support The layout for each screens is developed using XML scripting language Below is the consolidated list of technologies used for developing the senator s app for Android devices e Tools Android SDK Android debug bridge adb e Integrated Development Environment IDE Eclipse Androi
56. nto our development environment Flow the screen shot below for reference Download the Android SDK CI CI CI Vindows Pip ade 2956241 bytes 8b926c0c 0nd 1046065 En Recommended 29561554 bytes 342 tddat904886b069004 908 Ic M59 mel android adk maco zp WATU bytes dtdc2b ft SeedSedceSciMicdtotct aa Linux 1386 aro ade_ 16 hna taz 22048174 bytes JbasS7173 105 1daI74 1c 2c BS M0 0458 Figure A 1 Screen shot of SDK starter package includes the Android SDK and AVD Manager Downloaded starter package only contains the newest version of the SDK tools In order to develop Android applications we will need to download at least one Android platform so we can emulate a phone tablet via our computer hardware 45 2 Inthe root of the SDK directory find and execute the SDK Manager exe file Note Right click and run as administrator to avoid any permission declination J TE aa ts Organiza itt Open Share wth New folder WW Favorites oe Date modifed WE Desktop de add ons 4 Downloads de platforms DL Recent Places de tools AVD Manager 11 444 PM P tins A Libranes SOK Manager 12720011 444004 Ambici n Documents SOK Resdme Open a gt Music uninstall Runas administrator ee Pictures Troubleshoot compatibility 8 Share with 4 Pin to Taskbar pa Col Pin to Start Menu e Nasal Restore previous versions Send to Cut Copy Figure A 2 Steps to find and execute SDK manager Choose the Android platform version which user
57. of time in that prior office For instance Barbara Mikulski Richard Shelby John McCain and Harry Reid all took office on January 3 1987 and each had previously served in the House of Representatives Mikulski having served 10 years is more senior than Shelby who served 8 They are both more senior than McCain and Reid who each served 4 years McCain however outranks Reid because Arizona s population was higher than Nevada s as of the 1980 census as found in 3 2 2 2 Seniority Based Benefit The constitution does not mandate a difference in rights or power but senate rules give more power to senior senators when compared with the juniors The president pro tempore of the Senate is traditionally the most senior member of the majority party List of senior senate perks e Senior senators will have more power especially within their own congressional caucuses e By tradition senior senators from the president s party control federal patronage appointments in their states e Senators are given preferential treatment in choosing committee assignments based on seniority e Greater seniority enables a senator to choose a desk closer to the front of the Senate Chamber e Senators with higher seniority may choose to move into better office space as those offices are vacated e Seniority determines the ranking in the United States order of precedence although other factors such as being a former President or First Lady are
58. oid layout_width fill_parent android layout_height fill_parent android background drawable regions_us_map android visibility invisible gt lt ImageView android id id activeregion android layout_width fill_parent android layout_height fill_parent android visibility invisible gt lt RelativeLayout gt 55 lt LinearLayout android id id quickPane android layout_width 0dp android layout_height fill_parent android layout_weight J android background color LightBlue android orientation vertical android visibility gone gt lt LinearLayout android layout_width fill_parent android layout_height 0dp android layout_weight 4 android orientation vertical gt lt TextView android id 0 id regionName android layout_width wrap_content android layout_height wrap_content android layout_gravity center android text Senators of USA android textAppearance android attr textAppearanceLarge gt lt TextView android layout_width Wrap_content android layout_height wrap_content android layout_gravity center android layout_marginTop 1 0dp android text Quick Facts android textAppearance android attr textAppearanceSmall gt lt View android layout_width fill_parent android layout_height 3dp android background color Black gt lt ListView android id id quickList android layout_width fill_parent android layout_height wrap_conte
59. or the development of this application and came up this list of steps 1 10 11 12 Understand the U S congress and its constitutional structure Focus on the Senator part of the congress Understand the core responsibilities and functioning of the U S senate Make a plan for organizing the senators details based on either the geographical regions of the U S or Geo political division or division based on the party strength of each state Then based on the decision collect the list of senators from each state from 1850 to present In our case collect the list based on geographical and geo political division of the U S Once the data is collected from the mentioned sites in chapter 6 save them as text files in the order in which you would like them to be displayed in the application Then convert the text files into the xml format using convertor software The xml files are easier understood by the Android application Keep in mind the final application is displayed in mobile tablet devices so the road map of the flow of application must cater to a smaller real estate than regular desktop application Make the necessary images for each state based on the regional classification using GIMP software It would be easier to recognize if the grouped state are color coded Set up the development environment based on the user manual chapter see Appendix A The Application is supported only on the devices that run on Ice cr
60. re 3 1 Es 1 ANDROID Figure 3 1 Android logo 3 1 2 Name Android Android has a dictionary meaning of being a human that resembles automation The true character of its name is it s the Google created software stack for creating comprehensive Mobile Applications and Software to realize the full potential of one s Mobile handset and its possibilities Android is a comprehensive software stack of mobile devices that includes an operating system middleware and key applications This software bundle is used in Mobile Technology and is called The Android Software Development Kit SDK as found in 6 10 3 1 3 Evolution of Android Andy Rubin founded Android Inc in Palo Alto California in October 2003 Google acquired Android Inc on August 17 2005 making it a wholly owned subsidiary of Google Key employees of Android Inc including Rubin Miner and White stayed at the company after the acquisition The Android platform is the product of the Open Handset Alliance a group of organizations collaborating to build a better mobile phone The group led by Google includes mobile operators device handset manufacturers component manufacturers software solution and platform providers and marketing companies as found 7 3 1 4 Phone Manufactures that Use Android Android is an open source platform which can be used by any phone manufacturers on the world Samsung is the largest manufacturer of android phones and table
61. receive senators in classes 1 and 2 at which point all three classes would have 34 senators Each state belongs to two of the three classes The main purpose of the classes in the senate is to determine which Senate seats will be up for election in a given year Popular election to the senate was standardized nationally in 1913 by the 17 amendment While there is a lot of information available about the senate in this fast paced mobile world we would like to have the information readily available any place any time The main focus here is to provide a quick but a detailed summary about the senate and its election trends The application is developed as an Android application for mobile phones tablets The user can look up senate senator facts on the fly using their mobiles tablets The application is intended for self study by students at any level K 12 or college e g in history teachers can give assignments based on the political science application by including questions to be answered by a student after exploring the app The application can be downloaded for any device that runs Android version 2 3 and above Due to extensive use of a database all the information necessary for the application is self contained A user needs to have JRE installed on his her system The android application is written in the Java programming language and developed using Android SDK and other necessary plugins in Eclipse IDE vi TABLE OF CONTENTS ABSTRACT
62. rialActivity java gt 5 WestUSActivity java Y 3 com thesis senatorsthesis adapter gt J senatorAdapter java Y com thesis senatorsthesis database gt 3 MySQLiteHelper java gt 5 MySQLiteHelperAllStates java gt IJ SenatorAllStateDataSource java gt D SenatorDataSource java Y com thesis senatorsthesis model gt A Senator java gt D Statistics java gt m Android 4 2 gt Bi Android Dependencies gt E3 gen Generated Java Files gt assets gt E bin gt Siibs Y res gt drawable hdpi gt drawable ldpi gt gt drawable mdpi gt drawable xhdpi gt E gt drawable xxhdpi Y layout ci advancedsearch xml ci eastus xml Id list_item xml IG midwestus xml Idi quizview xml IG southus xml IG tutorialview xml IG westcoastus xml gt E menu gt values gt E gt values sw600dp gt Evalues sw720dp land gt values v11 gt values v14 gt xml AndroidManifest xml ic_launcher web png E proguard project txt project properties Small Off Y CheckBox 8 Senators of USA RadioButton CheckedTextview Spinner ua hem ery CI Text Fields CI Layouts E Composite CI Images amp Media CI Time amp Date Transitions CI Advanced C omer CI Custom amp Library Views E Graphical Layout E main xml Problems Android Javadoc B Declaration Search EJ Console 23 g Progress ED Log Figure B 1 Shows main xml grap
63. rmap android visibility invisible gt lt ImageView android id id selectedstate android layout_width fill_parent android layout_height fill_parent android alpha 20 android visibility invisible gt lt LinearLayout android id id quickPane android layout_width fill_parent android layout_height fill_parent android background color LightBlue android orientation vertical android visibility gone gt lt LinearLayout android layout_width fill_parent android layout_height 0dp android layout_weight 4 android orientation vertical gt lt TextView android id id regionName android layout_width wrap_content android layout_height wrap_content android layout_gravity center 66 android text Senators of USA android textAppearance android attr textAppearanceLarge gt lt TextView android layout_width wrap_content android layout_height wrap_content android layout_gravity center android layout_marginTop 1 0dp android text Quick Facts android textAppearance android attr textAppearanceSmall gt lt View android layout_width fill_parent android layout_height 3dp android background color Black gt lt include layout layout list_item gt lt ListView android id id quickList android layout_width fill_parent android layout_height wrap_content android layout_marginTop 3dp gt lt ListView gt lt LinearLayout g
64. roid orientation vertical android visibility gone gt lt LinearLayout android layout_width fill_parent android layout_height 0dp android layout_weight 4 android orientation vertical gt lt TextView android id id regionName android layout_width Wwrap_content android layout_height wrap_content android layout_gravity center android text Senators of USA android textAppearance android attr textAppearanceLarge gt 60 lt TextView android layout_width Wrap_content android layout_height wrap_content android layout_gravity center android layout_marginTop 1 0dp android text Quick Facts android textAppearance android attr textAppearanceSmall gt lt View android layout_width fill_parent android layout_height 3dp android background color Black gt lt include layout layout list_item gt lt ListView android id id quickList android layout_width fill_parent android layout_height wrap_content android layout_marginTop 3dp gt lt ListView gt lt LinearLayout gt lt LinearLayout android layout_width fill_parent android layout_height 0dp android layout_weight android gravity bottom android orientation vertical gt lt Button android id id cancelButton android layout_width match_parent android layout_height wrap_content android layout_gravity bottom android text Hide android textSize dimen quick_pane_text_siz
65. s a database plugin developed for Android The second challenge was to understand the US political landscape and its workings I found a way to relate the Senate and Congress to their equivalent groups in India This allowed me to get a better understanding of the workings of the Senate and gave me a basis for developing the app 41 CHAPTER 9 FUTURE WORK There is a great scope for extending this application project based on the student and faculty feedback 1 Application can also have Support for State maps based on Party 2 Application can be published in the Google play store and Amazon app store 3 The assessment tool can be upgraded to a game like quiz tool like Quiz bowl for political science senate topic 4 The Read me screen can be enhanced to be graphically interactive instead of reading instructions to use the application line by line Figure 9 1 We could do some instruction image similar for our application 5 Enhance the adding additional quiz questions feature to quiz tool lE 3 05 PM Contact tips Sweep right to make a call Sweep left to send a message N M EA Do not show again Figure 9 1 Interactive instruction sample 42 REFERENCES 1 WIKIPEDIA United States senate and others http en wikipedia org wiki United_States_Senate accessed January 2013 n d 2 WIKIPEDIA Senate http en wikipedia org wiki accessed December 2012 n d 3 WIKIPEDIA United States se
66. s on the development of an Android native app that aids political science students and teachers of different school grades to quickly browse through senator details This application covers list of senators from different states over a century for states that had a long senate history in U S The Application is developed on the latest technology that makes it more accessible to Mobile enthusiasts and the younger generation to develop their knowledge in the area of political science Most of the senate related information is contained in this application which makes it more desirable and user friendly for different age groups of people Due to the applications being self contained with the use of a lightweight database the use of the Internet can be avoided which saves money and is hassle free This gives more freedom and makes it portable to different devices like android tablets kindle etc Most of the requirements of this thesis application came from Dr Carl Eckberg who is a graduate advisor of the Computer Science department in San Diego State University and under his guidance this application was developed Ihave categorized requirements into the following three categories 1 Data requirements 2 Platform requirements 3 Functional requirements 4 1 DATA REQUIREMENTS Data requirements mean the data which needs to be represented The senator related information is displayed in the form of an interactive map based application which can be
67. ses platform requirements and functional requirements In the fifth chapter the requirements are analyzed in steps for the development of this application In the sixth chapter has a detailed discussion of data collection and preparation of the data In the seventh chapter the application s features and the corresponding code is displayed In chapter eight future enhancements to the application are discussed CHAPTER 2 SENATOR This chapter describes the overview of the senate its responsibilities and election terms with services in detail This chapter also gives a comparison of the two branches of the United States congress 2 1 SENATOR OVERVIEW The United States senate and the senate related details form the core understanding of the subject of the thesis Senators being the core theme of this application one must know the structure of the U S senate its class and election terms roles and responsibilities 2 1 1 About Senate The United States congress is made up of two houses of congress a bicameral legislature The Senate forms the upper house of the bicameral legislature and the lower house of the bicameral legislature is referred to as the house of representatives found in 1 Historically the term Senate means the assembly of the eldest and wiser members of the society and ruling class The first official senate was the Roman senate of Ancient Rome as found in 2 2 1 2 Composition and El
68. t lt LinearLayout android layout_width fill_parent android layout_height 0dp android layout_weight J android gravity bottom android orientation vertical gt lt Button android id id cancelButton android layout_width match_parent android layout_height wrap_content android layout_gravity bottom android text Hide android textSize dimen quick_pane_text_size gt lt Button android id id moreButton android layout_width match_parent android layout_height wrap_content android layout_gravity bottom 67 android text More android textSize dimen quick_pane_text_size gt lt LinearLayout gt lt LinearLayout gt lt RelativeLayout gt lt LinearLayout gt Graphical representation Below is the Graphical representation of southern states xml in eclipse TGS SenatorsThesis v B src Small OFF Y CheckBox Senators of USA gt E com thesis senatorsthesis gt 8 com thesis senatorsthesis adapter gt E com thesis senatorsthesis database Spinner gt E com thesis senatorsthesis model gt El Android 4 2 gt m Android Dependencies gt E3 gen Generated Java Files gt Bassets gt gt bin gt Elibs v b res gt 3 drawable hdpi b gt drawable Idpi gt drawable mdpi gt gt drawable xhdpi gt gt drawable xxhdpi 3 Text Fields Y layout Layouts la advancedsearch xml CI Composite El eastus xml a list_item xml CI Images
69. t 5 TutorialActivity java 2 WestUSActivity java v E com thesis senatorsthesis adapter gt IT senatorAdapter java v HB com thesis senatorsthesis database gt 3 MySQLiteHelper java gt J MySQLiteHelperAllStates java gt IT SenatorAllStateDataSource java gt 7 SenatorDataSource java v amp com thesis senatorsthesis model gt 2 Senator java gt D Statistics java gt mi Android 4 2 gt wi Android Dependencies gt 3 gen Generated Java Files gt Ga assets gt amp bin gt 65 libs v amp res gt 3 drawable hdpi gt drawable Idpi gt 3 drawable mdpi gt 3 drawable xhdpi gt 3 drawable xxhdpi advancedsearch xml la eastus xml la list_item xml a main xml a midwestus xml la quizview xml a southus xml a tutorialview xml la westcoastus xml gt 3 menu gt gt values gt values sw600dp gt gt values sw720dp land gt amp values v1l gt values v14 gt amp xml la AndroidManifest xml ic launcher web png proguard project txt project properties Figure 7 1 Senator application project structure in eclipse 27 28 Next action to be performed users can choose to tap on any region on the U S map and hold to select the desired region The precise structure of the main US map layout is shown in Figure 7 2 Structure ta Outline T LinearLayout T ili LinearLayout T RelativeLayout usmap Imageview hd regionsusmap ImageView la activeregion Image
70. tate Maine R drawable id Statistics State Maine break case 16711681 selectState New Jersey R drawable or Statistics State NewJersey break case 256 selectState New York R drawable ca Statistics State New York break case 8454144 selectState New Hampshire R drawable nv Statistics State NewHampshire break case 12609351 selectState Vermont R drawable ut Statistics State Vermont break case 1806524 selectState Washington R drawable co Statistics State Washington break case 8665752 selectState Connecticut R drawable az Statistics State Connecticut break case 2637268 selectState Rhode Island R drawable nm Statistics State Rhodelsland break default break selectedState set Visibility View VISIBLE quickPane setVisibility View VISIBLE adapter notifyDataSetChanged default break return false 7 2 3 State Selection Screen Description State selection screen displays the state that belongs to the region selected It also specifies the divisions within the region and the states to that division How to get to the current screen Tapping and holding on the region screen Next Action to be performed Tapping on to a particular state will display the senator list of the state selected Xml code for UI Refer Appendix B 7 2 4 Tutorial Screen Description The tutorial screen displays the details about the senator policies and terms relat
71. te westUS setOnTouchListener this cancelButton setOnClickListener this moreButton setOnClickListener this moreButton setText Advanced Search datasource new SenatorAllStateDataSource this datasource open On tapping a particular region a set of action is performed and the code below indicates the same The x and y coordinates are recognized and the appropriate action is performed Override public boolean onTouch View arg0 MotionEvent arg 1 ArrayAdapter lt Senator gt adapter ArrayAdapter lt Senator gt listView getAdapter int colorVal 0 int scaledHeight westUSDrawable getBounds height int scaled Width westUSDrawable getBounds width int scaledImageOffsetX Math round arg1 getX westUSDrawable getBounds left int scaledImageOffsetY Math round arg1 getY westUSDrawable getBounds top int origX scaledImageOffsetX westUSBitmap getWidth scaledWidth int origY scaledImageOffsetY westUSBitmap getHeight scaledHeight if origX lt 0 origX 0 if origY lt 0 origY 0 if origX gt westUSBitmap getWidthQ origX westUSBitmap getWidth if origY gt westUSBitmap getHeight origY westUSBitmap getHeight switch argl getAction case MotionEvent ACTION_DOWN colorVal getColour origX orig Y switch colorVal case 65536 selectState Pennsylvania R drawable wa 33 Statistics State Pennsylvania break case 65281 selectS
72. textSize 30dp android text Correct android layout_gravity center_horizontal android layout_width Wrap_content android layout_height wrap_content gt lt TextView android id 0 id correctWrongExplanationView android text Explanation text here android layout_width wrap_content android layout_height wrap_content gt lt LinearLayout gt lt LinearLayout gt Graphical representation 75 Below is the Graphical representation of quiz xml in eclipse gt 3 SampleList v E SenatorsThesis v src gt E com thesis senatorsthesis gt B amp B com thesis senatorsthesis adapter gt E com thesis senatorsthesis database gt E com thesis senatorsthesis model gt mi Android 4 2 gt mi Android Dependencies gt dB gen Generated Java Files gt assets gt gt bin gt libs v bres gt drawable hdpi gt amp drawable ldpi gt amp drawable mdpi gt amp drawable xhdpi gt 5 drawable xxhdpi Y layout Id advancedsearch xml a eastus xml IG list_item xml A main xml A midwestus xml A southus xml tutorialview xml A westcoastus xml gt 2 menu gt values gt gt values sw600dp gt Evalues sw720dp land gt gt values v11 gt gt values v14 gt amp xml AndroidManifest xml ic_launcher web png proguard project txt project properties Tema Large Medium smat Button a ie ooo amp Senators of USA RadioButton CheckedTextView A 1 How many senators serve in the
73. the Democratic party 45 members of the Republican part and two independent members out of the 100 members Senators are elected by their state as a whole The idea is two senators per state regardless of population Originally senators were selected by the state legislatures not by popular elections By the early years of the 20 century the legislatures of as many as 29 states had provided for popular election of senators Senators serves for a staggered term of six years This is so that approximately one third of the seats are up for election every two years The three classes of United States Senators are made up of 33 or 34 Senate seats each Class 1 and Class 2 consist of 33 senators and class 3 has 34 senators Should a 51st state be admitted it would receive senators in Classes 1 and 2 at which point all three Classes would have 34 senators Each state belongs to two of the three classes The main purpose of the classes in the senate is to determine which senate seats will be up for election in a given year Popular election to the Senate was standardized nationally in 1913 by the 17 Amendment An elected senator serves for a staggered tem of six years This is so that approximately one third of the seats are up for election every two years The three classes of United States Senators are made up of 33 or 34 Senate seats each Class 1 and class 2 consist of 33 senators and class 3 has 34 senators Should a 51 state be admitted it would
74. tions using the Android SDK tools and even export signed or unsigned Apk files in order to distribute your application Developing in Eclipse with ADT is highly recommended and is the fastest way to get application development started With the guided project setup it provides as well as tools integration custom XML editors and debug output pane ADT gives you an incredible boost in developing Android applications as found in 11 3 3 ECLIPSE Eclipse is a multi language software development environment comprising a base workspace and an extensible plug in system for customizing the environment It is written 15 mostly in Java It can be used to develop applications in Java by means of various plug ins 3 4 SQLITE OVERVIEW SQLite is an Open Source Database which is embedded into Android SQLite supports standard relational database features like SQL syntax transactions and prepared statements In addition it requires only a little memory at runtime approx 250 KByte SQLite is available on every Android device Using an SQLite database in Android does not require any database setup or administration SQLite is fast and has a small footprint making it perfect for Android devices Android applications can choose to store private application data in a SQLite database SQLite is basically a stripped down SQL database engine for embedded devices as found in 12 16 CHAPTER 4 THE REQUIREMENTS This Application mainly focuse
75. ton android id id cancelButton android layout_width match_parent android layout_height wrap_content android layout_gravity bottom android text Hide android textSize dimen quick_pane_text_size gt lt Button android id id moreButton android layout_width match_parent android layout_height wrap_content android layout_gravity bottom android text More android textSize dimen quick_pane_text_size gt 64 lt LinearLayout gt lt LinearLayout gt lt RelativeLayout gt lt LinearLayout gt Graphical representation Below is the Graphical representation of eastus state xml in eclipse Temen Large Medium smat Button gt 5 SampleList v XS SenatorsThesis e Small OFF A CheckBox Bac 8 Senators of USA gt E com thesis senatorsthesis RadioButton CheckedTextview gt a com thesis senatorsthesis adapter com thesis senatorsthesis database Spinner gt E com thesis senatorsthesis model en gt wi Android 4 2 gt m Android Dependencies gt gt E3 gen Generated Java Files gt gt assets gt amp bin gt libs Y bres gt 3 drawable hdpi gt gt drawable ldpi gt drawable mdpi gt amp drawable xhdpi Text Field gt drawable xxhdpi Ga basto Y layout Layouts A advancedsearch xml Composite fa eastus xml o m r Images amp Media id list_item xml ae d main xml CI Time amp Date IG midwestus xml CI Transitions
76. ts LG HTC Sony are other top manufacturers of android phones and tablets Some local manufacturers like Micromax Karbon Hawaii also use android Phones on their portable devices 3 1 5 Android Version Android is released in a series of versions Starting from 1 0 version where 2 0 3 0 etc are latest releases Google names these versions with some food items like ice cream jellybean donut etc that is one of the specialties of android versions Below is the figure that showcases different versions of android Jellybean is the most latest version that is missing the below image Figure 3 2 The U S senator Android application supports both mobile and tablet specifications To aid both devices Android provides support for multiple screen sizes and densities reflecting the many different screen configurations that a device may have To simplify the way that you design your user interfaces for multiple screens Android divides the range of actual screen sizes and densities into the groups mentioned below e The set of four generalized sizes small normal large and xlarge Beginning with Android 3 2 API level 13 these size groups are deprecated in favor of a new 11 EF amp Android 1 5 Android 1 6 Android 2 0 amp 2 1 Android 2 2 Cupcake Donut clair Froyo Peah pee Android 3 0 Android 3 5 Android Gingerbread Honeycomb Ice Cream Figure 3 2 Android version technique for managing screen sizes based on t
77. ts about the current and the previous senates of the U S They can also refresh their memory about the senate policy and powers using the tutorial feature This application provides precise as well as a detailed levels of information about the senate on a state by state basis There is much more users can do using this application which will be discussed in the following chapters The interface of the software being used to develop this application is very similar to other apps that are available in the market store Google is the company that provides the software development kit for android apps development The application is developed using JAVA as the programming language Eclipse is used as the IDE for the development of the code The application stores all the senator related information of each state as an internal database SQLite is the database that is integrated along with android if any database related development needs to be done for the application The front end user interface screens are developed using xml scripts These layouts are then connected to the java programming language to display them on the android devices both tablets and phones The thesis report has been organized into eight chapters The first chapter gives an introduction about the thesis The second chapter has an overview of the senate with its class system and election rules The third chapter discusses the technologies used and available Chapter 4 discus
78. ullivan for being on my committee and for their help and co operation CHAPTER 1 INTRODUCTION California has two senators Diane Feinstein and Barbara Boxer both democrats belonging to class and class3 these terms are explained in Chapter 2 They have served as senators from November 10 1992 Present and January 3 1993 Present respectively Recollecting such facts might be cumbersome for all the United States current senators nor is it easy to comprehend all the election terms and regulations associated with the senate The application gives quick access to the history and details pertaining to the United States senate using a mobile application on android devices The application covers all the details ranging from senates election terms and its regulation policy to the election results based on different states over about 100 years The purpose of this application is to provide students and teachers of political science and history departments with a mobile based application that can aid in a playful way of learning about the US senate and acquiring refreshing their memory at any given place time More and more schools are moving towards mobile learning as a way to take advantage of portability and ease of use in budget This application will offer teachers and students a more flexible approach to learning about the senate rules and their powers in the United State congress The users can interact with the application to get quick fac
79. ut http www senate gov states CT senators htm 8 Delaware http www senate gov states DE senators htm 9 Florida http www senate gov states FL senators htm 10 Georgia http www senate gov states GA senators htm 11 Hawaii http www senate gov states HVsenators htm 12 Idaho http www senate gov states ID senators htm 13 Illinois http www senate gov states IL senators htm 14 Indiana http www senate gov states IN senators htm 15 Iowa http www senate gov states IA senators htm 16 Kansas http www senate gov states KS senators htm 17 Kentucky http www senate gov states K Y senators htm 18 Louisiana http www senate gov states LA senators htm 19 Maine http www senate gov states ME senators htm 20 Maryland http www senate gov states MD senators htm 21 Massachusetts http www senate gov states MA senators htm 22 Michigan http www senate gov states Ml senators htm 23 Minnesota http www senate gov states MN senators htm 24 Mississippi http www senate gov states MS senators htm 25 Missouri http www senate gov states MO senators htm 26 Montana http www senate gov states MT senators htm 27 Nebraska http www senate gov states NE senators htm 28 Nevada http www senate gov states N V senators htm Figure 6 1 State based senator URL s 22 Tc a E AAA Fie Edt Fomat View Help CONGRESS NAME OF SENATOR TERM BEGAN TERM ENDED COMMENTS a Class Hist John c Fremont D Sept 9 1850 Mar 3
80. where you saved the Android SDK in step Then Click Apply gt OK You have now configured the ADT plugin successfully Finally Configure an AVD set up an AVD so that you can emulate a phone tablet using your computer hardware This will allow you to test the application being developed without requiring a physical Android device In Eclipse navigate to Window gt AVD Manager Click New to fill in the details of the virtual device 49 New Window New Editor Open Perspective gt Show View gt Customize Perspective Save Perspective As Reset Perspective Close Perspective Close All Perspectives Navigation gt Android SDK Manager AVD Manager Run Android Lint Preferences K i Ge Figure A 8 Screen shot in Eclipse navigate to Window gt AVD Manager ARM armeabi SD Card Size 2000 Filles Snapshot Enabled Skin Built in Default WVGABO0 Resolution x Hardware Property Value Abstracted LCD density 240 Max VM application hea 24 Device ram size 256 Override the existing AVD with the same name Figure A 9 Screenshot how to create AVD Choose a name that conforms to the naming rules specified at the bottom of the window The Target field specifies the version of Android you wish to have the 50 virtual device running on Notice that the list of the drop down menu only contains version of the Android OS that you selected to
Download Pdf Manuals
Related Search
Related Contents
TiVo Mini FICHE TECHNIQUE VULCANO GLUE 320530ES AA G40 Automática Pistolas de pulverización Cables Direct 0.48 ATA-133 Quick Reference Guide Setting up Accounts with Suppliers Load ISO-TECH SLC-l356 MODE D`EMPLOI Philips Coffee jug CRP734 Copyright © All rights reserved.
Failed to retrieve file