Skip to main content

Posts

Customized Spinners in Android

See more basics on Android along with interview questions The Android Spinner Control is definitely the equivalent of the drop-down selector . By making use of spinner control you basically obtain the capability to choose from a list without taking up all of the display screen space of a ListView. Spinners provide a quick way to select one value from a set. In the default state, a spinner shows its currently selected value. Touching the spinner displays a dropdown menu with all other available values, from which the user can select a new one. You can add a spinner to your layout with the Spinner object. You should usually do so in your xml layout with a  <spinner>   element. For example: <Spinner     android:id="@+id/myspinner"     android:layout_width="fill_parent"     android:layout_height="wrap_content" /> Also See....Simple Spinners In Android Here we are going to deal with Customized Spinners.Her...

BroadcastReceiver for Screen On/Off in ANDROID

If wanted to call a broadcast for screen on/off you can get the code sniffet from here. Here I have used dynamic calling of Broadcast and the java source code is given below. get more details about broadcast from :    Broadcast Receiver Introduction in Android    BroadcastReceiver to get Battery Level in java file: public class MainActivity extends Activity { //Create broadcast object BroadcastReceiver mybroadcast = new BroadcastReceiver() { //When Event is published, onReceive method is called @Override public void onReceive(Context context, Intent intent) { // TODO Auto-generated method stub Log.i("[BroadcastReceiver]", "MyReceiver"); if(intent.getAction().equals(Intent.ACTION_SCREEN_ON)){ Log.i("[BroadcastReceiver]", "Screen ON"); } else if(intent.getAction().equals(Intent.ACTION_SCREEN_OFF)){ Log.i("[BroadcastReceiver]", "Screen ...

Google CEO Confirms that Glass Runs on Android

It's official: Google Glass is based on Android. We kinda saw this one coming: Google Glass is based on Android. Company CEO Larry Page made the revelation during Google's 1Q13 earnings call on Thursday. Towards the end of the call (1:08), Page responded to a question about the amount of "incremental engagement" Google will see over the next several years regarding the company's products and new form factors like Glass. The questioner also asked how transportable Android will be across these new form factors. read more: http://www.tomshardware.com/news/Google-Glass-Ice-Cream-Sandwich-Larry-Page-Incrimental-Engagement-Earnings-Call,22133.html

Template proposals Not Working in Eclipse "No Default Proposals"

while we are using Eclipse we may see that the default proposal are not appearing when we press ctrl+space.This is due to some settings changes in the Windows/preference/java/Editor/Content Assist/Advanced If default proposal is not appearing go to Windows/preference/java/Editor/Content Assist/Advanced Then you will see a window like this.. Here you can check the apprpreate check boxes (java proposals) Then coming back you can get the default proposals pressing ctrl+space

Use Your Own SQLite in ANDROID Application or Using 'SQLite Asset Helper' to read your own databases stored in Asset folder

See more basics on Android along with interview questions See SQLite tutorial here If you want to read your own databases in ANDROID APPLICATION, this post may help you. You may be familiar by creating SQLite in Android use  SQLiteOpenHelper . Here we are going to deal with using our own databases.  I have a database named 'mydatabase.sqlite', which consist of a set of name and age of 5 students. Suppose I want to view the database, I can use SQLite database browser which you can download from here.                                                     download browser..... Through this browser we can view the databases, can even modify delete or create a new one. 'mydatabase.sqlite' with name and age of five students is browsed and viewed as shown below Now  make a zip format of database and copy this database to asse...

Falling Animation in ANDROID using Animation of Translate

Falling animation is used to bring transition to a view between two X points or two Y points. In Android, you can apply this scaling effect to almost anything, from simple text, to images, buttons, etc… in res/anim/falling.xml suppose if transition to be done between two different X indexes use.. <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator"> <translate android:fromXDelta="-100%p" android:toXDelta="0" android:duration="2000"/> </set> suppose if transition to be done between two different Y indexes use.. <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator"> <translate android:fr...

Scaling Animation In ANDROID

Scaling animation is used to scale a view. In Android, you can apply this scaling effect to almost anything, from simple text, to images, buttons, etc…  Here simply I will explain a scaling textview which you can apply to other views also... In res/anim/scale.xml <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator"> <scale android:fromXScale="0.0" android:toXScale="1.0" android:fromYScale="0.0" android:toYScale="1.0" android:pivotX="50%" android:pivotY="50%" android:duration="2000" /> </set> Java source code is given below public class Textviewanimation extends Activity { Animation fadeIn,fadeOut; TextView tv; Button startanimation; @Override public void onCreate(Bundle savedInstanceState) ...