How to make GIF Splash Screen in Android Studio


Insert this into build.gradle (Module:app)

dependencies {
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.4'
}

Insert this into build.gradle (Project:)

buildscript {
    repositories {
        mavenCentral()
    }
}
allprojects {
    repositories {
        mavenCentral()
    }
}

Now go to res>layout>activty_splash_screen.xml

<pl.droidsonroids.gif.GifImageView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:src="@drawable/mygif"
    />

Splash_scree.java

Place it in the onCreate method

 Thread timer = new Thread(){
            public void run(){
                try{
                    sleep(5000);   // set the duration of splash screen
                }
                catch(InterruptedException e){
                    e.printStackTrace();
                } finally {
                    Intent intent = new Intent(Splash_screen.this, MainActivity.class);
                    startActivity(intent);
                }
            }
        };
        timer.start();

Place it outside the onCreate method

 @Override
    protected void onPause() {
        super.onPause();
        finish();
    }
 

    

Display for Arduino – Use Smartphone as a monitor for arduino with usb cable

DisplayDisplay for Arduino , helps you to visualize data on your smartphone with simplest serial communication using usb cable .Arduino is easy to use you can simply use Serial.print() or Serial.write() command to print data on the app.

App Name : Display for Arduino
A
pp Link : https://play.google.com/store/apps/details?id=plutoapps.arduinodisplayotg

Advantages of data visualization
• Data Monitoring
• Detection of errror
Arduino microcomputer is really easy and becoming need of every electrical engineer now a days .
Using hardware lcd with arduino is difficult , one has to do connection and write the cumbersome code .

Working :
Doesn’t matters whether you  are using a sensor or not , you can simply print the data on the smartphone with simply using Serial.print() or Serial.write().
Example :

Using Analog Sensor :
If you want to show output of analog sensor you can use analogRead(PIN) to get the sensor value store it in a some variable ( let say ) x .
Now break down values x into units,tens,hundreads,thousands .


Example Showing Analog Sensor Values :

x=analogRead(A0);
ones = (x%10);
tens = ((x/10)%10);
hundreds = ((x/100)%10);
thousands = (x/1000);

Use some delay to print , minimum delay that can be use for this app can be 50ms ,data integrity will be lost by using smaller delay than 50ms . Higher delay than 50ms is recomended to show the data properly.
Code For Showing Potentiometer Data :

int ones,tens,hundreds,thousands,x;
void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
pinMode(A0,INPUT);
}
void loop() {
  // put your main code here, to run repeatedly:
x=analogRead(A0);
ones = (x%10);
tens = ((x/10)%10);
hundreds = ((x/100)%10);
thousands = (x/1000);
delay(1000);
Serial.print(hundreds);
delay(100);

Serial.print(tens);
delay(100);

Serial.print(ones);
delay(200);

Serial.print('\n');
delay(300);

}

Showing Keypad Numbers :
Showing keypad values on smartphone using this app is very simple just write Serial.print(Key) in arduino to print particular key on the screen .

Keypad Interfacing with Arduino :

Steps:

  • Connect rows pinout of the keypad to the 5,4,3,2 digital pins of the arduino
  • Connect column pinout of the keypad to the 8,7,,6 digital pins of the arduino

Keypad Code : 

First add Keypad library to your Arduino IDE
You can download the library from here keypad

#include 
char key;
const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}
};
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup(){
  Serial.begin(9600);
}
void loop(){
   key = keypad.getKey();
 if (key != NO_KEY){
 
    Serial.print(key);
  delay(50);
  }
}

You May Also Like

About the Author: quzal

3 Comments

  1. Greetings from California! I’m bored to death at work so I decided to check out your website on my iphone during lunch break. I love the information you present here and can’t wait to take a look when I get home. I’m shocked at how quick your blog loaded on my mobile .. I’m not even using WIFI, just 3G .. Anyhow, good blog!

Leave a Reply

Your email address will not be published. Required fields are marked *