Learning Android Intents
Muhammad Usama bin Aftab, Wajahat Karim
Language: English
Pages: 318
ISBN: 1783289635
Format: PDF / Kindle (mobi) / ePub
Explore and apply the power of intents in Android application development
About This Book
- Understand Android Intents to make application development quicker and easier
- Categorize and implement various kinds of Intents in your application
- Perform data manipulation within Android applications
Who This Book Is For
If you are a novice or an intermediate Android Developer who wants to expand their knowledge of Android Intents, this book is ideal for you. Readers are expected to have basic understanding of Android development, how to use different IDEs, and how to develop applications using Android APIs.
What You Will Learn
- Understand Android Intents and their importance in Android apps
- Get to grips with the different types of Intents and their implementation
- Discover data transfer methods in Android Intents along with their optimization and performance comparisons
- Explore the implementation of Intents while invoking Android Features in an application.
- Use Intent Filters and their sub-domains in order to perform various actions and sorting categories in Android Intents
- Catch different events while working with Broadcast Receiver and perform various actions
- Implement pending Intents and Intent Service, sending text to the Notification Panel, and much more
In Detail
Android is an emerging technology with loads of apps in the Google Play Market. Till date, it is the biggest marvel in Smartphone technology, propelling a larger number of developers into Android application development. Intent is an essential part of any Android Application and no Android application is complete without using them. Features such as listening broadcasts, sending messages, sharing via social networks, notifications, hardware components including camera, sensors, Wi-Fi, and more, can be used in your applications by using Intents.
This practical guide focuses on using intents to make the best use of various features of Android platform. It is ideal for those developers who want to understand the backbone and the domain of Android Intents, its power, and the need for it inside an Android application. Practical, in-depth examples are used throughout the book, to help you understand the key concepts.
The book starts with introducing the very basic concepts of Android, and its various facts and figures such as different Android versions, their release dates, evolution of Android phones and so on. While covering the basic technical concepts, it proceeds from the easiest route of introducing Android Intents towards the more practical view of Android Intents in terms of components and features.
You will learn how to use different components and features such as transfer data between activities, invoke various features and components of Android, execute different in-built and custom-made services, use hardware and software components of Android device, and start Pending Intents & notifications. You will gain better theoretical knowledge of what is running behind the concepts of Android Intents, and practical knowledge of the mobile-efficient ways to perform a certain task using Android Intents.
Towards the end, you will have a clear vision and a practical grip on Android intents and its features. Learning Android Intents is a proper guide to give you the best knowledge of Intents.
Knowledge Needs and Information Extraction: Towards an Artificial Consciousness (ISTE)
Programming Windows Store Apps with HTML, CSS and JavaScript
The Government Machine: A Revolutionary History of the Computer
Créez vos sites Web avec Joomla! 3
stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_two_layout); Toast.makeText(this, "The Intent has been called..." , Toast.LENGTH_LONG).show(); Intent returnIntent = new Intent(); CheckBox yesCheckBox = (CheckBox) findViewById(R.id.checkBox1); CheckBox noCheckBox = (CheckBox) findViewById(R.id.checkBox2); Button button = (Button) findViewById(R.id.button2); button.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" > listeners in Java files instead of XML. The other View component in our layout file is Image View. This Image View will show the image picked from the gallery or other image sharing apps. We have set Image View's source to launcher-icon image as the default image. After developing the layout of the app, let's focus on the logic of the app. The MainActivity file shows how the app gets the image from other apps and displays it. [ 89 ] Intent and Its Categorization The MainActivity.java class Mobile Components We have added a button in the layout with the view ID of btnWifiSettings. We will use this ID to get the button View in the layout file. We have already discussed the layouts in the previous chapters. Let's now see our main activity file that will use this layout as the visual content. The MainActivity.java file This file represents the main activity file as a launcher point of the app. We will implement our button's core functionality in this file. The code implementation of icon to our image View. Below the image View, we have placed a button View. On tapping the button, the camera will be started. The button's ID is set to btnTakePicture by the android:layout_below tag below the image View layout. This relativity is the main advantage of the relative layouts as compared to linear layouts. So now, let's have a look at the activity of the app that performs the main functionality and uses this layout as a visual part as well. [ 121 ] Intents for Mobile Components