Thursday, 23 August 2012

Android: Change Tab Text Color




     
   

Android: Change Tab Text Color





 TabHost tabHost = getTabHost();
     
        TabSpec wotspec = tabHost.newTabSpec("WOT      WOT   .");
         wotspec.setIndicator("WOT      WOT    .", getResources().getDrawable(R.drawable.finalimg));
        Intent wotIntent = new Intent(this, wot.class);
        wotspec.setContent(wotIntent);

   
        TabSpec moviespec = tabHost.newTabSpec("MOVIES     MOVIES  .");
        moviespec.setIndicator("MOVIES    MOVIES   .", getResources().getDrawable(R.drawable.movies));
        Intent movieIntent = new Intent(this, movie.class);
        moviespec.setContent(movieIntent);

       
        TabSpec theatrespec = tabHost.newTabSpec("THEATRE   THEATRE  .");
        theatrespec.setIndicator("THEATRE    THEATRE .", getResources().getDrawable(R.drawable.theatre));
        Intent theatreIntent = new Intent(this, theatre.class);
        theatrespec.setContent(theatreIntent);
       
        TabSpec book = tabHost.newTabSpec("BOOK TICKET   BOOK TICKET");
        book.setIndicator("BOOK TICKET   BOOK TICKET", getResources().getDrawable(R.drawable.finalimg));
        Intent bookIntent = new Intent(this, book.class);
        book.setContent(bookIntent);
       
        TabSpec map = tabHost.newTabSpec("MAP      MAP  .");
        map.setIndicator("MAPS      MAP   .", getResources().getDrawable(R.drawable.finalimg));
        Intent mapIntent = new Intent(this, map.class);
        map.setContent(mapIntent);
       
                 
     
        tabHost.addTab(wotspec);
        tabHost.addTab(moviespec);
        tabHost.addTab(theatrespec);
        tabHost.addTab(book);
        tabHost.addTab(map);
       
       
        for(int i=0;i< tabHost.getTabWidget().getChildCount();i++)
        {
            TextView tv = (TextView) tabHost.getTabWidget().getChildAt(i).findViewById(android.R.id.title);
            tv.setTextColor(Color.parseColor("#160F0F"));
        }
     

Tuesday, 14 August 2012

Android version history



Android version history







Android beta

Released on November 5, 2007


Android 1.0


 September 23, 2008

 The first Android device, the HTC Dream


Android 1.1


February 9, 2009


Android 1.5 Cupcake


April 30, 2009


Android 1.6 Donut

September 15, 2009


Android 2.0/2.1 Eclair

October 26, 2009



Android 2.2.x Froyo(2.2,  2.2.1,  2.2.2,  2.2.3)

May 20, 2010


Android 2.3.x Gingerbread( 2.3.3,  2.3.4,   2.3.5,  2.3.6,   2.3.7)

December 6, 2010


Android 3.x Honeycomb(3.0,   3.1,    3.2,   3.2.1,  3.2.2,  3.2.4, 3.2.6)

February 22, 2011

Android 4.0.x Ice Cream Sandwich (4.0.2,  4.0.3,  4.0.4)

 October 19, 2011



Android 4.1.x Jelly Bean(4.1.1)

July 9, 2012

Monday, 6 August 2012

SharedPreferences



SharedPreferences 

method 1



SharedPreferences mypref=this.getSharedPreferences("mypref",MODE_WORLD_READABLE);
  SharedPreferences.Editor prefeditor=mypref.edit();
  prefeditor.putString("slatti", slatti);
  prefeditor.putString("slongi", slongi);
  prefeditor.commit();
 





SharedPreferences mypref=this.getSharedPreferences("mypref",MODE_WORLD_READABLE);
  String slatiii = mypref.getString("slatti", "nothing");
  String slongiii = mypref.getString("slongi", "nothing");





method 2

SharedPreferences app_preferences =PreferenceManager.getDefaultSharedPreferences(ProfileloginActivity.this);
               SharedPreferences.Editor editor = app_preferences.edit();
              // String text = textBox.getText().toString();
               editor.putString("key",username);
               System.out.println("proffidddd"+username);
               editor.commit();






     
        SharedPreferences app_preferences = PreferenceManager.getDefaultSharedPreferences(this);
        String username = app_preferences.getString("key", "null");