3/11/2019

How to convert a website to an Android application in 2019 part 2

Adding Splash Screen and Push notification button to android application

Adding Splash Screen on the android application

See How to convert a website to an android App part 1


1. Go to res>>>drawable>>.Righ Click>>>Show Explorer add your splash image inside drawable folder. this is splash image you prepared in Step 2 part one.



2. Go to app > res > drawable, right click the drawable folder and go new > Drawable resource file and name it launch_screen and click ok.


Add below code launch_screen


 launch_screen.xml



3. Go to>>> app >> res > values > styles.xml
<resources>

  add

 <style name=”AppTheme.Launcher”>
      <item name=”android:windowBackground”>@drawable/launch_screen</item>
    </style>


 under this code
        <item name="colorAccent">@color/colorAccent</item>
    </style>


styles.xml will look like below 




4 app > manifests > AndroidManifest.xml, line android:theme="@style/AppTheme and add (.Launcher) as seen below

AndroidManifest.xml




5. Activate new post notifications on your android app.


Held to firebase and create new project and follow the instruction.
Download .jason file that you will include in your app folder.
Click to change app to projects



Go to Project>>Zombie>>app>>Right Click>>Show in Explorer past the .jason file in side folder
Go back to firebase and click next.




 Project-level build.gradle

You add  this code      
        classpath 'com.google.gms:google-services:4.0.1'
below this code
classpath 'com.android.tools.build:gradle:3.2.0'

as in the picture


Or copy and replace all  Project-level build.gradle from below box




App-level build.gradle
You add these code
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-messaging:17.3.3'


below androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
as in picture below


Or copy and replace all  App-level build.gradle from below box



6. Open MainActivity, right click the domain folder > new > Java Class and name it MyFirebaseMessagingService


MyFirebaseMessagingService


7.  Open MainActivity, right click the domain folder > >new >> Java Class and this time name it MyFireBaseInstanceIDService.



MyFireBaseInstanceIDService



8 You have to add the full MainActivity.java code below

 

 

How to convert a website to an Android app Part 1 and How to convert a website to an Android app Part 2

Watch How to convert a website to an Android application in 2019 video here. 

 

No comments:

Post a Comment