Breaking News
Home / Android / Android Snippets (page 8)

Android Snippets

How to create a Tabbed Screen in Android?

public class BaniTabbedScreen extends TabActivity implements OnTabChangeListener {    private TabHost tabHost;    @Override   public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.tabbed_screen);           /* TabHost will have Tabs */         tabHost = (TabHost) findViewById(android.R.id.tabhost);   …

Read More »

How to create a Splash Screen in Android?

package com.livrona.apps.justsikh.activity;   import android.app.Activity; import android.content.Intent; import android.os.Bundle;   import com.livrona.andriod.commons.utils.Log; import com.livrona.apps.justsikh.R;     public class SplashScreen extends Activity {           protected boolean _active = true;         protected int _splashTime = 2000; // time to display the splash screen in ms …

Read More »

How can I port Android application to iOS?

Answer There is no straight path as of yet. However this a new open-source project called as “In The Box” that aims to easily port Android applications over to Apple’s iOS platform. The input will be a Android app and output with be iOS app,which can be tested  on different …

Read More »

How to override back button press in Android?

In order to capture or override the default back button press in Android the following onKeyDown method can be implemented by the Activity. @Override public boolean onKeyDown(int keyCode, KeyEvent event) {     if (keyCode == KeyEvent.KEYCODE_BACK) {         moveTaskToBack(true);         return true;   …

Read More »
Advertisment ad adsense adlogger