Quantcast
Channel: Intel Developer Zone Articles
Viewing all articles
Browse latest Browse all 3384

Are you ready to build 64-Bit Applications for Android* Using 64-bit Emulator Images?

$
0
0

Introduction

Download  How-to-use-64-bits-Emulator-Image.pdf

Mobile development on Android* is mainly focused on 64-bit systems. Smartphones with 64-bit Android have better performance. That’s why more smartphones use 64-bit Android and the number of 64-bit applications increases every day. Any developer can write 64-bit applications, but some developers don’t have a 64-bit device to validate their applications on. Android L Emulator is made to solve this problem. If you don’t have a full 64-bit-supported device, you can test your applications in an emulator. Luckily, Google announced the availability of the 64-bit Android L emulator for Intel® x86 architecture.

Download and Install of the Emulator

To use the 64-bit Android Emulator you must download Android Studio. It includes:

  • Android Studio IDE
  • Android SDK tools
  • Android 5.0 Platform
  • Android 5.0 Emulator

Before you set up Android Studio, be sure you have installed JDK 6 or higher (the JRE alone is not sufficient). JDK 7 is required when developing for Android 5.0 and higher. To check if you have the JDK installed (and which version), open a terminal and type “javac –version”. If the JDK is not available or the version is lower than 6, download JDK. On some Windows* systems, the launcher script cannot find where Java* is installed. If you encounter this problem, you need to set an environment variable indicating the correct location:

Select Start menu > Computer > System Properties > Advanced System Properties. Then open Advanced tab > Environment Variables and add a new system variable “JAVA_HOME” that points to your JDK folder, for example “C:\Program Files\Java\jdk1.8.0_05”. Android Studio is now ready and loaded with the Android developer tools.

Using the Android Virtual Device Manager

The Android SDK includes a virtual mobile device emulator that runs on your computer. The emulator lets you prototype, develop, and test Android applications without using a physical device.

The Android emulator mimics all of the hardware and software features of a typical mobile device, except that it cannot place actual phone calls. It provides a variety of navigation and control keys, which you can "press" using your mouse or keyboard to generate events for your application. It also provides a screen in which your application is displayed, together with any other active Android applications.

The emulator’s interface (shown below) is easy to understand.


Figure 1.

 

In Figure 1’s window you see the list of known device definitions. You can use one of them to create an Android Virtual Device or you can create device definitions yourself by clicking “Create Device” (Figure 2).


Figure 2.

 

Choose the parameters for your new device and click “Create Device” again. The new device will appear in the list of device definitions (Figure 3).


Figure 3.

 

To create a new Android Virtual Device click “Create AVD”. A dialog box will appear allowing you to choose the desired settings for your new device such as name of device, parameters of camera, and storage (Figure 4).


Figure 4.

 

Then press “ok”. After closing this window you can start creating devices by pressing “Start”.


Figure 5.

Starting and Stopping the Android Emulator

During development and testing of your application, you install and run your application in the Android emulator. You can launch the emulator as a standalone application from a command line, or you can run it from within your Android Studio development environment. In either case, you specify the AVD configuration to load and any startup options you want to use, as described earlier in this document.

You can run your application on a single instance of the emulator or, depending on your needs, you can start multiple emulator instances and run your application in more than one emulated device. You can use the emulator's built-in commands to simulate GSM phone calling or SMS between emulator instances, and you can set up network redirection that allows emulators to send data to one another. For more information, see Telephony Emulation, SMS Emulation, and Emulator Networking.

To start an instance of the emulator from the command line, navigate to the tools/ folder of the SDK. Enter the emulator command like this:

emulator -avd <avd_name> [<options>]

This initializes the emulator, loads an AVD configuration, and displays the emulator window. For more information about command line options for the emulator, see the Android Emulator tool link in the Resources section. When you run your app from Android Studio, it installs and launches the app on your connected device or emulator (launching the emulator, if necessary). You can specify emulator startup options in the Run/Debug dialog on the Target tab.

Conclusion

The Android emulator is an application that provides a virtual mobile device on which you can run your Android applications. It runs a full Android system stack, down to the kernel level, that includes a set of preinstalled applications (such as the dialer) that you can access from your applications. You can choose what version of the Android OS you want to run in the emulator by configuring AVDs, and you can also customize the mobile device skin and key mappings. When launching the emulator and at runtime, you can use a variety of commands and options to control its behavior.

The Android system images available through the Android SDK Manager contain code for the Android Linux* kernel, the native libraries, the Dalvik* VM, and the various Android packages (such as the Android framework and preinstalled applications). The emulator provides dynamic binary translation of device machine code to the OS and processor architecture of your development machine. The Android emulator supports many hardware features commonly found on mobile devices

Resources

  • Read about 64-bit Android* and Android Run Time here.
  • How to Develop and Evaluate 64-bit Android* Apps on Intel® x86 Platforms you can read here.
  • For more information about 64-Bit Android* OS here.
  • Read about Android L Emulator here.
  • Read about Managing Virtual Devices here.

About the Author

Egor Filimonov works in the Software & Services Group at Intel Corporation. He is a student of Lobachevsky State University in Nizhni Novgorod, Russia and majors in mechanics and mathematics. His specialty is applied mathematics and informatics. His main interest is HPC (High Performance Computing) and mobile technologies.


Viewing all articles
Browse latest Browse all 3384

Trending Articles