Posts

RoomDB

**ROOM DB** 1. Room is an Android Architecture component. 2. It provides an abstraction Layer over SQLite. 3. Easy caching of relavent piece of data. **Components of ROOM** 1. Entity : 1. An Entity Defines schema of database tables, Each table is defined by an entity. 2. Entity class is Annoted with @Entity. 3. It contains the getters and setters for the field of the database. 4. By default Room uses the class name as the tableName , If you want a table to have a different name, set the tableName property of the @Entity annotation. 5. By default Room uses the field names as the Column names in the database , If you want a column to have a different name, add the @ColumnInfo annotation to a field. 6. Entity class must have atleast 1 primary key. Example : @Entity(tableName = "User") //tableName value is case sensitive. class Users{ @PrimaryKey private String id; @ColumnInfo(name = "first_name") private String f...

Android

Android Architecture ================================== 1. Linux Kernal 2. Hardware Abstraction Layer 3. Native C/C++ Library along with ART 4. Java API framework 5. System Apps Application components ======================= 1. Application components are the essential building blocks of the application, 2. This components are loosely coupled from the manifest file, 3. AndroidManifest.xml describes each component of the application and how they interact 4. Basic Components : Activities,services,broadcastreciver,contentproviders,Notifications 5. Additional components: Fragments,views,Layouts,resources and manifest. Activities : ============ 1. Activity represents a single screen with an user interface. 2. One app can contain any number of activities all activities must be registered in the androidmanifest.xml file 3. To create an Activity we must create a class that Extends AppCompatActivity and overide onCreate() method Syntax: Class MyActivity Extends Appco...

Launch Modes in Android

Image
Consider Activity A, B, C, D is present where B will B Standard SingleTop SingleTask SingleInstance

How to Delete Commented code througout the project in Android Studio

Image
Step 1 : Press CTRL+SHIFT+R The below window will open Step 2 : Inside Text in find put this. (/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/)|(//.*) Note : The Above Regular Expression Deletes  Single Line  Comments  "//commented code" Block Code Comments  "/*commented code*/" XML code   Comments  "<!-------Your comment----->" Step 3 : Inside Replace with leave blank. Step 4 : Check Regular Expression with Right mark and in context select in Comments Step 5 : Inside Scope Select Whole Project - To Remove Comments In Whole Project Module - To remove only in Particular Module Directory - To remove In Particular Directory Step 6 :  Click Find. If you Have Any Query Please Comment Below or Drop a message in Chat Box. Thank You Happy Coding...:-)

How to Generate Key Hash for FaceBook Integration

Image
To Generate Key Hash we have 2 Ways Way 1 : ====== Just follow the below given Steps and you are done with this. Step I: Download OpenSSL from   here Step II: Download openssl-0.9.8e_X64.zip for 64 bit PC and openssl-0.9.8e_WIN32.zip for 32 bit PC Step III: once your download the zip folder. Go to C drive(where window is installed) and make a folder named OpenSSL Step IV: extract all zip file in this folder. Step V: Now go to Java folder and copy path of jre. For example: C:\Program Files\Java\jre1.8.0_101\bin (make sure your are in JRE folder not in JDK folder,) Step VI: Now open Cmd in your PC. Type Cd C:\Program Files\Java\jre1.8.0_101\bin Now copy the below code after this keytool -exportcert -alias androiddebugkey -keystore "C:\Users\Aravindraj\.android\debug.keystore" | "C:\openssl\bin\openssl" sha1 -binary |"C:\openssl\bin\openssl" base64 instead of Aravindraj you need to use your computer name. an...
Happy android

Crypto Exchanger