Pages

Android Material Design - 2 (Good bay ActionBar, Hello ToolBar with Navigation Drawer)

Tuesday, 5 May 2015
hello all, after long time i have update my blog with android material Design theme, i am tying to demonstrate new things which is available with android lollipop. using different example i 'll show you, one sample app with material design which include ToolBar, Floting Actions, Tabs, Cardview, Recycle view.




In this example we will take a look at the new Actionbar replacement called Toolbar.




It is introduced in Android Lollipop, API level 21 release, and hence it is available to use, out of box for the application that are targeted to 21 and above. However, as always Google provides fully supported Toolbar features to lower android os devices via AppCompact support library. In AppCompat, Toolbar is implemented in the android.support.v7.widget.Toolbar class.

Pre-requirements:

1. Android Studio 1.0.1 (Latest while writing the post)
2. Appcombat v7 Support library (To Support Pre Lollipop devices)

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

1. Create an xml file named toolbar.xml under res ⇒ layout


 <?xml version="1.0" encoding="utf-8"?>  
 <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"  
   android:id="@+id/toolbar"  
   android:layout_width="match_parent"  
   android:layout_height="?attr/actionBarSize"  
   android:background="?attr/colorPrimary"  
   android:popupTheme="@style/ThemeOverlay.AppCompat.Light"  
   android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" />  

2. Open the layout file of your main activity (activity_main.xml) and add the toolbar using <include/>tag.

 <!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->  
 <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:orientation="vertical"  
   tools:context=".MainActivity">  
   <LinearLayout  
     android:id="@+id/layout_main"  
     android:layout_width="match_parent"  
     android:layout_height="?attr/actionBarSize"  
     android:orientation="vertical">  
     <include  
       android:id="@+id/toolbar"  
       layout="@layout/toolbar" />  
   </LinearLayout>  
 </LinearLayout>  


3. create main.xml located under res ⇒ menu


 <menu xmlns:android="http://schemas.android.com/apk/res/android"  
   xmlns:app="http://schemas.android.com/apk/res-auto"  
   xmlns:tools="http://schemas.android.com/tools"  
   tools:context=".MainActivity">  
   <item  
     android:id="@+id/action_example"  
     android:icon="@drawable/ic_action_action_autorenew"  
     android:title="@string/action_example"  
     app:showAsAction="ifRoom" />  
   <item  
     android:id="@+id/action_settings"  
     android:icon="@drawable/ic_action_action_autorenew"  
     android:orderInCategory="100"  
     android:title="@string/action_settings"  
     app:showAsAction="never" />  
 </menu>  


4. Now open your MainActivity.java, Extend the activity from AppCompatActivity (because ActionBarActivity has been deprecated in favor of the new AppCompatActivity, read more)


 public class MainActivity extends AppCompatActivity{  
   private Toolbar toolbar;  
   @Override  
   protected void onCreate(Bundle savedInstanceState) {  
     super.onCreate(savedInstanceState);  
     setContentView(R.layout.activity_main);  
     toolbar = (Toolbar) findViewById(R.id.toolbar);  
     setSupportActionBar(toolbar);  
   }  
   @Override  
   public boolean onCreateOptionsMenu(Menu menu) {  
     // Inflate the menu; this adds items to the action bar if it is present.  
     getMenuInflater().inflate(R.menu.main, menu);  
     return true;  
   }  
   @Override  
   public boolean onOptionsItemSelected(MenuItem item) {  
     // Handle action bar item clicks here. The action bar will  
     // automatically handle clicks on the Home/Up button, so long  
     // as you specify a parent activity in AndroidManifest.xml.  
     int id = item.getItemId();  
     //noinspection SimplifiableIfStatement  
     if (id == R.id.action_settings) {  
       return true;  
     }  
     return super.onOptionsItemSelected(item);  
   }  
 }  


 What is NEXT?

customise Tool bar and add Navigation Drawer in next tutorial.

code is shortly available on github .



Read more ...

Android Material Design - 1

Wednesday, 31 December 2014
Android Material Design



Material design is a comprehensive guide for visual, motion, and interaction design across platforms and devices. Android now includes support for material design apps. available in Android 5.0 (API level 21) and above


Material Theme


Create your style for Android 5.0




Apply your style to your app from android manifest file


Done, enjoy LOLLIPOP..!!




Read more ...

Android - Root User (Samsung Galaxy Mini GT-s5570)

Tuesday, 18 June 2013



Today , We will learn How to Root Samsung Galaxy Mini. Before that It’s a good idea to do a little bit of research first and see if other people report success rooting your device.

Android rooting is the process of allowing users of smartphones, tablets, and other devices running the Android mobile operating system to attain privileged control (known as "root access") within Android's subsystem.

Rooting is often performed with the goal of overcoming limitations that carriers and hardware manufacturers put on some devices, resulting in the ability to alter or replace system applications and settings, run specialized apps that require administrator-level permissions, or perform other operations that are otherwise inaccessible to a normal Android user. On Android, rooting can also facilitate the complete removal and replacement of the device's operating system, usually with a more recent release of its current operating system.

As Android derives from the Linux kernel, rooting an Android device is similar to accessing administrative permissions on Linux or any other Unix-like operating system such as FreeBSD or OS X.

To root or not to root

Gaining full root access to your Android device can be thrilling, especially if you want to tinker with settings and customize your device. How much it changes your experience depends largely on the device you have. If you have a shuttered device, like a Kindle Fire tablet, then it’s a great way to get the full Android experience.
The potential benefits for all Android users include improved battery life, root-only apps, custom ROMs, overclocking, an end to bloatware, improved performance, and the ability to upgrade your phone when you want. If you aren’t excited at the prospect of any of these things, rooting probably isn’t for you.

Have you tried rooting your Android? Did you have a positive experience? Would you recommend rooting to others, or do you think it’s pointless? Post a comment and share your thoughts.

My Answer: I have rooted my Device after rooting its give me best performance (Really I am very glad about it). But in some device its take more power. So, you have to charge your device twist. 

Before you root your Android phone or tablet, there are a few things you should be aware of:
Warranty – Some manufacturers assert that rooting voids your device’s warranty. However, rooting will not actually damage your hardware. You can “unroot” your device and manufacturers won’t be able to tell if it’s been rooted.
Security – Google Wallet, in particular, has a vulnerability on rooted devices that could allow other apps to access your PIN and other wallet information.  Google Wallet displays a warning message if you run it on a rooted device. If you’re one of the few people using Google Wallet for NFC payments, you may want to reconsider rooting your device.
Bricking – Rooting a device is a very safe process. However, there’s always some danger of “bricking” a device when you go outside the normal parameters and hack around with it — particularly if you’re trying to root a device or operating system version not supported by a tool. “Bricking” refers to breaking the device, making it about as useful as a brick. When you root, jailbreak, or install a custom ROM, or otherwise hack around, you do so at your own risk. 

Do below steps at your own Risk. It may be break your Device.

Lets Start!!!

  • Download the file.
  • Mount you sd-card to your pc and copy the file you downloaded to the root directory of your sd-card (copy inside sdcard/) rename it update.zip.

  • After copy power off your device.
  • Take your device in to recovery mode(using HOME + POWER + Volume Up Buttons).
  • Select “Apply from sdcard(update.zip)”.
  • Reboot your device.


Well Done! You have rooted your device successfully.

Enjoy Super User Option! 

Root User APPs

In my Next Blog we learn how install custom rom in Android Device.

Read more ...