Jumat, 04 April 2014

UI Automator Viewer

Android SDK provides the following tools to support automated, functional UI testing on your application:
  • uiautomatorviewer - A GUI tool to scan and analyze the UI components of an Android application.
  • uiautomator - A Java library containing APIs to create customized functional UI tests, and an execution engine to automate and run the tests.
Refer: http://developer.android.com/tools/testing/testing_ui.html

You can use the uiautomatorviewer tool to take a snapshot of the foreground UI screen on any Android device that is connected to your development machine. The uiautomatorviewer tool provides a convenient visual interface to inspect the layout hierarchy and view the properties of the individual UI components that are displayed on the test device. Using this information, you can later create uiautomator tests with selector objects that target specific UI components to test.

Dump View Hierarchy for UI Automator

UI Automator Viewer

Read More..
Refer to the exercises of "Simple example using YouTube Android Player API" and "YouTubeThumbnailView example", onInitializationFailure() methods will be called with YouTubeInitializationResult passed if fail in initialization.

If the error is is user-recoverable (isUserRecoverableError() == true), we can proceed by calling getErrorDialog(Activity, int), and then show this dialog to enable users to recover from this error.

Handle initialization error YouTube API Service

Modify MainActivity.java from last exercise "YouTubeThumbnailView example of YouTube Android Player API" to handle onInitializationFailure() for YouTubePlayer and YouTubeThumbnailView.
package com.example.androidyoutubeapiplayer;

import com.google.android.youtube.player.YouTubeBaseActivity;
import com.google.android.youtube.player.YouTubeInitializationResult;
import com.google.android.youtube.player.YouTubePlayer;
import com.google.android.youtube.player.YouTubePlayerView;
import com.google.android.youtube.player.YouTubePlayer.Provider;
import com.google.android.youtube.player.YouTubeThumbnailLoader;
import com.google.android.youtube.player.YouTubeThumbnailLoader.ErrorReason;
import com.google.android.youtube.player.YouTubeThumbnailView;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Toast;

public class MainActivity extends YouTubeBaseActivity implements
YouTubePlayer.OnInitializedListener, YouTubeThumbnailView.OnInitializedListener{

public static final String API_KEY = "AIzaSyCe6tORd9Ch4lx-9Ku5SQ476uS9OtZYsWA";
public static final String VIDEO_ID = "o7VVHhK9zf0";

private YouTubePlayer youTubePlayer;
private YouTubePlayerView youTubePlayerView;
private YouTubeThumbnailView youTubeThumbnailView;
private YouTubeThumbnailLoader youTubeThumbnailLoader;

private static final int RQS_ErrorDialog = 1;

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

youTubePlayerView = (YouTubePlayerView)findViewById(R.id.youtubeplayerview);
youTubePlayerView.initialize(API_KEY, this);

youTubeThumbnailView = (YouTubeThumbnailView)findViewById(R.id.youtubethumbnailview);
youTubeThumbnailView.initialize(API_KEY, this);
youTubeThumbnailView.setOnClickListener(new OnClickListener(){

@Override
public void onClick(View arg0) {
if(youTubePlayer != null){
youTubePlayer.play();
}
}});
}

@Override
public void onInitializationFailure(Provider provider,
YouTubeInitializationResult result) {

if (result.isUserRecoverableError()) {
result.getErrorDialog(this, RQS_ErrorDialog).show();
} else {
Toast.makeText(this,
"YouTubePlayer.onInitializationFailure(): " + result.toString(),
Toast.LENGTH_LONG).show();
}
}

@Override
public void onInitializationSuccess(Provider provider, YouTubePlayer player,
boolean wasRestored) {

youTubePlayer = player;

Toast.makeText(getApplicationContext(),
"YouTubePlayer.onInitializationSuccess()",
Toast.LENGTH_LONG).show();

if (!wasRestored) {
player.cueVideo(VIDEO_ID);
}
}

@Override
public void onInitializationFailure(YouTubeThumbnailView thumbnailView,
YouTubeInitializationResult result) {

if (result.isUserRecoverableError()) {
result.getErrorDialog(this, RQS_ErrorDialog).show();
} else {
Toast.makeText(this,
"YouTubeThumbnailView.onInitializationFailure(): " + result.toString(),
Toast.LENGTH_LONG).show();
}
}

@Override
public void onInitializationSuccess(YouTubeThumbnailView thumbnailView,
YouTubeThumbnailLoader thumbnailLoader) {

Toast.makeText(getApplicationContext(),
"YouTubeThumbnailView.onInitializationSuccess()",
Toast.LENGTH_LONG).show();

youTubeThumbnailLoader = thumbnailLoader;
thumbnailLoader.setOnThumbnailLoadedListener(new ThumbnailLoadedListener());

youTubeThumbnailLoader.setVideo(VIDEO_ID);

}

private final class ThumbnailLoadedListener implements
YouTubeThumbnailLoader.OnThumbnailLoadedListener {

@Override
public void onThumbnailError(YouTubeThumbnailView arg0, ErrorReason arg1) {
Toast.makeText(getApplicationContext(),
"ThumbnailLoadedListener.onThumbnailError()",
Toast.LENGTH_LONG).show();
}

@Override
public void onThumbnailLoaded(YouTubeThumbnailView arg0, String arg1) {
Toast.makeText(getApplicationContext(),
"ThumbnailLoadedListener.onThumbnailLoaded()",
Toast.LENGTH_LONG).show();

}

}

}


download filesDownload the files.

Download APK to try on your device.

Next: Handle player state changes and playback events, by implementing PlayerStateChangeListener and PlaybackEventListener.


The Tutorial: YouTube Android Player API step-by-step

Read More..

Kamis, 03 April 2014

Jail and Prison Inmate Search v1 276

Jail and Prison Inmate Search v1.276

Jail and Prison Inmate Search v1.276
Requirements: Android 2.1 and up

Jail and Prison Inmate Search v1.276 Overview: INMATES - Every available Inmate Search in America for all City and County Jails, State and Federal Prisons, ICE Detainees, Female Prisons, Native American Reservation Jails and Military Lockups.

FELONS â€" Information on Recent Arrests, Most Wanted, Warrants, Mug Shots, Sex Offenders, Escapees, Absconders and Death Row residents; every County and every state.
INMATE SERVICES â€" All available Visitation, Mailing, Phoning, Emailing, Commissary, Money Sending, Inmate Email services and important information.
JAILS AND PRISONS â€" Find Contact info, Locations, Websites, Maps, News, Videos, Employment information and more on over 9,000 Jails, Prisons, Juvenile Detention Centers and Terrorist Detention Camps.
SOCIAL - We have facebook Support Groups (english and espanol), Live Crime Feed News, Blogs and a Comment section on each of 9,000+ Facility Pages.
LEGAL - State and Federal Criminal Laws, Sentencing Guidelines and Grids, Courts, Law Enforcement, Probation, Parole, Criminal Defense Lawyers, Bailbondsmen, Criminal Background Checks, Court Record Searches and Reverse Cell Phone Checks.
YOU - We are adding new, updated, relevant information continuously, so do your updates with this app.

More Info:
Code:
https://play.google.com/store/apps/details?id=com.app_jailexchange.layout 

Download Instructions:
http://bitshare.com/files/938czlkf/jpis276p.apk.html

Mirrors:
http://rapidgator.net/file/6337624/jpis276p.apk.html
http://fiberupload.com/43io3oiahz87/jpis276p.apk
http://www.filefat.com/h07thji88oaz
Read More..

Rabu, 02 April 2014

Python for Android

Python for android is a project to create your own Python distribution including the modules you want, and create an apk including python, libs, and your application.

know more: http://python-for-android.readthedocs.org/

Read More..
/*
Program to calculate the power of a number using recursion.
*/
import java.io.*;
class power
{
public static void main(String args[]) throws IOException
{
BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));
power call = new power();
System.out.print("Enter number : ");
int x = Integer.parseInt(br.readLine());
System.out.print("Enter power : ");
int y = Integer.parseInt(br.readLine());
System.out.println("
" +x +"^" +y +" = "
+call.findPower(x,y));
}
int findPower(int x, int y)
{
if(y==0)
return 1;
else if(y==1)
return x;
else
return x*findPower(x,y-1);
}
}



/**
* ALGORITHM :
* ---------
* 1. Start
* 2. Accept a number from user.
* 3. Ask user to enter the power.
* 4. Using method of recursion, find the value.
* 5. Print this value.
* 6. End
*/

/*
OUTPUT :
------
Enter number : 4
Enter power : 3
4^3 = 64
*/


Read More..

Selasa, 01 April 2014


In this application, we will learn how to use broadcast receiver and how to get the battery level and display it on the progress bar. We used one text view to display battery level and one progress bar to display battery level in progress. Create a new project. Open an XML file and use text view and progress bar in a linear layout. The code of the Android XML file is given below:



<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical"
  android:background="#abc">
<TextView
  android:id="@+id/textView1"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:text=""
  android:textSize="25sp"
  android:layout_gravity="center"
/>
<ProgressBar
  android:id="@+id/progressBar1"
  style="?android:attr/progressBarStyleHorizontal"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_gravity="center"
  android:minHeight="100dp"
  android:minWidth="200dp"/>
</LinearLayout>

Now open your Java file, initialize broadcast object and use broadcast class as a nested class. Here, we are registering a broadcast object with a battery changed intent filter which will receive updates on every level of the battery changed. Whenever the battery level changes, onReceive() method will be called, which will take two parameters. Use the code in onReceive() method to do whatever is required to be done on every level of battery change. We are setting a level on progress bar, displaying level on text view and whenever battery level becomes 100% then a song, stored in the assets folder, will start playing. The code of the Android Java file is given below with explanation:


packagecom.exampl.aaaa;
importjava.io.IOException;
importandroid.media.MediaPlayer;
importandroid.os.Bundle;
importandroid.app.Activity;
importandroid.content.BroadcastReceiver;
importandroid.content.Context;
importandroid.content.Intent;
importandroid.content.IntentFilter;
importandroid.content.res.AssetFileDescriptor;
importandroid.widget.ProgressBar;
importandroid.widget.TextView;

publicclassMainActivity extendsActivity {
  //broadcast class is used as a nested class
  privateBroadcastReceiver mbcr=newBroadcastReceiver()
  {
  //onReceive method will receive updates
  publicvoidonReceive(Context c, Intenti)
  {
  //initially level has 0 value
  //after getting update from broadcast receiver
  //it will change and give battery status
  intlevel=i.getIntExtra("level", 0);
  //initialize all objects
  ProgressBar pb=(ProgressBar)findViewById(R.id.progressBar1);
  TextView tv=(TextView)findViewById(R.id.textView1);
  //set level of progress bar
  pb.setProgress(level);
  //display level on text view
  tv.setText("Batterylevel:"+Integer.toString(level)+"%");
  //start a song when the battery level touches 100%
  if(level==100)
  {
   try
   {
   //Save small.mp4 in assets folder
  //we can not start a media file from the drawablefolder directly in broadcast method
   //hence we used the assets folder
   AssetFileDescriptor afd=getAssets().openFd("small.mp4");
   MediaPlayer mp=newMediaPlayer();
   //set file and starting point and ending point in bytes
   mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());
   mp.prepare();
   //start song
   mp.start();
    }
    catch(IOException e){}
   }
  }
};
  /** Called when the activity is first created. */
  @Override
  protectedvoidonCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   //set layout
   setContentView(R.layout.activity_main);
   //register broadcast receiver
   //Get battery changed status
   //we can get more options like power connect, disconnect, call, etc.
   //To get more options, write Intent followed by a dot(.) and press CTRL+Space
   //you will get all the options
   registerReceiver(mbcr,newIntentFilter(Intent.ACTION_BATTERY_CHANGED));
  }
}
  
Now run your project and test application. If you have any doubts please comment. Share and help others. 
Read More..

Music Audio ZPlayer 3 1 3 Android

ZPlayer 3.1.3 (Android)

ZPlayer 3.1.3 (Android)
Requirements: Android 2.1+
 
ZPlayer 3.1.3 (Android) Overview: Windows Phone 7 / Zune themed media player for Android OS.

you might need to uninstall the application before upgrading to version 3.x some database changes have made the application crash after upgrading, but a new installation (or clearing application data) should fix the issue.

Welcome to ZPlayer a Windows Phone 7 / Zune themed player, a better richer and more interactive media player.

Get album reviews, artist biographi
Now with more widgets, fast forward and rewind controls, headset controls home screen customization, equalizer, audio effects. You can start with your own media, and learn about other artists, other tracks and what other people are listening too. Pair this media player with a last fm account and submit likes, now playing status, and scrobble tracks.

*note The Application uses android framework Audio Effect API, this API was introduced since android 2.3. Therefore only devices that have at least Android version 2.3 will be able to take advantage of this feature.
++ if you use a third party equalizer that controls the output mix for all media playing on the device, disable it before using this application. This application needs to control its own audio effects.
-audio effects implemented include Equalizer, Bassboost and Virtualizer based on Android 2.3

Whats in this version : 
(Updated : Apr 12, 2012)
  • fixed reported force closes
  • homescreen scrolling lag fixeds.
ZPlayer 3.1.3 (Android) screenshot:
ZPlayer 3.1.3 (Android)
ZPlayer 3.1.3 (Android)

Code:
https://play.google.com/store/apps/details?id=app.odesanmi.and.wpmusic 

Download ZPlayer 3.1.3 (Android)

Code:
http://rapidgator.net/file/4073749/ZPlayer.3.1.3.Android.zip.html 
http://depositfiles.com/files/bafznxrpg 
http://bitshare.com/files/4dc0wsvk/ZPlayer.3.1.3.Android.zip.html 
http://jumbofiles.com/hz94gnqg5opc 
Read More..