Mobile Development - atabegruslan/Notes GitHub Wiki
- Comparison of technologies: https://academind.com/tutorials/react-native-vs-flutter-vs-ionic-vs-nativescript-vs-pwa/
- https://www.youtube.com/playlist?list=PLgCYzUzKIBE_cyEsXgIcwC3P8ipvlSFd_ (Firebase)
- https://www.youtube.com/playlist?list=PLrnPJCHvNZuARS1W7qMt-zxBNqWYZpOg6 (animation)
- https://www.youtube.com/playlist?list=PLgCYzUzKIBE_ZuZzgts135GuLQNX5eEPk (test)
- https://www.youtube.com/playlist?list=PLgCYzUzKIBE-xYch_APQy_wR9JBlnp9Hg (test)
- https://www.raywenderlich.com/817602-mvi-architecture-for-android-tutorial-getting-started (MVI)
https://github.com/atabegruslan/Notes/blob/main/notes/android/complete_uninstall.pdf
- Enable Developer options on Android phone: Settings, About phone, tap Build number 7 times.
- Enable USB debugging: Settings, Developer options, turn this on, turn on Stay awake, turn on USB debugging.
- Connect device: Press Allow on phone. Set to the appropriate USB connect options on phone. Download necessary drivers if needed.
If you cant see your phone there or in AndroidStudio's Select Deployment Target window, the most likely cause is the driver.
Start, Device Manager: If you see "other devices" with ADB Interface and Android Samsung under it with exclaimation icons beside them, then do:
-
https://uptodrivers.com/samsung-galaxy-a01-usb-driver-free-download/90393/ (I have Samsung A01)
-
https://uptodrivers.com/android-usb-driver/ (Get Google USB Driver in Android Package Manager > SDK tools)
-
https://uptodrivers.com/adb-usb-drivers-free-download/ (NEED ADB Driver)
- https://www.youtube.com/watch?v=171KC_K3W4E (Have to manually install ADB Driver)
- https://developer.samsung.com/mobile/android-usb-driver.html (Get Android driver)
-
https://uptodrivers.com/adb-usb-drivers-free-download/ (NEED ADB Driver)
-
https://uptodrivers.com/android-usb-driver/ (Get Google USB Driver in Android Package Manager > SDK tools)
Manually install ADB Driver:
- Device Manager
- Right click on faulty ADB interface
- Update Driver Software
- Browse computer
- Pick from a list of device drivers
- Select the android_winusb.inf in the unzipped ADB driver that was downloaded from https://dl-ssl.google.com/android/repository/latest_usb_driver_windows.zip
- Install
android.* : packages that are bundled with the Android operating system
androidx.* : packages that are packaged with your app's APK
https://stackoverflow.com/questions/51280090/what-is-androidx
AndroidX
= Existing support libraries (re-organized) + JetPack
. (JetPack
is made of androidx.*
libraries.)
- https://developer.android.com/topic/libraries/support-library
- https://developer.android.com/jetpack
- https://stackoverflow.com/questions/50251658/what-exactly-is-android-jetpack
- https://github.com/atabegruslan/Notes/blob/main/notes/android/storage_options.pdf
- eg: Write to SD Card folder:
File sdCard = Environment.getExternalStorageDirectory();
File dir = new File (sdCard.getAbsolutePath() + "/dir1/dir2");
dir.mkdirs();
File file = new File(dir, "filename");
FileOutputStream f = new FileOutputStream(file);
- https://www.youtube.com/watch?v=3tzEcB-GOKI
- https://www.youtube.com/watch?v=JiTn9wsiGsc
- https://www.gizbot.com/how-to/tips-tricks/how-to-find-your-phone-s-screen-density-value-043500.html
- https://blog.prototypr.io/designing-for-multiple-screen-densities-on-android-5fba8afe7ead
- https://stackoverflow.com/questions/2025282/what-is-the-difference-between-px-dip-dp-and-sp#:~:text=The%20conversion%20of%20dp%20units,on%20screens%20with%20different%20densities.&text=dp%20is%20dip%20.
- https://stackoverflow.com/questions/18077325/scale-image-to-fill-imageview-width-and-keep-aspect-ratio
- https://stackoverflow.com/questions/7506230/set-position-size-of-ui-element-as-percentage-of-screen-size
Just like Java runs on JVM, Android runs on Dalvik VM.
Android's DexCode is like Java ByteCode
https://github.com/atabegruslan/Notes/tree/main/notes/android/Gradle
Build Type: debug, release
Flavour: eg: Free, paid
Build variants: Build Types & Flavours.
- https://wajahatkarim.com/2018/04/difference-between-build-type-flavour-and-build-variant-in-android/
- https://developer.android.com/studio/build/build-variants
App components are the essential building blocks of an Android app.
Each component is an entry point through which the system or a user can enter your app.
Some components depend on others.
- Activities - With UI, foreground.
- Services - Can block, same thread. No UI, Background. Can spawn a new thread within a service. Used for eg polling, play music, DB CRUD.
- Thread - Don't block. Foreground or background. Preferably use if delay is >=2s. (If >5s, OS will prompt to kill)
- Broadcast receivers - Listen for an broadcast intent (like the phone ringing, or an SMS is received)
Content providers - In front of DB/storage.
Intent: A messaging object. It requests an action to be performed by another app component.
Intent Filter: Tells app's components (eg activity) which intent to respond to.
Other apps can potentially start that activity with the right intent.
https://stackoverflow.com/questions/6578051/what-is-an-intent-in-android/1
- Explicit intent - Component to Component.
- Implicit intent - Component into another app, eg send mail.
- Pending intent - Component into another app. The other app can exec it in the future, even if the calling component is gone. The other app exec it with the same permissions.
IntentService - related to Service on a different thread.
https://github.com/atabegruslan/Notes/blob/main/notes/android/intent_service.pdf
- https://github.com/atabegruslan/Notes/blob/main/notes/android/context.pdf
- https://medium.com/susheel-karam/different-ways-to-get-context-in-android-8018d9663292
ViewGroup is subclass of View. Views can hold Views and ViewGroups.
ViewGroups are Layouts.
Widgets extends View. Widgets are eg Button, TextView, etc...
Lock Screen Orientation - in manifest
: android:screenOrientation="portrait"
<string-array name="xxx"><item>string1</item>
can be used in strings.xml
to store a long array. Java arrays are used to store short arrays.
Linear Layout - forms
Relative Layout - all view pos rel to each other
Table Layout - table. Cant scroll
GridView - two-dimensional, scrollable grid. Thumbnail gallery. Adapter pull content into this view
ListView - scrollable items. eg menu. Adapter pull content into this view
AbsoluteLayout enables you to specify the exact location of its children.
FrameLayout is a placeholder on screen that you can use to display a single view.
TabLayout - 1 activity many panes
DexGuard and ProGuard are for obfuscation
https://www.guardsquare.com/en/blog/proguard-vs-dexguard
- https://coderwall.com/p/r09hoq/android-generate-release-debug-keystores
- https://stackoverflow.com/questions/55199078/difference-between-google-api-debug-and-release-keys
- https://developer.android.com/studio/publish/preparing
- https://developer.android.com/studio/publish/app-signing
- https://github.com/Ruslan-Aliyev/Travel-Blog-Android#for-google-signin-sha1-certificate-fingerprint
Hardware Accelerated Execution Manager, accelerates emulator.
https://github.com/atabegruslan/Notes/blob/main/notes/android/haxm.pdf