Pages Navigation Menu

Coding is much easier than you think

Android Updates

Advertisements

Android – SQLite Database

Posted by on Mar 10, 2013 in Android | 0 comments

Android – SQLite Database

  In this tutorial we will be seeing,   How to use the SQLite database in Android applications? Create an android application (Simple Notes) using the above concept Before creating an android application using Eclipse, let us see some of the key terms involved while developing this application.   Key terms/concepts involved in this project: SQLite: SQLite is an Open Source Database which is embedded into Android. SQLite supports standard relational database features like SQL syntax, transactions and prepared statements. In...

read more

Cannot complete the install because one or more required items could not be found. Android Error

Posted by on Mar 2, 2013 in Android | 0 comments

Cannot complete the install because one or more required items could not be found. Android Error

  This error is because of many reasons. Mainly you will get this error while trying to install adt plugin. Here u go possible solutions . 1.  Help -> Install New Software. Click on Available software sites. Delete the Android repo. Uncheck Indigo & Eclipse updates & recheck them. Now head back to Help -> Check for updates. Once done, add the Android repo again. Accept the license & you should be good to go.   ** UPDATE: Android Complete tutorial now available here.   2. Run Eclipse as Administrator Follow...

read more

Auto Scale TextView Text to Fit within Bounds

Posted by on Feb 5, 2013 in Android | 0 comments

Auto Scale TextView Text to Fit within Bounds

    1. You can create a Class to check for the TextView size 2. Edit the text view size to the maximum size allotted.   public FitView(Context context, AttributeSet attrs) { super(context, attrs); float size = this.getTextSize(); if (size > MAX_TEXT_SIZE) setTextSize(MAX_TEXT_SIZE); }   3. Then create an object for the Class in your activity. The constructor will be called automatically and resizing will be done. This resized TextView will be stored in the object created textViewName.   FitView...

read more

How do I pass data between activities in Android

Posted by on Feb 5, 2013 in Android | 1 comment

How do I pass data between activities in Android

  You may have persistent data such as session id to be used throughout the application in many activities. You may do this using any one of the following methods:   ** UPDATE: Android Complete tutorial now available here.   1. In the First Activity where the common value is first initiated, create a new Intent as below:   Intent i = new Intent(getApplicationContext(), NewActivity.class); i.putExtra("session_id","value"); startActivity(i);   You are adding the session value in the extras of...

read more

R cannot be resolved – Android error

Posted by on Feb 5, 2013 in Android | 0 comments

R cannot be resolved – Android error

This maybe due to following Reasons: 1. Eclipse sometimes likes to add an “import android.R” statement at the top of your files that use resources, especially when you ask Eclipse to sort or otherwise manage imports. This might have been added when you use Ctrl+Shift+O keys for Organizing the Imports.  So this has to be deleted. Look at your imports. Chances are that the line: import android.R; will be there. If that’s the case, remove it, so that your project will resolve R not with the default Android Resources class, but...

read more

Difference of px, dp, dip and sp in Android

Posted by on Feb 5, 2013 in Android | 4 comments

Difference of px, dp, dip and sp in Android

  px px is one pixel. Pixels – corresponds to actual pixels on the screen.   pt Points – 1/72 of an inch based on the physical size of the screen.   dp A virtual pixel unit that you should use when defining UI layout, to express layout dimensions or position in a density-independent way. The density-independent pixel is equivalent to one physical pixel on a 160 dpi screen, which is the baseline density assumed by the system for a “medium” density screen.   ** UPDATE: Android Complete tutorial now...

read more

how to get option menu on android

Posted by on Feb 4, 2013 in Android | 0 comments

how to get option menu on android

You can use keyboard shortcuts to simulate the hardware buttons. There’s a table of the shortcuts here. The Back button is simulated by pressing escape, and the menu button is simulated by the Page-Up or F2 keys.     Emulated Device Key Keyboard Key Home HOME Menu (left softkey) F2 or Page-up button Star (right softkey) Shift-F2 or Page Down Back ESC Call/dial button F3 Hangup/end call button F4 Search F5 Power button F7 Audio volume up button KEYPAD_PLUS, Ctrl-F5 Audio volume down...

read more

What is Context in Android

Posted by on Jan 31, 2013 in Android | 4 comments

What is Context in Android

Context  is context of current state of the application/object.It€™s an entity that represents various environment data . Context helps the current activity to interact with out side android environment like  local files, databases, class loaders associated to the environment, services including system-level services, and more. A Context is a handle to the system . It provides services like resolving resources, obtaining access to databases and preferences, and so on. An android app has activities. It’s like a handle to the...

read more

Faster android emulation

Posted by on Jan 29, 2013 in Android | 0 comments

Faster android emulation

  It is fun to develop but not fun to test on emulator because of performance issues. Here is what work for me after a long research ( information collected from internet source and books ). If you are running Windows 7 on an i5 processors then this might just work for you without getting into downloading virtual machine or any additional virtual images.   Hardware running on: i5 processor ( first generation , but any generation should do ). 3 GB main memory ( As per observation memory is not a constraint, anything more than 3 GB is...

read more

To Check Whether Internet Connection Available in Android

Posted by on Jan 29, 2013 in Android | 0 comments

  NetworkInfo class provides a non-static method isAvailable() which will return null if there no internet . getActiveNetworkInfo() method of ConnectivityManager returns a NetworkInfo instance representing the first connected network interface it can find or null if it cant find any connected network. We could find whether internet connection is available by checking this method .   ** UPDATE: Android Complete tutorial now available here.   Below code snippet will explain it . private boolean doNetworkAvailable() { ...

read more
%d bloggers like this: