How to Create an APK

20
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: o A TestFlight developer account (Sign up here ) o The latest TestFlight Android SDK release o ADT (Android Developer Tools) Bundle Creating the Basic Application:

description

apk

Transcript of How to Create an APK

Page 1: How to Create an APK

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:

o A TestFlight developer account (Sign up here)

o The latest TestFlight Android SDK release

o ADT (Android Developer Tools) Bundle

Creating the Basic Application:

Page 2: How to Create an APK

1. Launch Eclipse from the ADT Bundle (adt-bundle-

<os_platform>/eclipse/ directory).

2. Create a new Android Application Project.

Page 3: How to Create an APK

3. Fill in the New Android Application form.

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

Page 4: How to Create an APK
Page 5: How to Create an APK
Page 6: How to Create an APK

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.

Page 7: How to Create an APK

Integrating the TestFlight Android SDK

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

Page 8: How to Create an APK

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

the libsdirectory.

Page 9: How to Create an APK

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

Page 10: How to Create an APK

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.

Page 11: How to Create an APK

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". 7. import android.app.Application; 8. import com.testflightapp.lib.TestFlight; 9. 10. public class MyApplication extends Application { 11. @Override

Page 12: How to Create an APK

12. public void onCreate() { 13. super.onCreate(); 14. //Initialize TestFlight with your app token. 15. TestFlight.takeOff(this, "YOUR_APP_TOKEN"); 16. } 17. }

Page 13: How to Create an APK

18. Update the AndroidManifest.xml file to point to the MyApplication class and grant

the permissions INTERNET and ACCESS_NETWORK_STATE. 19. <manifest ...> 20. <application ... android:name="MyApplication"> 21. ... 22. </application> 23. <uses-permission android:name="android.permission.INTERNET"/> 24. <uses-permission

android:name="android.permission.ACCESS_NETWORK_STATE"/> 25. </manifest>

Page 14: How to Create an APK

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.

Page 15: How to Create an APK

Signing with a Debug Certificate:

1. Go to File > Export.

Page 16: How to Create an APK

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

Page 17: How to Create an APK

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.

Page 18: How to Create an APK
Page 19: How to Create an APK

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

Page 20: How to Create an APK

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.