How to create an APK (ADT Bundle)

Last Updated: Sep 04, 2013 04:39PM PDT
With the ADT (Android Developer Tools) Bundle, Google has made it easy for new developers to create Android apps. The ADT Bundle includes the essential Android SDK components and a version of the Eclipse IDE with built-in ADT (Android Developer Tools). This tutorial will walk you through creating a basic Android application, integrating the TestFlight Android SDK, and signing an Android application.

Requirements:


​Creating the Basic Application:

  1. Launch Eclipse from the ADT Bundle (adt-bundle-<os_platform>/eclipse/ directory).
  2. Create a new Android Application Project.

  3. Fill in the New Android Application form.


  4. Leave the default settings in the Configure Project and Configure Launcher Icon windows.
     ​

  5. Select Blank Activity and then click Finish.


  6. Your Android project is now set up with some default files and you’re ready to run your HelloWorld app on a real device or Android Emulator.


Integrating the TestFlight Android SDK

  1. Download and unpack the TestFlight Android SDK ZIP file.

  2. Add TestFlightLib.jar as a dependency to your Android application by dragging TestFlightLib.jar into the libs directory.


  3. Confirm the TestFlightLib.jar move by selecting Copy files in the File Operation window.


  4. Create a new application class by selecting the package in the src directory and going to New > Class. 


  5. Enter the name of the application class in the Name field. For this example, use MyApplication as the application class.


  6. Import TestFlight into your main application class and call takeOff in the onCreate method of the MyApplication class, passing your unique app token. To get your app token, create or go to your app in the dashboard and click "App Token".
    import android.app.Application;  
    ​​import com.testflightapp.lib.TestFlight;
    
    public class MyApplication extends Application {
        @Override
        public void onCreate() {
            super.onCreate();
            //Initialize TestFlight with your app token.
            TestFlight.takeOff(this, "YOUR_APP_TOKEN");
        }
    ​}
    

  7. Update the AndroidManifest.xml file to point to the MyApplication class and grant the permissions INTERNET and ACCESS_NETWORK_STATE.
    <manifest ...>
        <application ... android:name="MyApplication">
    ​    ...
        </application>
        ​<uses-permission android:name="android.permission.INTERNET"/>
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    </manifest>
    


Generate and sign the APK:

​​The Android system requires that all installed applications be digitally signed with a certificate. Android applications can either be signed with a release certificate or debug certificate. You should sign your applications with a debug certificate while developing and testing in TestFlight. When you're ready to distribute a release build or publish on an application marketplace such as Google Play, you should sign your application with a release certificate.


Signing with a Debug Certificate:
  1. Go to File > Export.

  2. From the Export window, go to Android > Export Android Application.

    ​​
  3. Click Browse... and select the Android Application project to Export.

  4. Click Browse and select the debug.keystore. The default location for debug.key store on OSX is "/Users/<user>/.android/debug.keystore" and the password is "android". When you're ready to release your app to an application marketplace, you should use an existing keystore or create a new keystore.

  5. Select the "androiddebugkey" alias and use "android" as the password.

  6. Select a destination for the APK file and click Finish.

  7. You are now ready to upload and distribute the APK through TestFlight.

To learn more about the TestFlight Android SDK, please see the article here.
Support hours are 8am-6pm PST. Please send a detailed email if you are having issues. Thanks for using TestFlight!


Contact Support


support@testflightapp.com
http://assets02.desk.com/
false
testflightapp
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete