archive-com.com » COM » T » TECHOTOPIA.COM

Total: 1018

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Integrating Google Play In-app Billing into an Android 6 Application - Techotopia
    true android layout marginTop 113dp android onClick buttonClicked Button android layout width wrap content android layout height wrap content android text string buy string android id id buyButton android layout centerVertical true android layout centerHorizontal true android onClick buyClick RelativeLayout With the user interface design complete it is time to start writing some Java code to handle the purchasing and consumption of clicks Implementing the Click Me Button When the application is initially launched the Click Me button will be disabled To make sure that this happens load the InAppBillingActivity java file into the editor and modify the onCreate method to obtain a reference to both buttons and then disable the clickButton package com ebookfrenzy inappbilling import android support v7 app AppCompatActivity import android os Bundle import android widget Button public class InAppBillingActivity extends AppCompatActivity private Button clickButton private Button buyButton Override protected void onCreate Bundle savedInstanceState super onCreate savedInstanceState setContentView R layout activity in app billing buyButton Button findViewById R id buyButton clickButton Button findViewById R id clickButton clickButton setEnabled false The buttonClicked method that will be called when the button is clicked by the user now also needs to be implemented All this method needs to do is to disable the button once again so that the button cannot be clicked until another purchase is made and to enable the buy button so that another click can be purchased Remaining within the InAppBillingActivity java file implement this method as follows package com ebookfrenzy inappbilling import android support v7 app AppCompatActivity import android os Bundle import android widget Button import android view View public class InAppBillingActivity extends AppCompatActivity public void buttonClicked View view clickButton setEnabled false buyButton setEnabled true Work on the functionality of the first button is now complete The next steps are to begin implementing the in app billing functionality Google Play Developer Console and Google Wallet Accounts Application developers making use of Google Play billing must be identified by a unique public license key The only way to obtain a public license key is to register an application within the Google Play Developer Console If you do not already have a Google Play Developer Console account go to http play google com apps publish and follow the steps to register as outlined in the chapter entitled Signing and Preparing an Android 6 Application for Release Once you are logged in click on the Settings option located on the left hand edge of the web page and on the Account details page scroll down to the Merchant Account section In order to use in app billing your Google Play Developer Console account must have a Google Wallet Merchant account associated with it If a Google Wallet merchant account is not set up create a merchant account and register it with your Google Developer Console account before proceeding Obtaining the Public License Key for the Application From the home page of the Google Play Developer Console click on the Add new application button specifying the default language and a title of InAppBilling Once this information has been entered click on the Upload APK button Figure 63 6 It is not necessary to upload the APK file at this point so once the application has been registered click on the Services APIs option to display the Base64 encoded RSA public key for the application as shown in Figure 63 7 Figure 63 7 eBookFrenzy com Purchase the full edition of this Android Studio Development Essentials Android 6 Edition Book in eBook 9 99 or Print 38 99 format Android Studio Development Essentials Android 6 Edition Print and eBook ePub PDF Kindle editions contain 65 chapters Keep this Browser window open for now as this key will need to be included in the application code in the next step of this tutorial Setting Up Google Play Billing in the Application With the public key generated it is now time to use that key to initialize billing within the application code For the InAppBilling example project this will be performed in the onCreate method of the InAppBillingActivity java file and will make use of the IabHelper class from the utilities classes previously added to the project as follows Note that your license key here should be replaced by your own license key generated in the previous section and your domain by the package name used to hold the utility class files package com ebookfrenzy inappbilling import your domain inappbilling util IabHelper import your domain inappbilling util IabResult import your domain inappbilling util Inventory import your domain inappbilling util Purchase import android support v7 app AppCompatActivity import android os Bundle import android widget Button import android view View import android content Intent import android util Log public class InAppBillingActivity extends AppCompatActivity private static final String TAG InAppBilling IabHelper mHelper private Button clickButton private Button buyButton Override protected void onCreate Bundle savedInstanceState super onCreate savedInstanceState setContentView R layout activity in app billing buyButton Button findViewById R id buyButton clickButton Button findViewById R id clickButton clickButton setEnabled false String base64EncodedPublicKey your license key here mHelper new IabHelper this base64EncodedPublicKey mHelper startSetup new IabHelper OnIabSetupFinishedListener public void onIabSetupFinished IabResult result if result isSuccess Log d TAG In app Billing setup failed result else Log d TAG In app Billing is set up OK After implementing the above changes compile and run the application on a physical Android device Google Play Billing cannot be tested within an emulator session and make sure that the In app Billing is set up OK message appears in the LogCat output panel Initiating a Google Play In app Billing Purchase With access to the billing system initialized we can now turn our attention to initiating a purchase when the user touches the Buy Click button in the user interface This was previously configured to trigger a call to a method named buyClick which now needs to be implemented in the InAppBillingActivity java file In addition to initiating the purchase process in this method it will be necessary to implement an onActivityResult method and also a listener method to be called when the purchase has completed Begin by editing the InAppBillingActivity java file and adding the code for the buyClick method so that it reads as follows public class InAppBillingActivity extends AppCompatActivity private static final String TAG InAppBilling IabHelper mHelper static final String ITEM SKU android test purchased public void buyClick View view mHelper launchPurchaseFlow this ITEM SKU 10001 mPurchaseFinishedListener mypurchasetoken Clearly all this method needs to do is make a call to the launchPurchaseFlow method of our mHelper instance The arguments passed through to the method are as follows A reference to the enclosing Activity instance from which the method is being called The SKU that identifies the product that is being purchased In this instance we are going to use a standard SKU provided by Google for testing purposes This SKU referred to as a static response SKU will always result in a successful purchase Other testing SKUs available for use when testing purchasing functionality without making real purchases are android test cancelled android test refunded and android test item unavailable The request code which can be any positive integer value When the purchase has completed the onActivityResult method will be called and passed this integer along with the purchase response This allows the method to identify which purchase process is returning and can be useful when the method needs to be able to handle purchasing for different items The listener method to be called when the purchase is complete The developer payload token string This can be any string value and is used to identify the purchase For the purposes of this example this is set to mypurchasetoken Implementing the onActivityResult Method When the purchasing process returns it will call a method on the calling activity named onActivityResult passing through as arguments the request code passed through to the launchPurchaseFlow method a result code and intent data containing the purchase response This method needs to identify if it was called as a result of an in app purchase request or some request unrelated to in app billing It does this by calling the handleActivityResult method of the mHelper instance and passing through the incoming arguments If this is a purchase request the mHelper will handle it and return a true value If this is not the result of a purchase then the method needs to pass it up to the superclass to be handled Bringing this together results in the following code Override protected void onActivityResult int requestCode int resultCode Intent data if mHelper handleActivityResult requestCode resultCode data super onActivityResult requestCode resultCode data In the event that the onActivityResult method was called in response to an in app billing purchase a call will then be made to the listener method referenced in the call to the launchPurchaseFlow method in this case a method named mPurchaseFinishedListener The next task therefore is to implement this method Implementing the Purchase Finished Listener The purchase finished listener must perform a number of different tasks In the first instance it must check to ensure that the purchase was successful It then needs to check the SKU of the purchased item to make sure it matches the one specified in the purchase request In the event of a successful purchase the method will need to consume the purchase so that the user can purchase it again when another one is needed If the purchase is not consumed future attempts to purchase the item will fail stating that the item has already been purchased While this would be desired behavior if the user only needed to purchase the item once clearly this is not the behavior required for consumable purchases Finally the method needs to enable the Click Me button so that the user can perform the button click that was purchased Within the InAppBillingActivity java file implement this method as follows IabHelper OnIabPurchaseFinishedListener mPurchaseFinishedListener new IabHelper OnIabPurchaseFinishedListener public void onIabPurchaseFinished IabResult result Purchase purchase if result isFailure Handle error return else if purchase getSku equals ITEM SKU consumeItem buyButton setEnabled false As can be seen from the above code fragment in the event that the purchase was successful a method named consumeItem will be called Clearly the next step is to implement this method Consuming the Purchased Item In the documentation for Google Play In app Billing Google recommends that consumable items be consumed before providing the user with access to the purchased item So far in this tutorial we have performed the purchase of the item but not yet consumed it In the event of a successful purchase the mPurchaseFinishedListener implementation has been configured to call a method named consumeItem It will be the responsibility of this method to query the billing system to make sure that the purchase has been made This involves making a call to the queryInventoryAsync method of the mHelper object This task is performed asynchronously from the application s main thread and a listener method called when the task is complete If the item has been purchased the listener will consume the item via a call to the consumeAsync method of the mHelper object Bringing these requirements together results in the following additions to the InAppBillingActivity java file public void consumeItem mHelper queryInventoryAsync mReceivedInventoryListener IabHelper QueryInventoryFinishedListener mReceivedInventoryListener new IabHelper QueryInventoryFinishedListener public void onQueryInventoryFinished IabResult result Inventory inventory if result isFailure Handle failure else mHelper consumeAsync inventory getPurchase ITEM SKU mConsumeFinishedListener As with the query the consumption task is also performed asynchronously and in this case is configured to call a listener named mConsumeFinishedListener when completed This listener now needs to be implemented such that it enables the Click Me button after the item has been consumed in the billing system IabHelper OnConsumeFinishedListener mConsumeFinishedListener new IabHelper OnConsumeFinishedListener public void onConsumeFinished Purchase purchase IabResult result if result isSuccess clickButton setEnabled true else handle error eBookFrenzy com Purchase the full edition of this Android Studio Development Essentials Android 6 Edition Book in eBook 9 99 or Print 38 99 format Android Studio Development Essentials Android 6 Edition Print and eBook ePub PDF Kindle editions contain 65 chapters Releasing the IabHelper Instance Throughout this tutorial much of the work has been performed by calling methods on an instance of the IabHelper utility class named mHelper Now that the code to handle purchasing and subsequent consumption of a virtual item is complete the last task is to make sure this object is released when the activity is destroyed Remaining in the InAppBillingActivity java file override the onDestroy activity lifecycle method as follows Override public void onDestroy super onDestroy if mHelper null mHelper dispose mHelper null Modifying the Security java File When an application is compiled and installed on a device from within Android Studio it is built and executed in debug mode When the application is complete it is then built in release mode and uploaded to the Google Play App Store as described in the chapter entitled Signing and Preparing an Android Application for Release As the InAppBilling application is currently configured purchases are being made using the android test purchased static response SKU code It is important to be aware that static response SKUs can only be used when running an application in debug mode As will be outlined later new in app products must be created within the Google Play Developer Console before full testing can be performed in release mode The current version of the utility classes provided with the TrivialDrive example application include an added level of security that prevents purchases from being made without a valid signature key being returned from the Google Play billing server A side effect of this change is that it prevents the code from functioning when using the static response SKU values Before testing the application in debug mode therefore a few extra lines of code need to be added to the verifyPurchase method in the Security java file Within the Android Studio Project tool window select the Security java file located in the app java package name util folder of the project to load it into the editor Once loaded locate and modify the verifyPurchase method so that it reads as follows package com ebookfrenzy inappbilling util import android text TextUtils import android util Log import org json JSONException import org json JSONObject import your domain inappbilling BuildConfig import java security InvalidKeyException import java security KeyFactory import java security NoSuchAlgorithmException import java security PublicKey import java security Signature import java security SignatureException import java security spec InvalidKeySpecException import java security spec X509EncodedKeySpec public static boolean verifyPurchase String base64PublicKey String signedData String signature if TextUtils isEmpty signedData TextUtils isEmpty base64PublicKey TextUtils isEmpty signature Log e TAG Purchase verification failed missing data if BuildConfig DEBUG return true return false PublicKey key Security generatePublicKey base64PublicKey return Security verify key signedData signature This will ensure that when the application is running in debug mode the method does not report an error if the signature is missing when a static response SKU purchase is verified By checking for debug mode in this code we ensure that this security check will function as intended when the application is built in release mode Testing the In app Billing Application Compile and run the application on a physical Android device with Google Play support and click on the Buy a Click button This should cause the Google Play purchase dialog to appear listing the test item as illustrated in Figure 63 8 Figure 63 8 Click on the Buy button to simulate a purchase at which point a Payment Successful message Figure 63 9 should appear after which it should be possible to click on the Click Me button once Figure 63 9 Having consumed the click it will be necessary to purchase another click in order to once again enable the button Building a Release APK Up until this point the example application created in this chapter has used a static response testing SKU provided by Google for early stage testing of in app billing The next step is to create a real in app billing product SKU code for a virtual item and use this when testing the application Before creating an in app billing product however the application code needs to be changed slightly so that it uses a real SKU instead of the static response SKU The product SKU that will be used in the remainder of this chapter will be named com example buttonclick so edit the InAppBillingActivity java file and modify the SKU reference accordingly public class InAppBillingActivity extends Activity private static final String TAG InAppBilling IabHelper mHelper static final String ITEM SKU com example buttonclick private Button clickButton private Button buyButton eBookFrenzy com Purchase the full edition of this Android Studio Development Essentials Android 6 Edition Book in eBook 9 99 or Print 38 99 format Android Studio Development Essentials Android 6 Edition Print and eBook ePub PDF Kindle editions contain 65 chapters Before any products can be created a release APK file for the application must first be uploaded to the developer console In order to prepare this release APK file for the InAppBilling application follow the steps outlined in the chapter entitled Signing and Preparing an Android Application for Release Once the APK file has been created select the previously registered application from the list of applications in the Google Play Developer Console and from the resulting screen click on the APK link in the left hand panel When prompted upload the release APK file to the console Creating a New In app Product Once the APK file has been uploaded select the In app Products menu item from the left hand panel of the developer console to display the screen shown in Figure 63 10 Figure 63 10 To add a new product click on the Add new product button and in the resulting panel set the product type to Managed product and enter a Product ID in this case com example buttonclick Click on Continue and in the

    Original URL path: http://www.techotopia.com/index.php/Integrating_Google_Play_In-app_Billing_into_an_Android_6_Application (2016-02-13)
    Open archived version from archive


  • An Overview of Gradle in Android Studio - Android 6 - Techotopia
    Android 6 Edition Print and eBook ePub PDF Kindle editions contain 65 chapters Each project contains one top level Gradle build file This file is listed as build gradle Project project name and can be found in the project tool window as highlighted in Figure 64 1 Figure 64 1 By default the contents of the top level Gradle build file read as follows Top level build file where you can add configuration options common to all sub projects modules uildscript repositories jcenter dependencies classpath com android tools build gradle 1 3 0 NOTE Do not place your application dependencies here they belong in the individual module build gradle files allprojects repositories jcenter task clean type Delete delete rootProject buildDir As it stands all the file does is declare that remote libraries are to be obtained using the jcenter repository and that builds are dependent on the Android plugin for Gradle In most situations it is not necessary to make any changes to this build file Module Level Gradle Build Files An Android Studio application project is made up of one or more modules Take for example a hypothetical application project named GradleDemo which contains two modules named Module1 and Module2 respectively In this scenario each of the modules will require its own Gradle build file In terms of the project structure these would be located as follows Module1 build gradle Module2 build gradle By default the Module1 build gradle file would resemble that of the following listing apply plugin com android application android compileSdkVersion 23 buildToolsVersion 23 0 1 defaultConfig applicationId com ebookfrenzy module1 minSdkVersion 8 targetSdkVersion 23 versionCode 1 versionName 1 0 buildTypes release minifyEnabled false proguardFiles getDefaultProguardFile proguard android txt proguard rules pro dependencies compile fileTree dir libs include jar testCompile junit junit 4 12 compile com android support appcompat v7 23 1 0 As is evident from the file content the build file begins by declaring the use of the Gradle Android plug in apply plugin com android application The android section of the file then states the version of both the SDK and the Android Build Tools that are to be used when building Module1 android compileSdkVersion 23 buildToolsVersion 23 0 1 The items declared in the defaultConfig section define elements that are to be generated into the module s AndroidManifest xml file during the build These settings which may be modified in the build file are taken from the settings entered within Android Studio when the module was first created defaultConfig applicationId com ebookfrenzy gradledemo module1 minSdkVersion 8 targetSdkVersion 23 versionCode 1 versionName 1 0 The buildTypes section contains instructions on whether and how to run ProGuard on the APK file when a release version of the application is built buildTypes release runProguard false proguardFiles getDefaultProguardFile proguard android txt proguard rules pro eBookFrenzy com Purchase the full edition of this Android Studio Development Essentials Android 6 Edition Book in eBook 9 99 or Print 38 99 format Android Studio Development Essentials Android 6 Edition

    Original URL path: http://www.techotopia.com/index.php/An_Overview_of_Gradle_in_Android_Studio_-_Android_6 (2016-02-13)
    Open archived version from archive

  • An Android Studio Gradle Build Variants Example - Android 6 - Techotopia
    Android Studio Project tool window in Android mode This mode presents a less cluttered view of the directory structure of a project When working with build variants however it will be necessary to switch the window into Project mode so that we can gain access to all of the directory levels in the project To switch mode click on the Android menu at the top of the Project tool window and select Project from the list of options as outlined in Figure 65 3 Figure 65 3 eBookFrenzy com Purchase the full edition of this Android Studio Development Essentials Android 6 Edition Book in eBook 9 99 or Print 38 99 format Android Studio Development Essentials Android 6 Edition Print and eBook ePub PDF Kindle editions contain 65 chapters Within the Project tool window right click on the BuildExample app src directory and select the New Directory menu option and create a new directory named phone res layout Right click once again on the src directory this time adding a new directory named phone res values Repeat these steps this time naming the new directories tablet res layout and tablet res values Once complete the module section of the project structure should resemble that of Figure 65 4 Figure 65 4 Adding Resource Files to the Flavors Each flavor is going to need to contain a copy of the activity s activity build example xml and strings xml resource files Each copy will then be modified to meet the requirements of the respective flavor Within the Project tool window navigate to the app src main res layout activity build example xml file and double click on it to load it into the Designer tool With the tool in Design mode double click on the background of the screen layout and specify layout as the id of the relative layout view In the Project tool window right click on the activity build example xml file and select the Copy menu option With the file copied right click on the src phone res layout folder and select the Paste menu option to add a copy of the file to the folder Within the Copy dialog click on OK to accept the defaults Using the same technique add a copy of the src main res values strings xml file to the src phone res values folder Once the resource files have been added edit the strings xml file in the phone flavor to change the hello world string resource as follows xml version 1 0 encoding utf 8 resources string name app name BuildExample string string name hello world This is the phone flavor string string name action settings Settings string resources Change the Build Variant setting to tabletDebug and copy and paste the phone activity build example xml and strings xml files to the corresponding locations in the tablet res layout and res values folders respectively Edit the tablet flavor strings xml file so that the hello world string resource reads This

    Original URL path: http://www.techotopia.com/index.php/An_Android_Studio_Gradle_Build_Variants_Example_-_Android_6 (2016-02-13)
    Open archived version from archive

  • Android Studio Development Essentials - Android 6 Edition - Techotopia
    Navigation Drawer An Overview of the Navigation Drawer Opening and Closing the Drawer Responding to Drawer Item Selections Using the Navigation Drawer Activity Template Creating the Navigation Drawer Template Project The Template Layout Resource Files The Header Coloring Resource File The Template Menu Resource File The Template Code Running the App An Android Studio Master Detail Flow Tutorial The Master Detail Flow Creating a Master Detail Flow Activity The Anatomy of the Master Detail Flow Template Modifying the Master Detail Flow Template Changing the Content Model Changing the Detail Pane Modifying the WebsiteDetailFragment Class Modifying the WebsiteListActivity Class Adding Manifest Permissions Running the Application An Overview of Android 6 Intents An Overview of Intents Explicit Intents Returning Data from an Activity Implicit Intents Using Intent Filters Checking Intent Availability Android 6 Explicit Intents A Worked Example Creating the Explicit Intent Example Application Designing the User Interface Layout for ActivityA Creating the Second Activity Class Designing the User Interface Layout for ActivityB Reviewing the Application Manifest File Creating the Intent Extracting Intent Data Launching ActivityB as a Sub Activity Returning Data from a Sub Activity Testing the Application Android 6 Implicit Intents A Worked Example Creating the Android Studio Implicit Intent Example Project Designing the User Interface Creating the Implicit Intent Adding a Second Matching Activity Adding the Web View to the UI Obtaining the Intent URL Modifying the MyWebView Project Manifest File Installing the MyWebView Package on a Device Testing the Application Android 6 Broadcast Intents and Broadcast Receivers An Overview of Broadcast Intents An Overview of Broadcast Receivers Obtaining Results from a Broadcast Sticky Broadcast Intents The Broadcast Intent Example Creating the Example Application Creating and Sending the Broadcast Intent Creating the Broadcast Receiver Configuring a Broadcast Receiver in the Manifest File Testing the Broadcast Example Listening for System Broadcasts A Basic Overview of Java Threads and Thread Handlers on Android An Overview of Threads The Application Main Thread Thread Handlers A Basic Threading Example Creating a New Thread Implementing a Thread Handler Passing a Message to the Handler An Overview of Android 6 Started and Bound Services Started Services Intent Service Bound Service The Anatomy of a Service Controlling Destroyed Service Restart Options Declaring a Service in the Manifest File Starting a Service Running on System Startup Implementing an Android 6 Started Service A Worked Example Creating the Example Project Creating the Service Class Adding the Service to the Manifest File Starting the Service Testing the IntentService Example Using the Service Class Creating the New Service Modifying the User Interface Running the Application Creating a New Thread for Service Tasks Android 6 Local Bound Services A Worked Example Understanding Bound Services Bound Service Interaction Options An Android Studio Local Bound Service Example Adding a Bound Service to the Project Implementing the Binder Binding the Client to the Service Completing the Example Testing the Application Android 6 Remote Bound Services A Worked Example Client to Remote Service Communication Creating the Example Application Designing the User Interface Implementing the Remote

    Original URL path: http://www.techotopia.com/index.php?title=Android_Studio_Development_Essentials_-_Android_6_Edition&oldid=21113 (2016-02-13)
    Open archived version from archive

  • Pages that link to "Android Studio Development Essentials - Android 6 Edition" - Techotopia
    Virtual Device AVD in Android Studio links Testing Android Studio Apps on a Physical Android 6 Device links The Basics of the Android Studio Code Editor Android 6 links A Guide to the Android Studio Designer Tool Android 6 links Designing a User Interface using the Android Studio Designer Tool Android 6 links Creating an Android 6 User Interface in Java Code links Using the Android 6 GridLayout Manager in Android Studio Designer links Working with the Android 6 GridLayout using XML Layout Resources links An Overview and Example of Android 6 Event Handling links Detecting Common Gestures using the Android 6 Gesture Detector Class links Implementing Custom Gesture and Pinch Recognition on Android 6 links An Introduction to Android 6 Fragments links Using Fragments in Android Studio An Example Android 6 links Animating User Interfaces with the Android 6 Transitions Framework links An Android 6 Transition Tutorial using beginDelayedTransition links Implementing Android 6 Scene Transitions A Tutorial links Working with the Floating Action Button and Snackbar links Creating an Android Tabbed Interface using the TabLayout Component links Working with the Android RecyclerView and CardView Widgets links An Android RecyclerView and CardView Tutorial links Working with the Android AppBar and Collapsing Toolbar Layouts links Implementing an Android Navigation Drawer links An Android Studio Master Detail Flow Tutorial Android 6 links An Overview of Android 6 Intents links Android 6 Explicit Intents A Worked Example links Android 6 Implicit Intents A Worked Example links Android 6 Broadcast Intents and Broadcast Receivers links A Basic Overview of Java Threads and Thread Handlers on Android links An Overview of Android 6 Started and Bound Services links Implementing an Android 6 Started Service A Worked Example links Android 6 Local Bound Services A Worked Example links Android 6 Remote Bound Services A Worked Example

    Original URL path: http://www.techotopia.com/index.php/Special:WhatLinksHere/Android_Studio_Development_Essentials_-_Android_6_Edition (2016-02-13)
    Open archived version from archive

  • Changes related to "Android Studio Development Essentials - Android 6 Edition" - Techotopia
    m This is a minor edit b This edit was performed by a bot 123 The page size changed by this number of bytes Show last 50 100 250 500 changes in last 1 3 7 14 30 days Hide minor edits Show bots Hide anonymous users Hide registered users Hide my edits Show new changes starting from 06 41 13 February 2016 Namespace all Main Talk User User talk

    Original URL path: http://www.techotopia.com/index.php/Special:RecentChangesLinked/Android_Studio_Development_Essentials_-_Android_6_Edition (2016-02-13)
    Open archived version from archive

  • Android Studio Development Essentials - Android 6 Edition - Techotopia
    Creating the Navigation Drawer Template Project The Template Layout Resource Files The Header Coloring Resource File The Template Menu Resource File The Template Code Running the App An Android Studio Master Detail Flow Tutorial The Master Detail Flow Creating a Master Detail Flow Activity The Anatomy of the Master Detail Flow Template Modifying the Master Detail Flow Template Changing the Content Model Changing the Detail Pane Modifying the WebsiteDetailFragment Class Modifying the WebsiteListActivity Class Adding Manifest Permissions Running the Application An Overview of Android 6 Intents An Overview of Intents Explicit Intents Returning Data from an Activity Implicit Intents Using Intent Filters Checking Intent Availability Android 6 Explicit Intents A Worked Example Creating the Explicit Intent Example Application Designing the User Interface Layout for ActivityA Creating the Second Activity Class Designing the User Interface Layout for ActivityB Reviewing the Application Manifest File Creating the Intent Extracting Intent Data Launching ActivityB as a Sub Activity Returning Data from a Sub Activity Testing the Application Android 6 Implicit Intents A Worked Example Creating the Android Studio Implicit Intent Example Project Designing the User Interface Creating the Implicit Intent Adding a Second Matching Activity Adding the Web View to the UI Obtaining the Intent URL Modifying the MyWebView Project Manifest File Installing the MyWebView Package on a Device Testing the Application Android 6 Broadcast Intents and Broadcast Receivers An Overview of Broadcast Intents An Overview of Broadcast Receivers Obtaining Results from a Broadcast Sticky Broadcast Intents The Broadcast Intent Example Creating the Example Application Creating and Sending the Broadcast Intent Creating the Broadcast Receiver Configuring a Broadcast Receiver in the Manifest File Testing the Broadcast Example Listening for System Broadcasts A Basic Overview of Java Threads and Thread Handlers on Android An Overview of Threads The Application Main Thread Thread Handlers A Basic Threading Example Creating a New Thread Implementing a Thread Handler Passing a Message to the Handler An Overview of Android 6 Started and Bound Services Started Services Intent Service Bound Service The Anatomy of a Service Controlling Destroyed Service Restart Options Declaring a Service in the Manifest File Starting a Service Running on System Startup Implementing an Android 6 Started Service A Worked Example Creating the Example Project Creating the Service Class Adding the Service to the Manifest File Starting the Service Testing the IntentService Example Using the Service Class Creating the New Service Modifying the User Interface Running the Application Creating a New Thread for Service Tasks Android 6 Local Bound Services A Worked Example Understanding Bound Services Bound Service Interaction Options An Android Studio Local Bound Service Example Adding a Bound Service to the Project Implementing the Binder Binding the Client to the Service Completing the Example Testing the Application Android 6 Remote Bound Services A Worked Example Client to Remote Service Communication Creating the Example Application Designing the User Interface Implementing the Remote Bound Service Configuring a Remote Service in the Manifest File Launching and Binding to the Remote Service Sending a Message to the Remote Service

    Original URL path: http://www.techotopia.com/index.php?title=Android_Studio_Development_Essentials_-_Android_6_Edition&printable=yes (2016-02-13)
    Open archived version from archive

  • Information for "Android Studio Development Essentials - Android 6 Edition" - Techotopia
    in bytes 53 244 Page ID 5881 Page content language English en Page content model wikitext Indexing by robots Allowed Number of redirects to this page 2 Counted as a content page Yes Page protection Edit Allow all users infinite Move Allow all users infinite Edit history Page creator Neil Talk contribs Date of page creation 19 23 26 December 2015 Latest editor Neil Talk contribs Date of latest edit

    Original URL path: http://www.techotopia.com/index.php?title=Android_Studio_Development_Essentials_-_Android_6_Edition&action=info (2016-02-13)
    Open archived version from archive