fbpx
Pages Navigation Menu

Coding is much easier than you think

Android Updates

Advertisements

Failed to install *.apk on device *: timeout :- Android Error

Posted by on Apr 15, 2013 in Android | 0 comments

Failed to install *.apk on device *: timeout :- Android Error

  Just we need to extend the time , to remove this error.Try changing the ADB connection timeout. I think it defaults that to 5000ms and I changed mine to 10000ms to get rid of that problem. If you are in Eclipse, you can do this by going through Window -> Preferences and then it is in DDMS under Android.   ** UPDATE: Android Complete tutorial now available here.   We can restart the adb to remove this error . adb kill-server adb start-server With some never versions of the Platform Tools you can do this from the DDMS...

read more

How to get screen density in android programmatically

Posted by on Apr 15, 2013 in Android | 0 comments

How to get screen density in android programmatically

We can get screen density from component called DisplayMetrics as below . DisplayMetrics metrics = getResources().getDisplayMetrics(); Though Android doesn’t use a direct pixel mapping, it uses a handful of quantized Density Independent Pixel values then scales that to the actual screen size. So the density property will be one of those constants (120, 160, or 240 dpi).   ** UPDATE: Android Complete tutorial now available here.   If you need the actual density (perhaps for an OpenGL app) you can get it from the xdpi and ydpi...

read more

Trouble getting Android emulator to run in eclipse

Posted by on Apr 14, 2013 in Android | 0 comments

Trouble getting Android emulator to run in eclipse

  Problem: I’m trying to run the SDK Samples on the Emulator in Eclipse 3.5 Most of the time the AVD Manager hangs when I try to create a new AVD. When I manage to create an AVD and try to start the emulator I get this: emulator: ERROR: no search paths found in this AVD’s configuration weird, the AVD’s config.ini file is malformed. Try re-creating it. Solution 1: You can set the environment variable ANDROID_SDK_HOME. For example: ANDROID_SDK_HOME=D:\Development\android-sdk\. Add this variable to...

read more

This android sdk requires adt version 21.1.0 or above error in eclipse

Posted by on Apr 14, 2013 in Android | 0 comments

This android sdk requires adt version 21.1.0 or above error in eclipse

  This error occurred to me too. I tried to update my SDK version using my SDK manager previous day and when I tried to use my eclipse after the api got downloaded, it threw the error. €œThis android sdk requires adt version 21.1.0 or above error in eclipse. Please update your ADT to 21.1.0 for SDK 21.1.0€. If you try to run your project ignoring this error, you will get an error saying €œyour projects are found to have errors€. But it would have run perfectly before updating. Below is the preferences window showing error...

read more

How do I run an Android emulator automatically from Eclipse?

Posted by on Apr 14, 2013 in Android | 0 comments

How do I run an Android emulator automatically from Eclipse?

  You might want to know how to run an Android emulator automatically from Eclipse. Here is what you need to do. Once you have installed ADT, you need to define an ADT launch configuration, in order for your project to execute itself as an Android executable.   ** UPDATE: Android Complete tutorial now available here.   Then, in Eclipse go to Window –>Preferences  –> Run/Debug tab –> Launching. In the €œLaunch Operation subsection, select €œAlways launch the previously launched...

read more

Relative layout in android

Posted by on Apr 14, 2013 in Android | 0 comments

Relative layout in android

    Relative layout, in general is used to organize elements based on their relationships with one another, and with the parent container. The arrangement of the views can be done using the 3 ways, Relative To Container Relative To Other Elements Alignment With Other Elements Relative to Container android:layout_alignParentBottom -€“ Places the bottom of the element on the bottom of the container android:layout_alignParentLeft -€“ Places the left of the element on the left side of the...

read more

Navigation Types in new Android SDK Tools

Posted by on Apr 14, 2013 in Android | 0 comments

Navigation Types in new Android SDK Tools

  Android SDK Tools Revision 20 also provides various Navigation Types for Blank activity. To use the template of Navigation Type, minimum SDK version of at least 14 is required. The various navigation templates available are as follows   ** UPDATE: Android Complete tutorial now available here.   Tabs Mostly this type of navigation type is used for action bars. When you want to provide navigation tabs in an activity, using the action bar’s tabs is a great option (instead of using TabWidget), because the system adapts the...

read more

An internal error occurred during: “Launching New_configuration”

Posted by on Apr 14, 2013 in Android | 1 comment

An internal error occurred during: “Launching New_configuration”

  When you create and try to run a built project, sometimes eclipse will throw the following error, An internal error occurred during: “Launching New_configuration”. Path for project must have only one segment. When you go to your run configurations, you can see a screen similar to this, Error log: !ENTRY org.eclipse.core.jobs 4 2 2011-02-20 12:12:00.397 !MESSAGE An internal error occurred during: “Launching android”. !STACK 0 java.lang.IllegalArgumentException: Path for project must have only one segment. at...

read more

Importing project gave Unable to resolve target ‘android-7’

Posted by on Apr 14, 2013 in Android | 0 comments

Importing project gave Unable to resolve target ‘android-7’

  When you try to import an already existing android project in your eclipse, sometimes you tend to get the error €œUnable to resolve target ‘android-7€.  This is simple and nothing wrong in your source file or your activity file. The problem is with the SDK version you have specified. Let us consider I am setting my minimum SDK for my application as 7, so my project properties will have the line target=android-7. Problem: Now if you are trying to import this project in another system which doesn’€™t have API 7 then...

read more

Difference between Wrap content and Fill parent/match parent

Posted by on Apr 14, 2013 in Android | 1 comment

Difference between Wrap content and Fill parent/match parent

  Wrap content: As the name suggests, it refers to wrapping a widget€™s/view contents within the view. The wrap content can be best explained using button view. For eg: in case of button, Button name is €œwrap€ at first and now you change it to wrapcontent€, the size of the button increases to wrap its content.   ** UPDATE: Android Complete tutorial now available here.   This is due to the reason that the attributes android:layout_width and android:layout_height is set to wrap_content as shown below.        ...

read more
%d bloggers like this: