Thursday, 31 March 2016

Create Hello-JNI with Android Studio


2Create Java Sample App

  1. Find and start Android Studio on your development system:
  • Linux: Run from your installed location
  • OSX:  Find studio installation in Application folder, double click to start
If this is the first time you run this version of Android Studio on this system, Android Studio will prompt to import from previous settings, just select “I do not have a previous version of Studio or I do not want to import my settings”, “Welcome to Android Studio” will be displayed.
  1. Select “Start a new Android Studio project”.
  1. On “New Project” page,  change “Application Name” to HelloAndroidJni, and leave the default values for other fields.
  2. Click “Next” all the way to “Finish” to complete application creation.
    This creates an Android “Hello World” Java app; your Android Studio looks like:
  3. (Optional) Connect your Android Device with USB cable if you have device available; otherwise, create an Emulator when Android Studio prompts you in the next step.
  1. Sync , Build  and Run , you will see the following on your target device or Emulator:
  2. Configure the project to use gradle wrapper.
    a) On Mac OS, menu “Android Studio” > “Preferences”.
    b) On Linux, menu “File” > “Settings”.
    c) Then “Build, Execution, Deployment” > “Build Tools” > “Gradle”.
    d) Select “Use Default Gradle wrapper (recommended)”, click “OK”.
  1. Sync , Build  and Run , you should see the same as in step 6.

No comments:

Post a Comment