Saturday, October 20, 2012

Play 3gp YouTube video in VideoView

This is simple solution to play you tube in our app.

But before providing link to video view, We need to convert it into .3gp. This process of converting youtube in 3gp format explaning in following link.


http://android-coding.blogspot.in/2011/03/simple-example-using-videoview-to-play.html

Thursday, October 11, 2012

Sign Android applications for release in Google Play (Android Market)

With the help of eclipse we can easily create sign apk for release.

Check following links for sign apk using eclipse and also with special command.

http://techdroid.kbeanie.com/2010/02/sign-your-android-applications-for.html


http://developer.android.com/tools/publishing/app-signing.html

Simple steps:
1. Export apk from Eclipse.
2. Create new keystore. If you have alredy keystore then reuse that.
3. After created sign apk. we need to check this apk sign or not.
    use following jarsigner command to check details of authour.
  

jarsigner -verify -verbose -certs ranjitApp.apk


4. Next command is zipalign for compress your sign apk.


zipalign -v 4 your_project_name-unaligned.apk ranjitApp.apk

XML parsing in Android

Check this is very helpful tutorial for xml parsing.

Tutorial 1:
http://www.androidhive.info/2011/11/android-xml-parsing-tutorial/

Tutorial 2:
http://www.vogella.com/articles/AndroidXML/article.html

Saturday, October 6, 2012

Always start app in the main Activity in Android

Very helpful good rating answer available on following link.
Check it.

http://stackoverflow.com/questions/8259528/how-can-i-always-start-app-in-the-main-activity


Selected Answer:
android:launchMode="singleInstance"

Add Hit Counter in your blog or site

Using following link you can connect visitor counter with your site or blog

http://hit-counter.info/counter-styles.htm


---------------

Steps to follow:
1. Go to : http://hit-counter.info  this link
2. Choose your favourite style.
3. Enter the starting counter value.
3. Set your blogger or site url.
4. Click on "add button". 
5.  change the title of counter.
Finally Check It On Your Blog or Site.
And Enjoy It............................



Friday, October 5, 2012

Play YouTube video in webView using media player - Android

Using following simple code you can play YouTube video in android media player using WebView. I am trying to play YouTube video from last few days, But today I won.

If  you have any problem in that, So please reply me.


wv = (WebView) findViewById(R.id.webView1);
wv.getSettings().setJavaScriptEnabled(true);
wv.getSettings().setPluginsEnabled(true);
final String mimeType = "text/html";
final String encoding = "UTF-8";
               //Your HTML link for playing video.
               //I used YouTube iframe YouTube Video link
html = getHTML();
wv.setWebChromeClient(new WebChromeClient() {

@Override
public void onShowCustomView(View view, CustomViewCallback callback) {

super.onShowCustomView(view, callback);
Log.e("onShowCustomView", "i m onShowCustomView");
if (view instanceof FrameLayout) {
Log.e("Condin true : view instanceof FrameLayout",
"view instanceof FrameLayout");
FrameLayout frame = (FrameLayout) view;
if (frame.getFocusedChild() instanceof VideoView) {
Log.e("True : frame.getFocusedChild()",
"True : frame.getFocusedChild()");
VideoView video = (VideoView) frame.getFocusedChild();
frame.removeView(video);
setContentView(video);
video.setOnCompletionListener(new OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer mp) {
// TODO Auto-generated method stub
mp.stop();
Log.e("mp.stop()", "mp.stop()");
finish();
// setContentView(R.layout.loaddata_qrurl);
}
});
video.setOnErrorListener(new OnErrorListener() {

@Override
public boolean onError(MediaPlayer mp, int what,
int extra) {
Log.e("oNError", "onError");
Toast.makeText(getApplicationContext(),
"Video Error...", 1).show();
return false;
}
});
video.start();
}
}

}

@Override
public void onHideCustomView() {
// TODO Auto-generated method stub
super.onHideCustomView();
Log.e("onHideCustomView", "i m onHideCustomView");
}

@Override
public View getVideoLoadingProgressView() {
// TODO Auto-generated method stub
Log.e("View getVideoLoadingProgressView",
"i m View getVideoLoadingProgressView");
return super.getVideoLoadingProgressView();

}
});
wv.loadDataWithBaseURL("", html, mimeType, encoding, "");



Thursday, October 4, 2012

Adobe Flash Player for android apks

You can easily download apks of adobe-flash-player for ANDROID mobile


http://www.iapktop.com/tag/adobe-flash-player-apk

BroadcastReceiver

Using BroadcastReceiver we can start app, service, or special code after mobile rebooting complete.

If mobile restart then all local app automatically force stop, as well as service also stop, But at the time of notification we need to process continue. That time BroadcastReceiver is very helpful.

Using BroadcstReceiver u can start service in background .

Follow i provide important link for that
http://ofps.oreilly.com/titles/9781449390501/Android_Broadcast_Receivers.html 

using this send sms
http://www.vineetdhanawat.com/blog/2012/04/how-to-use-broadcast-receiver-in-android-send-and-receive-sms/

Stackoverflow Account

Hello all android developers,
This is my Stackoverflow account .

U can ask here all Android related questions and get answer as fast as

http://stackoverflow.com/users/1280397/ranjit-chandel