1- How to find SHA1 key?
Method 1:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
write above line in android studio terminal and press enter
Method 2:
If you are using android studio use simple step
- Run your project
- Click on Gradle menu
- Expand Gradle task tree
- Click on android -> signingReport and see the magic
- It will tell you everything
_______________________________________________________________________
2- Prerequisite for Android studio 2.1.2:
JDK version > 1.8
Set JDK path to 1.8: Project structure
Set Android SDK path: Project Structure
_______________________________________________________________________
3- Useful shortcut keys android studio:
Alt + insert ==> Generate options
ctrl + O ==> Override method
ctrl + win + alt + l ==> indentation of XML file
ctrl + / ==> Comment
_______________________________________________________________________
4- What is instant run?
With Instant Run, you can push changes to methods and existing app resources to a running app without building a new APK, so code changes are visible almost instantly.
_______________________________________________________________________
5- AVD stand for?
Android Virtual Device
_______________________________________________________________________
6- ID naming conventions XML:
button_save_<activity_or_layout_name>
button_cancel_<activity_or_layout_name>
_______________________________________________________________________
7- Online json editor:
http://www.jsoneditoronline.org/
_______________________________________________________________________
8- Splash Screen Android:
Android splash screen are normally used to show user some kind of progress before the app loads completely.
_______________________________________________________________________
9- WebView:
WebView to display HTML pages.
_______________________________________________________________________
10- SQLiteDatabase Path:
/data/data/<Package-Name>/databases/<DB-Name>.db
_______________________________________________________________________
11- What is Application Class in Android?
Introduction:
If we consider an apk file in our mobile, it is comprised of multiple useful blocks such as, Activities, Services and others.
These components do not communicate with each other regularly and not forget they have their own life cycle. Which indicate that they may be active at one time and inactive the other moment.
Requirements:
Sometimes we may require a scenario where we need to access a variable and its states across the entire Application regardless of the Activity the user is using, example is a user might need to access a variable that holds his personnel information like name that has to be accessed across the Application, we can use SQLite but creating a Cursor and closing it again and again is not good on performance, we could use Intents to pass the data but its clumsy and activity itself may not exist at a certain scenario depending on the memory-availability.
Uses of Application Class:
Access to variables across the Application, you can use the Application to start certain things like analytics etc. since the application class is started before Activities or Services are being run,
there is a overridden method called onConfiguration() changed that is triggered when the application configuration is changed (horizontal to vertical & vice-versa), there is also a event called onLowMemory() that is triggered when the Android device is low on memory.
_______________________________________________________________________
12- Conversion of Eclipse project into Android Studio project:
1) Open eclipse project folder
2) Open Project.properties file and remove last line
3) Open android studio and import eclipse project
4) Change app gradle and project gradle
5) Change Manifest (app tag, main tag)
6) Import module if any
7) Module path in app gradle
_______________________________________________________________________
13- Dropbox chooser API:
https://www.dropbox.com/developers/chooser#android
_______________________________________________________________________
14- Google Drive chooser API:
API:http://www.101apps.co.za/index.php/articles/android-apps-and-google-drive-a-tutorial.html
_______________________________________________________________________
15- GCM: Google Cloud Messaging
Send data from your server to your users' devices, and receive messages from devices on the same connection. The GCM service handles all aspects of queuing of messages and delivery to client applications running on target devices, and it is completely free.
Push messages from your back-end servers to tell your apps that there's new content for the user, or other data to sync.
FCM: Firebase cloud messaging (Updated form of GCM)
_______________________________________________________________________
16- Volley:
It integrates easily with any protocol and comes out of the box with support for raw strings, images, and JSON.
Volley is not suitable for large download or streaming operations, since Volley holds all responses in memory during parsing. For large download operations, consider using an alternative like DownloadManager.
By default all the volley network calls works asynchronously, so we don’t have to worry about using asynctask anymore.
_______________________________________________________________________
17- android:layout_padding vs android:layout_margin:
android:layout_margin:
Space outside the view between itself and its container is called margin.
android:layout_padding:
Space inside the view between its boundaries and content is called padding.
__________________________________________________________________________
18- Google Analytics integration in android app:
Google Analytics integration in android app:
https://developers.google.com/analytics/devguides/collection/android/v4/