- Set compileSdkVersion 17
- Set minSdkVersion 8
- Add these lines in both build.gradle files of your imported modules:
android {
defaultConfig { ... }
sourceSets {
main {
jni.srcDirs = []
}
| package com.example.myapplication; | |
| import android.content.Context; | |
| import android.graphics.Bitmap; | |
| import android.graphics.Canvas; | |
| import android.graphics.drawable.Drawable; | |
| import android.util.Log; | |
| import androidx.core.content.ContextCompat; |
| package catvinhquang.androiddeveloper; | |
| import android.app.Activity; | |
| import android.content.Context; | |
| import android.os.Bundle; | |
| import android.support.annotation.NonNull; | |
| import android.support.v4.view.PagerAdapter; | |
| import android.support.v4.view.ViewPager; | |
| import android.util.DisplayMetrics; | |
| import android.view.Gravity; |
| package catvinhquang.androiddeveloper; | |
| import android.animation.ValueAnimator; | |
| import android.content.Context; | |
| import android.graphics.Canvas; | |
| import android.graphics.Paint; | |
| import android.support.annotation.Nullable; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.util.AttributeSet; |
| package catvinhquang.myapplication; | |
| import android.app.Activity; | |
| import android.content.SharedPreferences; | |
| import android.os.Bundle; | |
| import android.os.StrictMode; | |
| import android.preference.PreferenceManager; | |
| public class MainActivity extends Activity { |
android {
defaultConfig { ... }
sourceSets {
main {
jni.srcDirs = []
}
| Index: .gitignore | |
| IDEA additional info: | |
| Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
| <+>UTF-8 | |
| =================================================================== | |
| --- .gitignore (revision 75d782181e1b48b73223892c9b8b4b1cf4c10dfd) | |
| +++ .gitignore (date 1537440316000) | |
| @@ -3,8 +3,6 @@ | |
| build/ | |
| obj/ |
| package catvinhquang.enablegps; | |
| import android.Manifest; | |
| import android.app.Activity; | |
| import android.content.Intent; | |
| import android.content.pm.PackageManager; | |
| import android.location.Location; | |
| import android.os.Bundle; | |
| import android.os.Looper; | |
| import android.support.annotation.NonNull; |
| 1- Create new project: npm init | |
| 2- Install package: npm install package_name | |
| 3- Run app: node js_file_name |
| adb shell input keyevent KEYCODE_MENU |
| # Fix 2 bugs below | |
| # Bug 1: Could not connect to development server... | |
| # Bug 2: Unable to load script from assets 'index.android.bundle'... | |
| # Ref: https://stackoverflow.com/questions/22475849/node-js-error-enospc/32600959#32600959 | |
| # Open Terminal and run lines below | |
| echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p | |
| react-native start |