{"id":318,"date":"2010-10-20T19:13:00","date_gmt":"2010-10-20T19:13:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/android-full-app-part-1-main-activity-ui.html"},"modified":"2012-10-21T19:20:41","modified_gmt":"2012-10-21T19:20:41","slug":"android-full-app-part-1-main-activity","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html","title":{"rendered":"Android Full App, Part 1: Main Activity UI"},"content":{"rendered":"<p>This is the first part of the <a href=\"http:\/\/www.javacodegeeks.com\/2010\/10\/android-full-application-tutorial.html\">\u201cAndroid Full Application Tutorial\u201d series<\/a>. The complete application aims to provide an easy way of performing movies\/actors searching over the internet. In this part we are going to setup our Eclipse project, prepare the user interface for the main activity and finally test it on an appropriate emulated Android Device.<\/p>\n<p>Let&#8217;s start by creating a new Eclipse project (I suppose you already have the Android SDK and the Eclipse plugin installed). The project is named \u201cAndroidMovieSearchAppProject\u201d and the application is called \u201cMovieSearchApp\u201d (an extremely original name, I know). Note that Android 1.5 (API level 3) is used as the target platform, since none of the latest APIs will be used.<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/4.bp.blogspot.com\/_piNjpdpJZXA\/TMhTqQYo6zI\/AAAAAAAAALQ\/Mc68St9Us78\/s1600\/01-movie-app-new-project.png\"><img decoding=\"async\" border=\"0\" height=\"320\" src=\"http:\/\/4.bp.blogspot.com\/_piNjpdpJZXA\/TMhTqQYo6zI\/AAAAAAAAALQ\/Mc68St9Us78\/s320\/01-movie-app-new-project.png\" width=\"295\" \/><\/a><\/div>\n<p>Our user interface will be very simple. A textbox where the user will provide his search query, two radio-buttons indicating whether this is a movie or people search, a label to show the type of search and a button to actually perform the search. The search results will be presented in an other activity (this will be discussed in a later part of the series).  <\/p>\n<p>As you probably know, the interface is created via an XML file in order to decouple the presentation view from the application logic. The corresponding file is named \u201cmain.xml\u201d and resides inside the \u201cres\/layout\u201d folder. Open it with the Eclipse editor and make sure it contains the following:<\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n\r\n&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    android:orientation=\"vertical\"\r\n    android:layout_width=\"fill_parent\"\r\n    android:layout_height=\"fill_parent\"\r\n    &gt;\r\n    \r\n    &lt;EditText android:id=\"@+id\/search_edit_text\" \r\n        android:text=\"@string\/search\"\r\n        android:layout_width=\"fill_parent\" \r\n        android:layout_height=\"wrap_content\" \r\n    \/&gt;\r\n    \r\n    &lt;RadioGroup\r\n        android:id=\"@+id\/search_radio_group\"\r\n          android:layout_width=\"fill_parent\"\r\n          android:layout_height=\"wrap_content\"\r\n          android:orientation=\"vertical\"&gt;\r\n        &lt;RadioButton \r\n            android:id=\"@+id\/movie_search_radio_button\"\r\n            android:checked=\"true\"\r\n            android:layout_width=\"wrap_content\" \r\n            android:layout_height=\"wrap_content\"\r\n            android:text=\"@string\/movies\" \/&gt;\r\n        &lt;RadioButton \r\n            android:id=\"@+id\/people_search_radio_button\"\r\n            android:checked=\"false\"\r\n            android:layout_width=\"wrap_content\" \r\n            android:layout_height=\"wrap_content\"\r\n            android:text=\"@string\/people\" \/&gt;\r\n    &lt;\/RadioGroup&gt;\r\n    \r\n    &lt;TextView \r\n        android:id=\"@+id\/search_type_text_view\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:textColor=\"#ffffff\" \r\n    \/&gt;\r\n    \r\n    &lt;Button \r\n        android:id=\"@+id\/search_button\" \r\n        android:text=\"@string\/search\"\r\n        android:layout_width=\"wrap_content\" \r\n        android:layout_height=\"wrap_content\" \r\n    \/&gt;\r\n    \r\n&lt;\/LinearLayout&gt;\r\n<\/pre>\n<p>Note that the text elements are not hard-coded, but instead are taking their values from an external resource and more specifically from a file named \u201cstrings.xml\u201d which resides in the \u201cres\/values\u201d folder. This is a good practice for achieving internationalization for your application. The file is the following:<\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n\r\n&lt;resources&gt;\r\n\r\n    &lt;string name=\"hello\"&gt;Hello World, MovieSearchAppActivity!&lt;\/string&gt;\r\n    &lt;string name=\"app_name\"&gt;MovieSearchApp&lt;\/string&gt;\r\n    \r\n    &lt;string name=\"search\"&gt;Search&lt;\/string&gt;\r\n    &lt;string name=\"movies\"&gt;Movies&lt;\/string&gt;\r\n    &lt;string name=\"people\"&gt;People&lt;\/string&gt;\r\n    \r\n&lt;\/resources&gt;\r\n\r\n<\/pre>\n<p>This is how the interface looks like in the Android emulator:<\/p>\n<p><a href=\"http:\/\/3.bp.blogspot.com\/_piNjpdpJZXA\/TLy5FsfGAMI\/AAAAAAAAAKY\/bzHMipa0M6I\/s1600\/02-main-activity-UI.png\"><img decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/3.bp.blogspot.com\/_piNjpdpJZXA\/TLy5FsfGAMI\/AAAAAAAAAKY\/bzHMipa0M6I\/s320\/02-main-activity-UI.png\" style=\"cursor: pointer;height: 255px;margin: 0px auto 10px;text-align: center;width: 320px\" \/><\/a><\/p>\n<p>The next step is to wire those UI elements in our code and manipulate them accordingly in order to achieve our search functionality. The wiring is possible via the <a href=\"http:\/\/developer.android.com\/reference\/android\/app\/Activity.html#findViewById%28int%29\">findViewById<\/a> method, where the integer argument is the unique ID that the element was given in the XML declaration file.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>A very important aspect of the Android UI widgets is that they provide \u201chooks\u201d that allow the developer to get notified when the user performs an action, such as when he clicks a button or traverses along the widgets. For handling clicking events, we implement the <a href=\"http:\/\/developer.android.com\/reference\/android\/view\/View.OnClickListener.html\">OnClickListener<\/a> interface, which defines a callback to be invoked when a view is clicked. The interface contains only one method named <a href=\"http:\/\/developer.android.com\/reference\/android\/view\/View.OnClickListener.html#onClick%28android.view.View%29\">onClick<\/a>, which gets called when the view has been clicked.<\/p>\n<p>Another useful interface is the <a href=\"http:\/\/developer.android.com\/reference\/android\/view\/View.OnFocusChangeListener.html\">OnFocusChangeListener<\/a>, which defines a callback to be invoked when the focus state of a view changed. Its only method is <a href=\"http:\/\/developer.android.com\/reference\/android\/view\/View.OnFocusChangeListener.html#onFocusChange%28android.view.View,%20boolean%29\">onFocusChange<\/a>, which is called when the focus state of a view has changed.<\/p>\n<p>Let&#8217;s see how all these can be applied in order to create our main <a href=\"http:\/\/developer.android.com\/reference\/android\/app\/Activity.html\">Activity<\/a>. The code for our main class is the following:<\/p>\n<pre class=\"brush:java\">package com.javacodegeeks.android.apps.moviesearchapp;\r\n\r\nimport android.app.Activity;\r\nimport android.os.Bundle;\r\nimport android.view.View;\r\nimport android.view.View.OnClickListener;\r\nimport android.view.View.OnFocusChangeListener;\r\nimport android.widget.Button;\r\nimport android.widget.EditText;\r\nimport android.widget.RadioButton;\r\nimport android.widget.RadioGroup;\r\nimport android.widget.TextView;\r\nimport android.widget.Toast;\r\n\r\npublic class MovieSearchAppActivity extends Activity {\r\n    \r\n    private static final String EMPTY_STRING = \"\";\r\n    \r\n    private EditText searchEditText;\r\n    private RadioButton moviesSearchRadioButton;\r\n    private RadioButton peopleSearchRadioButton;\r\n    private RadioGroup searchRadioGroup;\r\n    private TextView searchTypeTextView;\r\n    private Button searchButton;\r\n    \r\n    @Override\r\n    public void onCreate(Bundle savedInstanceState) {\r\n        \r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.main);\r\n        \r\n        this.findAllViewsById();\r\n        \r\n        moviesSearchRadioButton.setOnClickListener(radioButtonListener);\r\n        peopleSearchRadioButton.setOnClickListener(radioButtonListener);\r\n        \r\n        searchButton.setOnClickListener(new OnClickListener() {            \r\n            @Override\r\n            public void onClick(View v) {\r\n                String query = searchEditText.getText().toString();\r\n                if (moviesSearchRadioButton.isChecked()) {\r\n                    longToast(moviesSearchRadioButton.getText() + \" \" + query);\r\n                }\r\n                else if (peopleSearchRadioButton.isChecked()) {\r\n                    longToast(peopleSearchRadioButton.getText() + \" \" + query);\r\n                }\r\n            }\r\n        });\r\n        \r\n        searchEditText.setOnFocusChangeListener(new DftTextOnFocusListener(getString(R.string.search)));\r\n        \r\n        int id = searchRadioGroup.getCheckedRadioButtonId();\r\n        RadioButton radioButton = (RadioButton) findViewById(id);\r\n        searchTypeTextView.setText(radioButton.getText());\r\n        \r\n    }\r\n    \r\n    private void findAllViewsById() {\r\n        searchEditText = (EditText) findViewById(R.id.search_edit_text);\r\n        moviesSearchRadioButton = (RadioButton) findViewById(R.id.movie_search_radio_button);\r\n        peopleSearchRadioButton = (RadioButton) findViewById(R.id.people_search_radio_button);\r\n        searchRadioGroup = (RadioGroup) findViewById(R.id.search_radio_group);\r\n        searchTypeTextView = (TextView) findViewById(R.id.search_type_text_view);\r\n        searchButton = (Button) findViewById(R.id.search_button);\r\n    }\r\n    \r\n    public void longToast(CharSequence message) {\r\n        Toast.makeText(this, message, Toast.LENGTH_LONG).show();\r\n    }\r\n    \r\n    private OnClickListener radioButtonListener = new OnClickListener() {\r\n        public void onClick(View v) {\r\n            RadioButton radioButton = (RadioButton) v;\r\n            searchTypeTextView.setText(radioButton.getText());\r\n        }\r\n    };\r\n\r\n    private class DftTextOnFocusListener implements OnFocusChangeListener {\r\n        \r\n        private String defaultText;\r\n\r\n        public DftTextOnFocusListener(String defaultText) {\r\n            this.defaultText = defaultText;\r\n        }\r\n\r\n        public void onFocusChange(View v, boolean hasFocus) {\r\n            if (v instanceof EditText) {\r\n                EditText focusedEditText = (EditText) v;\r\n                \/\/ handle obtaining focus\r\n                if (hasFocus) {\r\n                    if (focusedEditText.getText().toString().equals(defaultText)) {\r\n                        focusedEditText.setText(EMPTY_STRING);\r\n                    }\r\n                }\r\n                \/\/ handle losing focus\r\n                else {\r\n                    if (focusedEditText.getText().toString().equals(EMPTY_STRING)) {\r\n                        focusedEditText.setText(defaultText);\r\n                    }\r\n                }\r\n            }\r\n        }\r\n        \r\n    }\r\n    \r\n}\r\n<\/pre>\n<p>We start by setting the <a href=\"http:\/\/developer.android.com\/reference\/android\/view\/View.html\">View<\/a> for our activity using the <a href=\"http:\/\/developer.android.com\/reference\/android\/app\/Activity.html#setContentView%28android.view.View%29\">setContentView<\/a> method. The view used is the one defined by the \u201cmain.xml\u201d file. Then, we take reference of all the UI elements so that they can be manipulated via code. We create two <a href=\"http:\/\/developer.android.com\/reference\/android\/view\/View.OnClickListener.html\">OnClickListener<\/a>s, one for handling the clicks on the radio buttons and one for performing the search when the button is clicked. The listeners are attached to the UI elements by using the <a href=\"http:\/\/developer.android.com\/reference\/android\/view\/View.html#setOnClickListener%28android.view.View.OnClickListener%29\">setOnClickListener<\/a> method.<\/p>\n<p>Regarding the radio-buttons, these are defined in terms of  a <a href=\"http:\/\/developer.android.com\/reference\/android\/widget\/RadioGroup.html\">RadioGroup<\/a> component. The Android UI framework takes care of allowing only one <a href=\"http:\/\/developer.android.com\/reference\/android\/widget\/RadioButton.html\">RadioButton<\/a> to be selected at any given time. Moreover, at runtime, we can find which radio button is selected by using the method <a href=\"http:\/\/developer.android.com\/reference\/android\/widget\/RadioGroup.html#getCheckedRadioButtonId%28%29\">getCheckedRadioButtonId<\/a>. Note that this method return the globally unique ID of the radio button and can be used as the argument of the <a href=\"http:\/\/developer.android.com\/reference\/android\/app\/Activity.html#findViewById%28int%29\">findViewById<\/a> method to take reference of the button.<\/p>\n<p>Finally, we create one <a href=\"http:\/\/developer.android.com\/reference\/android\/view\/View.OnFocusChangeListener.html\">OnFocusChangeListener<\/a> and attach it to the <a href=\"http:\/\/developer.android.com\/reference\/android\/widget\/EditText.html\">EditText<\/a> widget using the <a href=\"http:\/\/developer.android.com\/reference\/android\/view\/View.html#setOnFocusChangeListener%28android.view.View.OnFocusChangeListener%29\">setOnFocusChangeListener<\/a> method. With our implementation, we are able to achieve the functionality that is shown in the next image.<\/p>\n<p><a href=\"http:\/\/2.bp.blogspot.com\/_piNjpdpJZXA\/TLy58pLBtkI\/AAAAAAAAAKg\/qAKThcNKxrU\/s1600\/03-focus-edit-text.png\"><img decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/2.bp.blogspot.com\/_piNjpdpJZXA\/TLy58pLBtkI\/AAAAAAAAAKg\/qAKThcNKxrU\/s320\/03-focus-edit-text.png\" style=\"cursor: pointer;height: 94px;margin: 0px auto 10px;text-align: center;width: 320px\" \/><\/a><\/p>\n<p>When the text box  has the focus and is empty, you are ready to type your search query. The query remains there whether the text box has the focus or not. However, when the text box is empty and loses focus, a predefined message appears.<\/p>\n<p>We are now ready to give our application a first try. This will be done using the emulator provided by the Android SDK. Launch the AVD (Android Virtual Device) Manager from inside Eclipse and create a new device. Give it a distinct name, for example \u201cAndroid1.5-SD\u201d and choose the target platform, in our case Android 1.5. I have also chose the support for SD card, just in case it is needed. This is how the setup should look like:<\/p>\n<p><a href=\"http:\/\/4.bp.blogspot.com\/_piNjpdpJZXA\/TLy6IODFIJI\/AAAAAAAAAKo\/WoTLEVeDyf0\/s1600\/04-avd-creation.png\"><img decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/4.bp.blogspot.com\/_piNjpdpJZXA\/TLy6IODFIJI\/AAAAAAAAAKo\/WoTLEVeDyf0\/s320\/04-avd-creation.png\" style=\"cursor: pointer;height: 320px;margin: 0px auto 10px;text-align: center;width: 230px\" \/><\/a><\/p>\n<p>Next, create a new \u201cRun Configuration\u201d in Eclipse, choose our Android Project and the \u201cMovieSearchAppActivity\u201d to launch. This is what you should see:<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/3.bp.blogspot.com\/_piNjpdpJZXA\/TMhTy3Dt8HI\/AAAAAAAAALU\/9CtlJgagFjA\/s1600\/05-run-configuration.png\"><img decoding=\"async\" border=\"0\" height=\"182\" src=\"http:\/\/3.bp.blogspot.com\/_piNjpdpJZXA\/TMhTy3Dt8HI\/AAAAAAAAALU\/9CtlJgagFjA\/s320\/05-run-configuration.png\" width=\"320\" \/><\/a><\/div>\n<p>In the \u201cTarget\u201d tab,choose the newly create AVD and hit \u201cApply\u201d and \u201cRun\u201d.<\/p>\n<p><a href=\"http:\/\/3.bp.blogspot.com\/_piNjpdpJZXA\/TLy6Z8btG2I\/AAAAAAAAAK4\/zdrjxVGYFTE\/s1600\/06-target-selection.png\"><img decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/3.bp.blogspot.com\/_piNjpdpJZXA\/TLy6Z8btG2I\/AAAAAAAAAK4\/zdrjxVGYFTE\/s320\/06-target-selection.png\" style=\"cursor: pointer;height: 129px;margin: 0px auto 10px;text-align: center;width: 320px\" \/><\/a><\/p>\n<p>The Android Emulator will start up and after a little time our application will appear (hit the \u201cMENU\u201d button if the application does not appear automatically).<\/p>\n<p><a href=\"http:\/\/3.bp.blogspot.com\/_piNjpdpJZXA\/TLy6hlpiMVI\/AAAAAAAAALA\/aYmKqIQucvE\/s1600\/07-final-app.png\"><img decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/3.bp.blogspot.com\/_piNjpdpJZXA\/TLy6hlpiMVI\/AAAAAAAAALA\/aYmKqIQucvE\/s320\/07-final-app.png\" style=\"cursor: pointer;height: 320px;margin: 0px auto 10px;text-align: center;width: 245px\" \/><\/a>Play around with the app. At this time, it does not perform any advanced actions, rather it only gives a Toast when the button is clicked.<\/p>\n<p>That would be the first part of the \u201cAndroid Full Application Tutorial\u201d series. You can find the whole Eclipse project so far <a href=\"http:\/\/dl.dropbox.com\/u\/7215751\/JavaCodeGeeks\/AndroidFullAppTutorialPart01\/AndroidMovieSearchAppProject_Part01.zip\">here<\/a>.<\/p>\n<div style=\"margin-bottom: 0px;margin-left: 0px;margin-right: 0px;margin-top: 0px\"><strong><i>Related Articles :<\/i><\/strong><\/div>\n<ul>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/10\/android-full-application-tutorial.html\">\u201cAndroid Full Application Tutorial\u201d series<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/09\/android-text-to-speech-application.html\">Android Text-To-Speech Application<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/09\/android-reverse-geocoding-yahoo-api.html\">Android Reverse Geocoding with Yahoo API &#8211; PlaceFinder<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/09\/android-location-based-services.html\">Android Location Based Services Application \u2013 GPS location<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/06\/embracing-android-awesomeness-quick.html\">Install Android OS on your PC with VirtualBox<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/06\/embracing-android-awesomeness-quick.html\">Embracing the Android awesomeness: A quick overview<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This is the first part of the \u201cAndroid Full Application Tutorial\u201d series. The complete application aims to provide an easy way of performing movies\/actors searching over the internet. In this part we are going to setup our Eclipse project, prepare the user interface for the main activity and finally test it on an appropriate emulated &hellip;<\/p>\n","protected":false},"author":3,"featured_media":46,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[83,29],"class_list":["post-318","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android-core","tag-android-tutorial","tag-eclipse"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android Full App, Part 1: Main Activity UI - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"This is the first part of the \u201cAndroid Full Application Tutorial\u201d series. The complete application aims to provide an easy way of performing movies\/actors\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android Full App, Part 1: Main Activity UI - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"This is the first part of the \u201cAndroid Full Application Tutorial\u201d series. The complete application aims to provide an easy way of performing movies\/actors\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2010-10-20T19:13:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-21T19:20:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ilias Tsagklis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ilias Tsagklis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-1-main-activity.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-1-main-activity.html\"},\"author\":{\"name\":\"Ilias Tsagklis\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/9a83496b285d30c61e8a674625c1350e\"},\"headline\":\"Android Full App, Part 1: Main Activity UI\",\"datePublished\":\"2010-10-20T19:13:00+00:00\",\"dateModified\":\"2012-10-21T19:20:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-1-main-activity.html\"},\"wordCount\":953,\"commentCount\":9,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-1-main-activity.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"keywords\":[\"Android Tutorial\",\"Eclipse\"],\"articleSection\":[\"Android Core\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-1-main-activity.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-1-main-activity.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-1-main-activity.html\",\"name\":\"Android Full App, Part 1: Main Activity UI - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-1-main-activity.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-1-main-activity.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"datePublished\":\"2010-10-20T19:13:00+00:00\",\"dateModified\":\"2012-10-21T19:20:41+00:00\",\"description\":\"This is the first part of the \u201cAndroid Full Application Tutorial\u201d series. The complete application aims to provide an easy way of performing movies\\\/actors\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-1-main-activity.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-1-main-activity.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-1-main-activity.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/android-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2010\\\/10\\\/android-full-app-part-1-main-activity.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/android\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Android Core\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/android\\\/android-core\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Android Full App, Part 1: Main Activity UI\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/9a83496b285d30c61e8a674625c1350e\",\"name\":\"Ilias Tsagklis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g\",\"caption\":\"Ilias Tsagklis\"},\"description\":\"Ilias is a software developer turned online entrepreneur. He is co-founder and Executive Editor at Java Code Geeks.\",\"sameAs\":[\"http:\\\/\\\/www.iliastsagklis.com\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/iliastsagklis\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/ilias-tsagklis\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android Full App, Part 1: Main Activity UI - Java Code Geeks","description":"This is the first part of the \u201cAndroid Full Application Tutorial\u201d series. The complete application aims to provide an easy way of performing movies\/actors","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html","og_locale":"en_US","og_type":"article","og_title":"Android Full App, Part 1: Main Activity UI - Java Code Geeks","og_description":"This is the first part of the \u201cAndroid Full Application Tutorial\u201d series. The complete application aims to provide an easy way of performing movies\/actors","og_url":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2010-10-20T19:13:00+00:00","article_modified_time":"2012-10-21T19:20:41+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","type":"image\/jpeg"}],"author":"Ilias Tsagklis","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Ilias Tsagklis","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html"},"author":{"name":"Ilias Tsagklis","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/9a83496b285d30c61e8a674625c1350e"},"headline":"Android Full App, Part 1: Main Activity UI","datePublished":"2010-10-20T19:13:00+00:00","dateModified":"2012-10-21T19:20:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html"},"wordCount":953,"commentCount":9,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","keywords":["Android Tutorial","Eclipse"],"articleSection":["Android Core"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html","url":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html","name":"Android Full App, Part 1: Main Activity UI - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","datePublished":"2010-10-20T19:13:00+00:00","dateModified":"2012-10-21T19:20:41+00:00","description":"This is the first part of the \u201cAndroid Full Application Tutorial\u201d series. The complete application aims to provide an easy way of performing movies\/actors","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/android-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2010\/10\/android-full-app-part-1-main-activity.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Android","item":"https:\/\/www.javacodegeeks.com\/category\/android"},{"@type":"ListItem","position":3,"name":"Android Core","item":"https:\/\/www.javacodegeeks.com\/category\/android\/android-core"},{"@type":"ListItem","position":4,"name":"Android Full App, Part 1: Main Activity UI"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/9a83496b285d30c61e8a674625c1350e","name":"Ilias Tsagklis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/43505f28bb49f6e290c24be0b209ccc1af350f0f6587025ffd4847ef44bf6b78?s=96&d=mm&r=g","caption":"Ilias Tsagklis"},"description":"Ilias is a software developer turned online entrepreneur. He is co-founder and Executive Editor at Java Code Geeks.","sameAs":["http:\/\/www.iliastsagklis.com\/","https:\/\/www.linkedin.com\/in\/iliastsagklis"],"url":"https:\/\/www.javacodegeeks.com\/author\/ilias-tsagklis"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/318","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=318"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/318\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/46"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}