Read Article
Loading...

Recent Post

Free Source Code Android Splash Screen

Free Source Code Android Splash Screen


FREE SOURCE CODE - How to implement Android Splash Screen in your application. Tutorial about implementing android splash screen in your application will your help to make your app very nice. This is the full code for the splash screen. I will keep on adding stuff to it as I explain and also learn. So it isn't the complete thing.

Free Source Code How to implement Android Splash Screen

In this tutorial we are going to learn how to implement splash screen in your android application. you will learn how to implement a Splash Screen in your Android application.

Splash.java
package alfarobi.android;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;
public class Splash extends Activity {
private static String TAG = Splash.class.getName();
private static long SLEEP_TIME = 5; // Sleep for some time
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE); // Removes title bar
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN); // Removes notification bar
setContentView(R.layout.splash);
// Start timer and launch main activity
IntentLauncher launcher = new IntentLauncher();
launcher.start();
}
private class IntentLauncher extends Thread {
@Override
/**
* Project by Effand Nozh | wa: +6285649905055 | effands@gmail.com
* Sleep for some time and than start new activity...
*/
public void run() {
try {
// Sleeping
Thread.sleep(SLEEP_TIME * 500);
} catch (Exception e) {
Log.e(TAG, e.getMessage());
}
// Start main activity
Intent intent = new Intent(Splash.this, MainActivity.class);
Splash.this.startActivity(intent);
Splash.this.finish();
}
}
}

Splash.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#020202"
    android:gravity="center_vertical|center_horizontal"
    android:orientation="vertical" >
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical|center_horizontal"
        android:background="@drawable/logorgm"
        tools:ignore="ContentDescription" />
</LinearLayout>
Happy Creating a Splash Screen

Download Android Streaming Radio Source Code

Download Android Streaming Radio Source Code

Mobile Weaver Download Android Streaming Radio Source Code FREE !!. How to Create android apps and free source code radio online. You need a streaming radio android source code, here I will share it for free for you . there are some things you need to prepare them eclipse, Android SDK, Emulator and coffee :)

Download Android Streaming Radio Source Code

Radio Streaming Applications currently used for radio endengarkan for free via smartphone. The advantage is that it can be heard anywhere, anytime, provided they are covered by an internet signal. This android application you can run on your smartphone, or you can edit it first from the display, text and various functions. if you want to add AdMob ads please contact us.

Source code MainActivity:
package alfarobi.android;
import alfarobi.android.irc.IRCService;
import alfarobi.android.media.mediaplayer.IMediaPlayerServiceClient;
import alfarobi.android.media.mediaplayer.MediaPlayerService;
import alfarobi.android.media.mediaplayer.MediaPlayerService.MediaPlayerBinder;
import alfarobi.android.media.mediaplayer.StatefulMediaPlayer;
import alfarobi.streamStation.StreamStation;
import alfarobi.streamStation.StreamStationSpinnerAdapter;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.ActivityManager.RunningServiceInfo;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.util.Log;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.Spinner;
import android.widget.ToggleButton;
/*Modification By : Effand Nozh*/
public class MainActivity extends Activity implements IMediaPlayerServiceClient {
private StatefulMediaPlayer mMediaPlayer;
private StreamStation mSelectedStream = CONSTANTS.DEFAULT_STREAM_STATION;
private MediaPlayerService mService;
private boolean mBound;
private ProgressDialog mProgressDialog;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
bindToService();
mProgressDialog = new ProgressDialog(this);
initializeButtons();
setupStationPicker();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main_activity_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
switch (item.getItemId()) {
case R.id.menuChat:
showChatActivity();
return true;
case R.id.menuAbout:
showAboutActivity();
return true;
case R.id.menuClose:
shutdownActivity();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
private void showChatActivity() {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setClassName(this, SMS.class.getName());
startActivity(intent);
}
private void showAboutActivity() {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setClassName(this, AboutActivity.class.getName());
startActivity(intent);
}
public void kirimsms(View v) {
Intent i = null;
i = new Intent(this, SMS.class);
startActivity(i);
}
public void exit(View v) {
if (mBound) {
mService.stopMediaPlayer();
// Detach existing connection.
unbindService(mConnection);
mBound = false;
}
Intent intent = new Intent(this, MediaPlayerService.class);
stopService(intent);
intent = new Intent(this, IRCService.class);
stopService(intent);
finish();
}
/**
* Binds to the instance of MediaPlayerService. If no instance of
* MediaPlayerService exists, it first starts a new instance of the service.
*/
public void bindToService() {
Intent intent = new Intent(this, MediaPlayerService.class);
if (mediaPlayerServiceRunning()) {
// Bind to Service
bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
}
// no instance of service
else {
// start service and bind to it
startService(intent);
bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
}
}
/**
* Project by Effand Nozh | http://eftutor.blogspot.com | effand@ymail.com
* Sets up the stationPicker spinner
*/
public void setupStationPicker() {
Spinner stationPicker = (Spinner) findViewById(R.id.stationPicker);
StreamStationSpinnerAdapter adapter = new StreamStationSpinnerAdapter(
this, android.R.layout.simple_spinner_item);
// populate adapter with stations
for (StreamStation st : CONSTANTS.ALl_STATIONS) {
adapter.add(st);
}
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
stationPicker.setAdapter(adapter);
stationPicker.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view,
int pos, long id) {
StreamStation selectedStreamStation = (StreamStation) parent
.getItemAtPosition(pos);
if (selectedStreamStation != mSelectedStream) {
mService.stopMediaPlayer();
mSelectedStream = selectedStreamStation;
mService.initializePlayer(mSelectedStream);
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
// Do nothing.
}
});
}
/**
* Initializes buttons by setting even handlers and listeners, etc.
*/
private void initializeButtons() {
// PLAY/PAUSE BUTTON
final ToggleButton playPauseButton = (ToggleButton) findViewById(R.id.playPauseButton);
playPauseButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (mBound) {
mMediaPlayer = mService.getMediaPlayer();
// pressed pause ->pause
if (!playPauseButton.isChecked()) {
if (mMediaPlayer.isStarted()) {
mService.pauseMediaPlayer();
}
}
// pressed play
else if (playPauseButton.isChecked()) {
// STOPPED, CREATED, EMPTY, -> initialize
if (mMediaPlayer.isStopped()
|| mMediaPlayer.isCreated()
|| mMediaPlayer.isEmpty()) {
mService.initializePlayer(mSelectedStream);
}
// prepared, paused -> resume play
else if (mMediaPlayer.isPrepared()
|| mMediaPlayer.isPaused()) {
mService.startMediaPlayer();
}
}
}
}
});
}
/**
* Defines callbacks for service binding, passed to bindService()
*/
private ServiceConnection mConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName className,
IBinder serviceBinder) {
Log.d("MainActivity", "service connected");
// bound with Service. get Service instance
MediaPlayerBinder binder = (MediaPlayerService.MediaPlayerBinder) serviceBinder;
mService = binder.getService();
// send this instance to the service, so it can make callbacks on
// this instance as a client
mService.setClient(MainActivity.this);
mBound = true;
// Set play/pause button to reflect state of the service's contained
// player
final ToggleButton playPauseButton = (ToggleButton) findViewById(R.id.playPauseButton);
playPauseButton.setChecked(mService.getMediaPlayer().isPlaying());
// Set station Picker to show currently set stream station
Spinner stationPicker = (Spinner) findViewById(R.id.stationPicker);
if (mService.getMediaPlayer() != null
&& mService.getMediaPlayer().getStreamStation() != null) {
for (int i = 0; i < CONSTANTS.ALl_STATIONS.length; i++) {
if (mService.getMediaPlayer().getStreamStation()
.equals(CONSTANTS.ALl_STATIONS[i])) {
stationPicker.setSelection(i);
mSelectedStream = (StreamStation) stationPicker
.getItemAtPosition(i);
}
}
}
}
@Override
public void onServiceDisconnected(ComponentName arg0) {
mBound = false;
mService = null;
}
};
/**
* Determines if the MediaPlayerService is already running.
*
* Project by Effand Nozh | http://eftutor.blogspot.com | effand@ymail.com
* @return true if the service is running, false otherwise.
*/
private boolean mediaPlayerServiceRunning() {
ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
for (RunningServiceInfo service : manager
.getRunningServices(Integer.MAX_VALUE)) {
if ("alfarobi.android.media.mediaplayer.MediaPlayerService"
.equals(service.service.getClassName())) {
return true;
}
}
return false;
}
public void onInitializePlayerSuccess() {
mProgressDialog.dismiss();
final ToggleButton playPauseButton = (ToggleButton) findViewById(R.id.playPauseButton);
playPauseButton.setChecked(true);
}
public void onInitializePlayerStart() {
mProgressDialog = ProgressDialog.show(this,
"Please Wait...",
"loading...", true);
mProgressDialog.getWindow().setGravity(Gravity.CENTER);
mProgressDialog.setCancelable(true);
mProgressDialog.setOnCancelListener(new OnCancelListener() {
@Override
public void onCancel(DialogInterface dialogInterface) {
MainActivity.this.mService.resetMediaPlaer();
final ToggleButton playPauseButton = (ToggleButton) findViewById(R.id.playPauseButton);
playPauseButton.setChecked(false);
}
});
}
@Override
public void onError() {
mProgressDialog.cancel();
}
/**
* Project by Effand Nozh | http://eftutor.blogspot.com | effands@gmail.com
* Closes unbinds from service, stops the service, and calls finish()
*/
public void shutdownActivity() {
if (mBound) {
mService.stopMediaPlayer();
// Detach existing connection.
unbindService(mConnection);
mBound = false;
}
Intent intent = new Intent(this, MediaPlayerService.class);
stopService(intent);
intent = new Intent(this, IRCService.class);
stopService(intent);
finish();
}
@Override
public void onDestroy() {
super.onDestroy();
if (mBound) {
mService.unRegister();
unbindService(mConnection);
mBound = false;
}
}
public void onBackPressed() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("putar mode background...")
.setCancelable(false)
.setPositiveButton("Yes",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
finish();
}
})
.setNegativeButton("No",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int arg1) {
// TODO Auto-generated method stub
dialog.cancel();
}
}).show();
}
}

If you are interested to try it out please click the link below...
Download Source Code Android Radio Streaming

Mobile Android Weaver

Mobile Android Weaver

Android Weaver Blog - Download Aplikasi, Tips Triks Android, Download APK Gratis, Download Source Code Android. Berbagi script dan tutorial tentang Android secara Global dan tidak bertele-tele. Blog Android Weaver ini akan menyajikan tutorial-tutorial yang sudah banyak di share di Internet dan dikumpulkan lagi disini. Jadi sebagian Artikel nantinya adalah hasil copy yang akan ditulis ulang dan akan di publish disini.
Android Weaver Blog - Download Aplikasi, Tips Triks Android

Anda Developer Android bisa berbagi Info disini, bisa menyumbang article dan source code yang mungkin akan berguna bagi rekan-rekan pecinta android yang lain.

Android Weaver, media Download Aplikasi Android dan Share Tutorial. Download Free Source Code, Tutorial, Programming Android, Java, AdMob, and Explorer all Mobile.

Copyright © 2013 Mobile Weaver All Right Reserved