You are on page 1of 11

Intel INDE for Google Android* Studio

Introduction
This article walks you through a simple example showing how to use Google Android* Studio
within Intel Integrated Native Developer Environment (Intel INDE).

About Intel INDE


Intel INDE is a cross-platform productivity suite that provides developers the tools, support,
integration, and updates they need to create high-performance applications for Android and Windows*.
Bundled in Intel INDE is everything a complete application development workflow requires:
environment setup (IDE integration for Android), common function libraries optimized for each platform
(such as media, threading libraries, and utility libraries), compilers, debugging tools, and analysis and
optimization tools. Key benefits include faster development time and the opportunity to develop
applications cross-architecture and cross-OS, with your choice of IDE.
Intel INDE is important first of all because Android is now running on a tremendous number of
devices. If you want to develop for the mobile marketplace, youll find that getting started on the
Android platform is much easy with Intel INDE. It will help you develop Android apps that run at native
performance levels on a wide range of platforms. And you dont have to spend a lot of time learning
how to optimize the performance and power characteristics of each target device.

About Android Studio within Intel INDE


Android Studio IDE Integration in Intel INDE sets up the environment you need for developing
native apps in Android Studio. This includes installing Android Studio, Android SDK, NDK, and other
development tools like ANT and ADT plug-ins.

Intel INDE Setup


Download Intel INDE and start the installation. IDE integration is available on all the editions of
the product. Once you choose the IDE you want to install, a screen will display. Select Android Studio
Development Environment, and a wizard walks you through the rest of the installation.

Creating New Projects with Android Studio


To start, you need to launch Android Studio and click New Project as shown in Figure 1.

Figure 1
Next youll see the window for configuring your new project (Figure 2). Here you can change
your app name, then click Next.

Figure 2
After that a window for selecting form factors you want to run your app on displays (Figure 3).
Choose the target form factors and click Next.

Figure 3
In the next window choose the Intel INDE Activity template, Blank Activity With NDK Support
(Figure 4). Click Next.

Figure 4
Change the Activity Name and enter the NDK path where the NDK is installed under IDE
integration in the INDE installation directory (Figure 5), then click Finish.

Figure 5

Next the Project Explorer pane opens on the left side of the screen (Figure 6) showing all the
files in your project, including the main activity, UI layout, native code, etc. Let's take a look at a few of
them.

Figure 6
TestApp/app/src/main/res/layout/activity_test_app.xml (Figure 7) defines the UI layout of the
app. You can change the design of your Activity by altering this file or replacing it with another design
file you have.

Figure 7
TestApp/app/src/main/java/TestApp.java has the event handlers for the UI elements (Figure 8).
This also calls the native code from TestApp/app/src/main/jni/. Its shown below with a red line.

Figure 8
TestApp/app/src/main/jni/NativeCode.cpp implements the function getStringFromNative
(Figure 9). Here you can add your native code. For example the native code is circled in red as shown
below.

Figure 9
In TestApp/app/src/build.gradle you can change the processor architecture your app is
targeting. The variable abiFiler determines the target which is set to x86 by default (circled in Figure 10).

Figure 10

Let's add the button "Show" to the UI layout. Drag Button from the Widgets menu to the layout
and label it "Show". Then drag a text element to the layout, open the text editor, change the UI layout,
and make the text invisible (circled line in Figure 11) so that the text only shows after the button is
clicked.

Figure 11
Next you need to implement the processing of the button in the main activity. Add a Button
object to the onCreate() method and implement the processing of the button as shown in Figure 12.

Figure 12
Now after you click the button youll see the text on the UI layout.
To build your app click Build -> Rebuild Project. Once the build is successful, run the app. Click
Run -> Run App. Choose a device from the device list (you need to have a running Android device) or
launch an emulator and click OK (Figure 13).

Figure 13
You should see this result on your screen:

Summary
This article walked you through a simple example that showed getting started with Google
Android Studio in Intel INDE.

About The Author


Denis Smirnov has been working at Intel as a Technical Intern for the last six months. Denis is
getting his masters degree in Computer Science in the Nizhny Novgorod State Technical University,
specializing in Applied Mathematics.

Related Articles and Resources

Intel INDE Getting Started Guide for Developing Android* Apps (Windows* Host)

Building Native Android* Apps Using Intel(R) C++ Compiler in Android Studio*

Notices
INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. NO LICENSE, EXPRESS
OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS
DOCUMENT. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL
ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO
SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A
PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER
INTELLECTUAL PROPERTY RIGHT.
UNLESS OTHERWISE AGREED IN WRITING BY INTEL, THE INTEL PRODUCTS ARE NOT DESIGNED NOR INTENDED FOR
ANY APPLICATION IN WHICH THE FAILURE OF THE INTEL PRODUCT COULD CREATE A SITUATION WHERE PERSONAL
INJURY OR DEATH MAY OCCUR.
Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not
rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined." Intel

reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities
arising from future changes to them. The information here is subject to change without notice. Do not finalize a
design with this information.
The products described in this document may contain design defects or errors known as errata which may cause
the product to deviate from published specifications. Current characterized errata are available on request.
Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your
product order.
Copies of documents which have an order number and are referenced in this document, or other Intel literature,
may be obtained by calling 1-800-548-4725, or go to: http://www.intel.com/design/literature.htm
Software and workloads used in performance tests may have been optimized for performance only on Intel
microprocessors. Performance tests, such as SYSmark* and MobileMark*, are measured using specific computer
systems, components, software, operations, and functions. Any change to any of those factors may cause the
results to vary. You should consult other information and performance tests to assist you in fully evaluating your
contemplated purchases, including the performance of that product when combined with other products.
Any software source code reprinted in this document is furnished under a software license and may only be used
or copied in accordance with the terms of that license.
Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and/or other countries.
Copyright 2015 Intel Corporation. All rights reserved.
*Other names and brands may be claimed as the property of others.

You might also like