How to Set Up Your PC for Android Application Development
Supported Environments: Windows 7 (32/64-bit), Windows Vista (32/64-bit), Windows XP
* This application note was written using a Windows 7 64-bit PC
** Linux/Mac directions on Android Developer site.
Supported Star Interfaces: Bluetooth, LAN, WirelessLAN
Supported Language: Java
- JDK 6
- Android SDK Manager
- ADT (Android Development Tool) Plugin for Eclipse
- USB Windows Driver by Android Device Manufacturer
- Star Android SDK
Table of Contents
:: Developer Resources
Android Developers: http://developer.android.com/index.html
System Requirements for Android Development: http://developer.android.com/sdk/requirements.html
Star Developer Support Section: http://www.starmicronics.com/support/SDKDocumentation.aspx
:: Download Links
Java Platform (JDK): http://www.oracle.com/technetwork/java/javase/downloads/index.html
Android SDK Manager: http://developer.android.com/sdk/index.html
Android ADT: http://developer.android.com/sdk/eclipse-adt.html#installing
OEM USB Driver List: http://developer.android.com/sdk/oem-usb.html
I. Download/Install JDK
1. Download Java SE 6 JDK here: http://www.oracle.com/technetwork/java/javase/downloads/index.html
JRE alone is not enough. To use Android SDK Manager, you must have JDK installed.
At the time of this writing, it is recommended to use the Java SE 6 JDK. Eclipse will not successfully install ADT updates if using Java 7.
II. Download/Run Eclipse
1. Download Eclipse here: http://www.eclipse.org/downloads/
2. Unzip package.
3. The unzipped folder includes “eclipse.exe”. Eclipse doesn’t need to be installed on PC to run; simply double click the file.
5. If you run Eclipse before installing Android SDK components, you cannot build or run Android applications. You can confirm this point by clicking File > New > Project. “Android Project” will not be listed.
6. Exit Eclipse.
III. Download/Install Android SDK Manager
Important Notes Before Starting:
A. ALWAYS run Android SDK Manager as administrator in Windows 7/Vista. (If not, some packages might not download.)
B. Android SDK Manager is necessary to download any official Android platforms, SDKs, and samples. You can use this tool to update or install more packages in the future.
1. Download the .exe file for first time installations. (If you want to update an existing file, you only need to download the
2. Run the Installer.
4. Next (If JDK is not installed, you will be informed here.)
5. Install in the location of your choice.
Note: r12 and earlier had a known bug where an application would not run if Android SDK packages were installed in a folder with spaces. If you are installing an older version, create a new folder with no spaces and install there, such as
C:\Android; this bug was fixed from r13.
8. Uncheck the box to “Start SDK Manager”. Finish.
9. Start Menu > Android SDK Tools > Right click “Android SDK Manager” > Run as administrator (Very important. If you don’t run as administrator, some packages will not download.)
10. Choose the package(s) you wish to install and click “Install n packages…”.
Note: Star’s Android SDK supports a minimum version of 2.1 (API 7).
IV. Download/Install ADT Plugin
Note: ADT = Android Development Tools. Installing them enables Eclipse to create/build/etc Android applications.
1. Open Eclipse.
2. Click Help > Install New Software
4. Type “ADT Plugin” as name. Copy/Paste this URL into Location: https://dl-ssl.google.com/android/eclipse/
5. Check “Developer Tools”. You don’t need to modify anything in the orange box. Click Next.
7. Check “I accept”. Finish.
8. Installation starts.
9. Click “OK”.
10. Click “Restart Now” to restart Eclipse.
11. Window > Preferences
12. Click “Android” in left column.
13. Browse to the location of the Android folder where the SDK Manager was installed. (C:\Android\android-sdk).
14. Nothing will appear in the box below until Apply is clicked.
15. Installed packages appear. Click OK.
V. Import Star Android SDK
1. File > Import
2. General > Existing Projects into Workspace
3. Browse to the location where the Star SDK is saved. Click Finish.
4. The Application loads. GUI functions are available in src > com.StarMicronics.StarIOSDK package.
MiniPrinterFunctions.java = Star Portable printers
Printer Functions = Star POS Desktop printers
5. Don’t execute the application yet. Section VI covers setting up a run environment.
VI. Running Applications
There are two ways you can run your Android application:
A. Physically on an Android Device with USB port (recommended)
B. Using emulator on PC (Printer connection isn’t supported. GUI support only.)
This document shows how to set up both.
Running Applications: Using a Physical Android Device (Recommended)
You need three things to run applications directly on an Android device:
A. USB Windows driver from the Android device manufacturer
B. Mark application as Debuggable in manifest
C. Set up Android device
1. (Requirement A) Install USB driver for the Android device and connect it to the PC. If the device doesn’t have a driver CD, search Google.. The Android Developer site has a list of drivers, but it may be outdated: http://developer.android.com/sdk/oem-usb.html
2. (Requirement B) In Eclipse, click “AndroidManifest.xml” in left column. Click the “Application” tab at the bottom. Set
Debuggable to “true”. Save.
3. (Requirement C) On your Android, touch Settings. Put a check mark next to “Unknown sources” (allows you to run apps not found on the Market). Then, touch “Development”. Put check marks next to “USB debugging”, “Stay awake”, and “Allow mock locations”.
4. Done. When you execute an application from Eclipse, it will automatically install and run on your Android device.
Troubleshooting Sample Program Run Problems
If you have trouble running sample application, see below…
1. “Re-installation failed due to different application signatures.”
Problem: If you change PCs in the future and try to install same application on your Android, you may get this error.
Solution: You need to remove the app from the Android. Touch Settings > Applications > Manage Applications > [name of app that will not compile]. Delete it completely. Run the program again from Eclipse.
2. “ERROR: Application requires API version XX. Device API version is X (Android
Problem: Sample application was set to minimum API version. Your Android device is lower than that version.
Solution: You need to change the minimum API version to be compatible with your tablet. This is done in two steps using
2a. Right click on project name. Select Properties.
2b. Click Android. Select the API version compatible with your device. You can see the API version required in the error line.
2c. Open the Manifest.
2d. Click “Manifest” tab on bottom.
2e. Click “Uses Sdk”.
2f. Type API version of your Android device. (Remember: You can see the API version required in error line.)
Running Applications: Android Emulator
You can run your application on an emulator, but printer communication via Bluetooth will not work.
1. Open Android SDK Manager. Click “Virtual devices” in left column. Then, click “New”.
2. Type a name and choose target.
3. Create AVD
4. The virtual device appears.
5. Open Eclipse and execute your application. It will take some time for the emulator to load.
6. This screen will appear for quite some time.
7. Finally, click the “Menu” button on the right and the application will appear.
Depending on internet connection, you might have problems installing the ADT Plugin. If you cannot download, try this.
1. Open SDK Manager. Click “Settings” in left column. Then, check “Force https://...”.
If this does not work…
1. Uncheck “Force https://...”.
2. Change repository URL in Eclipse to “http://…” (no ‘s’).
If you still have trouble…
You can download the package on your own here: http://developer.android.com/sdk/eclipse-adt.html#troubleshooting
Star Micronics is a global leader in the manufacturing of small printers. We apply over 50 years of knowhow and innovation to provide elite printing solutions that are rich in stellar reliability and industry-respected features. Offering a diverse line of Thermal, Hybrid, Mobile, Kiosk and Impact Dot Matrix printers, we are obsessed with exceeding the demands of our valued customers every day.
We have a long history of implementations into Retail, Point of Sale, Hospitality, Restaurants and Kitchens, Kiosks and
Digital Signage, Gaming and Lottery, ATMs, Ticketing,
Labeling, Salons and Spas, Banking and Credit Unions,
Medical, Law Enforcement, Payment Processing, and more!
High Quality POS Receipts, Interactive Coupons with Triggers,
Logo Printing for Branding, Advanced Drivers for Windows,
Mac and Linux, Complete SDK Packages, Android, iOS,
Blackberry Printing Support, OPOS, JavaPOS, POS for .NET,
Eco-Friendly Paper and Power Savings with Reporting Utility,
ENERGY STAR, MSR Reading, futurePRNT, StarPRNT… How can Star help you fulfill the needs of your application?
Don’t just settle on hardware that won’t work as hard as you do. Demand everything from your printer. Demand a Star!
Star Micronics Worldwide
Star Micronics Co., Ltd.
Shimizu-ku, Shizuoka 424-0066
Star Micronics America, Inc.
1150 King Georges Post Road
Edison, NJ 08837
Star Micronics EMEA
Peregrine Business Park, Gomm Road
High Wycombe, Buckinghamshire HP13 7DL
Star Micronics Southeast Asia Co., Ltd.
Room 2902C. 29th Fl. United Center Bldg.
323 Silom Road, Silom Bangrak, Bangkok 10500
+66-2-631-1161 x 2 http://www.starmicronics.co.th/
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project