Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Thursday, March 13, 2014

Android in Eclipse - R.java not generating

Need to Install Build Tool from Android SDK Manager

Step 1: SDK Manager


Open the Android SDK Manager

Steps 2:  Install Build Tools ( R.java not generating )


Select the newly added Build Tools and install.

Step 3 : Restart Eclipse


Now Problem Solved. (R.java not generating)

 

From : Problem Only In ADT Version 22

Thursday, December 26, 2013

java.net.socketexception permission denied in Android

Problem:


java.net.socketexception permission denied in Android


Solution:


Add Internet Permission In Manifest FilePermission Code:
uses-permission android:name="android.permission.INTERNET";
Add In manifest.xml

Wednesday, December 25, 2013

No Title Bar For Android Coding

No Title Bar For Android Coding Example


    @Override    public void onCreate(Bundle savedInstanceState) {       
 super.onCreate(savedInstanceState);      
 requestWindowFeature(Window.FEATURE_NO_TITLE); // Add this Line

Import
import android.view.Window;

EditText Hint In Android

Syntax:
android:hint="hint-statement"


EditText Hint In Android Example:

<android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Enter user Name"
/>


EditText Hint In Android Screenshot:

TextView font Change In Android

Syntax:


android:typeface="serif"

TextView font Change In Android Example:


<android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Example Application"
android:typeface="serif"
/>

Jar Mismatch Found no of versions of android-support-v4.jar in the dependency list/ Conflict in jar with multi-library project


Problem:


Jar Mismatch Found no of versions of android-support-v4.jar in the dependency list
Conflict in jar with multi-library project

Solutions:



  1. Looks like it found the library twice. You need to delete one.

  2. Mismatch Android Versions for Projects and Its Library Projects

  3. Please go to libs folder of your main project and copy / replace the android-support-v4.jar file to the libs folder of all attached to your project libraries projects. It should solve the library conflict issue.


Thursday, December 19, 2013

Message In Android Using Toast


Message In Android Using Toast Function :


public void Message(String Msg)
    {
        Toast.makeText(AndroidExample.this, Msg.toString(), Toast.LENGTH_SHORT).show();
    }

Message In Android Using Toast Calling Method:


Message("Hai");

Tuesday, December 17, 2013

Android SDK is out of date or is missing templates In Android Studio

Android SDK is out of date or is missing templates In Android Studio


How to solve the problem "Android SDK is out of date or is missing templates" In Android Studio. Easy and Simple Steps

Follow these Steps



  • Open up your project in Android Studio.

  • Go to Settings for the Project via F4. Or selecting the Project Root -> Right-Click and then Module Settings.

  • You will find Project Settings and Module Settings under which you have the option of selecting both your JDK and Android SDKs if you want.

  • For e.g. under Platform Settings, you will find SDKs and you can simply tap on the green + sign to add your own path to a locally present SDK.


Check Once


First of all, on Windows and Mac, the individual tools and other SDKpackages are saved with the Android Studio application directory.

Windows: Users\AppDataLocalAnroidandroid-studiosdk Mac: /Applications/Android Studio.app/sdk/ Make sure your android-sdk-path is correct and the sdk tool version is 22 or later.

first time do open the Configure—> Project Defaults —> Project Structure, set your project sdk is Android SDK.

then select SDK tab and select build target (eg:Android4.2.2)

Android Studio not start with connected device

Android Studio not start with connected device


Step 1 : Run Configuration

Change Run Configuration for Connected Device

You should change Create Run Configuration in that General Tab select Target Device

  • Show chooser dialog

  • USB Devices

  • Emulator


In Menu

Get From Run -> Edit configurations

android.view.InflateException: Error inflating class com.google.ads.AdView in android studio

Step 1:


Check Once, You need to put the admob jar (Download New Version) into the libs folder of your project.

Step 2:


Remove admob Jar in libs folder of your project

File -> Project Structure -> Modules -> Dependencies -> Add AdMob.jar File

Step 3: Check One Android Manifest File


<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>

 

Tuesday, May 14, 2013

SecurityException: Unable to find field for dex.jar


Problem :


SecurityException: Unable to find field for dex.jar


Solution:



  • Open Android SDK Manager In Eclipse ((Window->Android SDK Manager).

  • Install All Recommended Updates

  • Restart eclipse.

  • Clean and Build All Projects (In Project Menu)


 

Tuesday, April 30, 2013

RelativeLayout's layout_above gives “No resource found” Error


Problem:


RelativeLayout's layout_above gives “No resource found” Error

Solutions:


android:layout_above="@id/my_button"

Replace to
android:layout_above="@+id/my_button"

Reason For (+) Plus Symbol:


The plus-symbol (+) means that this is a new resource name that must be created and added to our resources (in the R.java file). 

For More Info:
http://developer.android.com/guide/topics/ui/declaring-layout.html