Free Projects developed by Java, C# and PHP

Image and Video Viewer app


We have many web application and mobile applications in GitHub for public use.

This project specifically developed to show how we can implement a simple 
android application to view Images and play sounds and videos in 
Android Studio with Java.

The project contains 4 main layouts described below:
	- Main Activity: is used as a home/landing page to show list of functions and options
	- Image Load Activity: is used to show how we can read and load pictures in android 
	  application by utilizing assets folder
	- Play Sound Activity: is used to show how we can easily play and stop any sound 
	  files stored in our application
	- Play Video Activity: is used to show how we can easily play and stop any video 
	  files stored in our application

--> PlaySoundActivity.java
============================================================================================
package nebiyou.imageandvideoviewer;

import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;

public class PlaySoundActivity extends AppCompatActivity {
    Button btnplayCheeringSound,btnplayinCorrectSound;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_play_sound);

        btnplayCheeringSound=(Button) findViewById(R.id.btnplayCheeringSound);
        btnplayinCorrectSound=(Button) findViewById(R.id.btnplayinCorrectSound);

    }

    public void BtnplayCheeringSound(android.view.View Button)
    {
        final SoundPlayer soundPlayer = new SoundPlayer(this);
        final Context context = this;
        Thread timerThread = new Thread(){
            public void run(){
                try{
                    sleep(2000);
                }
                catch(InterruptedException e){
                    e.printStackTrace();
                }
                finally{
                    soundPlayer.PlayCheeringSound();
                }
            }
        };
        timerThread.start();
    }

    public void BtnplayinCorrectSound(android.view.View Button)
    {
        final SoundPlayer soundPlayer = new SoundPlayer(this);
        final Context context = this;
        Thread timerThread = new Thread(){
            public void run(){
                try{
                    sleep(3000);
                }
                catch(InterruptedException e){
                    e.printStackTrace();
                }
                finally{
                    soundPlayer.PlayinCorrectSound();
                }
            }
        };
        timerThread.start();
    }
}