Skip to main content

Posts

Showing posts from October, 2019

Publishing Your Application

After you have created , and fully debugged , you application , you might want to deploy it to the Google.Store for others to enjoy. The following sections outline the steps for publishing your applications. Generating a Signed APK To Publish Your finished application on the Google Play Store , you must generate a signed APK ( the Android application package ) . The APK is the compiled , executable version of your application. Signing it is much like signing your name to a document. The signature identifies the app's developer to Google and the users who install your application. More importantly , unless your Android Studio is in developer mode , unsigned application will not run . Use the following steps to generate a signed APK :   1. Generate a signed APK from your code by selecting Build -> Generate Signed APK from the Menu bar to bring up the Generate Signed APK window as show in figure   2. Assuming you have never published an application from Android S

Navigating Paused Code

While in debug mode , Android Studio pauses at any breakpoint that you have set . This is , as long as a breakpoint has been set on a reachable line of code (  a line of code that would be executed by system ) , Android Studio halts execution at that line until you tell it to continue. When Android Studio hits , and pauses at , a breakpoint , the circle in the margin next to the corresponding line of code changes to circle with a check mark. Once a breakpoint has been hit , the debug window opens at the bottom Android Studio , as show in Figure . The debug window contains many of the tools you use to navigate around your code. Notice the navigation buttons located in the menu bar of the debug window . The most commonly used are Step Over and Step Into . Step Over advances you to the line of code that immediately follows the one at which you are currently paused . This means that if you are paused at a method call , and you press Step Over , Android Studio executes the method

Debugging Your Application

After you have built an application , you need to be able to debug it and see what is going on inside your code . One of the handiest ways to be able to see inside your code it through the use of break points. Breakpoints allow you to pause the execution of your code at specific location and see what is going on (or what is going wrong). Let's take a look at how to use breakpoints in Android Studio. Setting Breakpoints Breakpoints are mechanism by which you can tell Android Studio to temporarily pause execution of your code , which allows you to examine the condition of your application . This means that you can check on the values of variables in your application while you are debugging it. Also , you can check whether certain lines of code are being executed as expected - or at all. To tell Android Studio that you want to examine a specific line of code during debugging , you must set breakpoint at the line. Click the margin of the editor tab next to line of code you want

Using Code Completion

Code completion is an invaluable tool that shows you contextual options for completing the piece of code that you are trying to write. For example, in the editor tab for the MainActivity.js file, locate the line that reads.          setContentView(R.layout.activity_main); Place your cursor after this line and press the Enter Key . On the new line , type the letter R , and then type a period, as shown here:          R. Android Studio Code Completion should display a list of values that you could use to try to complete the code statement. Figure shows what this list might look like . this is important if you are not entirely sure of the spelling of a method call or how to identify the different method signatures. NOTE if the code completion window does not open , press Ctrl + Space to force it to open. This is the same key combination used in some other IDEs for their versions of the code completion. You can also use code completion to insert code stubs into your classes

Exploring The IDE

In this section you explore the Android Studio Integrated Development Environment, Which is also known as the IDE. Basically, the IDE is the interface between you and Android Studio. The more you know about the tools, windows , and options that are available to you in Android Studio , the faster you will be able to produce code and the more confident you will be at creating applications. 1. If you haven't already, open Android Studio. If you worked through last Blog , you created a very quick Hello World project. You are going to create another quick project for this blog ; this time , however , you explore the different options available as you start up and work with your project. 2. Now that you have opened Android Studio , you see should a screen that looks like show NOTE :- if you not see the screen in figure and instead see the last Hello world Project from last blog , simply locate the File option on the menu bar , Click File -> Close Project to return to the scr

Launching Your First Android Application

With all tools and the SDK downloaded and installed , it is now time to start your engine.As in most programming blog, the first example uses the ubiquitous Hello World application. This will give you a detailed look at various components that make up an Android project. This is also the easiest Android project you will ever make. Believe it or not , the Hello Wold Application is already finished. By default , when you create a new application in Android Studio , it creates a Hello World application. Let's launch this application and , in the process , also launch the Android emulator to see how everything works. 1. Select Run -> Run app from the Android Studio menu bar. You should see the Select Deployment Target dialog as shown. 2. Select the Nexus 5X API 25 ( feel free to select the Nexus 5x API 25 , which is the Jelly Bean emulator that you created in the Try It Out for the last section),and click Next. NOTE :- note that if there's ever a time when you have n

The Android Developer Community

Now that Android is in its seventh version , there is a large developer community all over the world. It is easy to find solutions to problems and to find like-minded developers with whom to share app ideas and experiences. The following are some developer communities and websites that you can turn to for help if you run into programs while working with Android. Stack Overflow ( https://stackoverflow.com ):- Stack Overflow is a collaboratively edited question-and-answer site for developers.If you have a question about Android,chances are someone at Stack Overflow is probably already discussing the same question. It's also likely that someone else has already provided the answer. Best of all , other developers can vote for the best answer so that you can know which are the answers that are most trustworthy.   Google Android Training ( https://developer.android.com/guide ) :- Google has launched the Android Training site , which contains a number of useful classes grouped by t

Creating Android Virtual Devices (AVDs)

The next step is to create an Android Virtual Device (AVD) you can use for testing your Android application. An AVD is an emulator instance that enables you to model an actual device. Each AVD consists of a hardware profile ; a mapping to a system image ; and emulated storage,such as a secure digital (SD) card.One important thing to remember about emulators is that they are not perfect. There are some applications , such as games (which are GPU heavy ) or application that use sensors such as the GPS or accelerometer. Theses types of application cannot be simulated with the same speed or consistency within an emulator as they can when running on an actual device. However , the emulator is good for doing some generalized testing of your applications. You can create as many AVDs as you want to test your applications with different configurations. This testing is important to confirm the behavior of you application when it is run on different devices with varying capabilities. Use

Android SDK

The most important piece of software you need to download is, of course, the Android SDK. the Android SDK contains all of the packages and tools required to develop a functional Android application. The SDKs are named after the version of Android OS to which they correspond.By default, the Marshmallow SDK was installed with Android Studio , which means you can develop applications that will run seamlessly on devices with Android Marshmallow. However, if you want to install a different Android SDK , you can do so using the SDK Manager from the Android Studio welcome screen. from this screen,click the Configure drop-down menu in the lower-right corner. The Configure selection menu opens.Choose SDK Manager from this menu. The SDK configuration screen , shows that the Marshmallow SDK is already installed. Android N is available to be installed (as of the writing of this blog Android Nougat was in a finalized beta , so it might be named differently now). Select Pie , click Appl

Android Studio

The first and most important piece of software you need to download is Android Studio. After you have downloaded and installed Android Studio , you can use the SDK Manager to download and install multiple versions of the Android SDK. Having multiple version of the SDK available enables you to write programs that target different devices. For example , you can write one version of an application that specifically targets Android Nougat , but because that flavor Android is on less than 1% of devices, with multiple versions of the SDK you can also write a version of your app that uses older features and targets Marshmallow or Lollipop users. You can use Android Device Manager to set up device emulators. You can Download Android Studio from https://developer.android.com/studio Android Studio is packaged in an executable. Run the install process to set up Android Studio. After you've download and run the setup executable, use the following steps to go through the installation proce

OBTAINING THE REQUIRED TOOLS

Now that you know what Android is and what its feature set contains, you are probably anxious to get your hands dirty and start writing some application! Before you write your first app,however , you need to download the required tools. For Android development , you can use a Mac,Windows PC,or a Linux machine. You can freely download all the necessary tools. Most of the examples provided in the blog are written to work on Android Studio. For this Blog, i am using a Windows 10 computer to demonstrate all the code samples.If you are using a Mac or Linux computer , the screenshots look similar. Some minor differences might be present,but you should be able to follow along without problems. Let the fun begin ! NOTE:- The Android Studio makes use of the Java SE Development Kit (JDK) . If Your computer does not have JDK installed, yous should by Downloading it from https://www.oracle.com/technetwork/java/javase/downloads/jdk13-downloads-5672538.html and installing it prior to movin

The Android Market

As mentioned earlier , one of the main factors determining the success of a smartphone platform is the applications that support it. It is clear from the success of the iPhone that application play a very vital role in determining whether a new platform swims or sinks.Also, making these applications accessible to the general user is extremely important. Users can simply use the Google Play application that is preinstalled on their Android devices to directly download third-party applications to their devices. Both paid and free application are available in the Google Play Store, although paid applications are available only to user certain countries because of legal issues.

Android Devices in the Market

Android devices come in all shapes and size including , but not limited to , the following types of devices : Smartphone Tables E-reader devices Internet TVs Automoblies SmartWatches Chances are good that you own at least one of the preceding devices.  Another popular category of devices is the tablet.Tablets typically come in two sizes : 7" and 10",measured diagonally. Besides smartphone and tables, Android is used in dedicated devices. In addition to the popular moblies devices I've already mentioned , Android is finding its way onto your wrist.Smartwatches and "wearables" in general , have becomes a major segment of the Android population. the Motorola Moto 360 Smartwatch, which runs Android Wear ( a version of Android OS specifically for wearables). At the time of writing , the Samsung Galaxy Nexus is the only device running a pure version Android.Many manufacturers add their own modifications to the Android OS for use on their specific d

Architecture of Android

To understand how Android works,take a look , which show the various layers that make up the Android operating system(OS). The Android OS is a roughly divided into five sections in four main layers: Linux kernel :- This is the kernel on which Android is based. This layer contains all the low-level device drivers for the various hardware components of an Android device. Libraries :- These contain the code that provides the main features of an Android OS.For example , the SQLLite library provides database support so that an application can use it for data storage.The WebKit library provides functionalities for web browsing. Android runtime :- The Android runtime is located in the same layer with the libraries and provides a set of code libraries that enable developers to write Android apps using the Java programming language.The Android runtime also includes the Dalvik virtual machine , which enables every Android application to run in its own process, with its own instance of th

Features of Android

Because Android is Open source and freely available to manufacturers for customization , there are no fixed hardware or software configurations . However , the base Android OS supports many features , including Storage :- SQLite , a lightweight relational database , for data storage . Connectivity :- GSM/EDGE,IDEN,CDMA,EV-DO,UMTS,Bluetooth (includes A2DP and AVRCP ),Wi-Fi,LTE, and WiMAX. Messaging :- Both SMS and MMS Media support :- H.263,H.264(in 3GP or MP4 container),MPEG-4 SP, AMR , AMR-WB (in 3GP container ),AAC,HE-AAC (in MP4 or 3GP container),MP3,MIDI,Ogg Vorbis,WAV ,JPEG,PNG,GIF , and BMP. Hardware Support :- Accelerometer sensor, camera, digital compass,proximity sensor,and GPS. Multi-touch :- Multi-touch screens. Tethering :- Sharing of Internet connections as a wired/wireless hotspot. Android's web browser is based on the open source WebKit and Chrome's V8 JavaScript engine.

Android Versions

Android has gone through quite a numbers of updates since its first release . show the various of Android and their codenames.  In 2019, Google released Android 10.0;the Following are key changes in Android 10.0: Split-screen multi-window mode Redesigned notification shade Refined "Doze" feature Switch from JRE(Java Runtime Environment) to Open JDK One important thing to keep in mind as you are looking Android versions is that each version has its own features and APIs (application programming interfaces), if your application is written for the newest version of Android, and its uses an API that was not present in an older version of Android, then only devices running that newer version of Android will be able to use your application.  

What is Android

Android is a moblie operating System that is based on a modified version of Linux. It was originally developed by a startup of the same name , Android , Inc. In 2005 , as part of its strategy to enter the moblie space , Google purchased Android , Inc. and took over its development work (as well as its development team). Google wanted the Android OS to be open and free , so most of the Android code was released under the open source Apache License. That means anyone who wants to use Android can do so by downloading the full Android source code. Moreover, vendors ( typically hardware manufacturers ) can add their own proprietary extensions to Android and customize Android to differentiate their products from others . This development model makes Android very attractive to vendors, especially those companies affected by the phenomenon of Apple's iPhone,which was a hugely successful product that revolutionized the smartphone industry. When the iPhone was launched , many smartphone m