Saturday, 30 January 2016

My first android app or How to create android app or how to create my first android

Hi friends you will to start button of your computer and search eclipse and open it for start android programming with java. After open eclipse ADT goto left top on File-> New -> Project and select Android New Application.

Hello Android Wizard


Next, and follow the instructions provided and keep all other entries as default till the final step. Once your project is created successfully, you will have following

Hello Android Project

and you will change here as you want in activity_main.xml file is in project file in res-> layout folder and in MainActivity.java  in project folder src-> packagename folder-> .java file

like as

Android Directory Structure

and following details about these folder

src
This contains the .java source files for your project. By default, it includes an MainActivity.java source file having an activity class that runs when your app is launched using the app icon.

gen
This contains the .R file, a compiler-generated file that references all the resources found in your project. You should not modify this file.

bin
This folder contains the Android package files .apk built by the ADT during the build process and everything else needed to run an Android application.

res/drawable-hdpi
This is a directory for drawable objects that are designed for high-density screens.

res/layout
This is a directory for files that define your app's user interface.

res/values
This is a directory for other various XML files that contain a collection of resources, such as strings and colours definitions.

AndroidManifest.xml
This is the manifest file which describes the fundamental characteristics of the app and defines each of its components.

package com.akharipoint.helloworld;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;

public class MainActivity extends Activity {

   @Override
   public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main); 
//layout file in res->layout folder for design or componet 
//of UI of screen which is interact with user.
 }
 //for menu like home, settings and etc. is exist in res->values-> .xml  
   @Override
   public boolean onCreateOptionsMenu(Menu menu) {
      getMenuInflater().inflate(R.menu.activity_main, menu);
      return true;
   }
}

 activity_main.xml


res->layout-> .xml file

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="match_parent"
   android:layout_height="match_parent" >
   
   <TextView android:id="@+id/hello_txt"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_centerHorizontal="true"
      android:layout_centerVertical="true"
      android:text="@string/hello_world"/>
      
</RelativeLayout>

 strings.xml

res->values->.xml

<resources>
   <string name="app_name">HelloWorld</string>
   <string name="hello_world">Hello world!</string>
   <string name="menu_settings">Settings</string>
   <string name="title_activity_main">MainActivity</string>
</resources>
 
after this successfully you will run this app right click on the project 
 and select option run as android application 
 you will run this app from top menu bar of eclipse run option and run successfully.

Happy to Code ....

Sunday, 3 January 2016

which software are require for android app development or what is basice need for android app development or how to install Android Development Tool(ADT)

Basic need for android app development with java case first of all install java and with set environment variable and java class path. friends in last post i was explain how to set environment variable and java class path so you can refer from that post. and then two software are available in market you can download any one and install and run it.
  1. Eclipse ADT.
  2. Android Studio.


Install Eclipse:-

Download Ecllipse and double click on eclipse .exe file and follow instruction.

Add packages to your Android SDK. Before you can begin using the SDK for development, you will need to add the packages you want to use to your Android SDK. In the SDK Manager, you should see a list of all the available packages for download. For basic development, be sure to grab the following:
  • The most recent Tools package in the Tools folder.
  • The most recent version of Android (This is the first Android folder in the list).
  • The Android Support Library, which can be found in the Extras Folder.
  • Click Install when finished. The files will be downloaded and installed.

Open Eclipse. You will be installing ADT from within the Eclipse program. If Eclipse won’t start, ensure that you have specified your JVM or ensure that you have set java classpath or environment variable of our system(see in last post).

Image titled Install Eclipse and Setup ADT Step 9


Install the ADT plugin. The ADT plugin will need to be downloaded within the Eclipse program directly from the Android developers’ repository. You can quickly add that repository to your Eclipse installation.
  • Click Help. Select Install New Software. This will open the Available Software screen, with a list of your available software from the repository you have selected.
Image titled Install Eclipse and Setup ADT Step 10

Click the “Add” button. This is located to the right of the “Work with” field. Clicking this button will open the “Add Repository” dialog box. Here you will enter the information to download the ADT plugin.
  • In the “Name” field, enter “ADT Plugin”
  • In the “Location” field, enter “https://dl-ssl.google.com/android/eclipse/”
  • Click OK.
  • Check the “Developer Tools” box. Click Next to display the list of tools that will be downloaded. Click Next again to open the license agreements. Read them and then click Finish.
  • You may get a warning that the validity of the software cannot be established. It is OK to ignore this warning.
 
Restart Eclipse. Once the tools have finished downloading and installing, restart Eclipse to complete the installation. Upon restarting, you will be greeted with the “Welcome to Android Development” window. 
Specify the location of the Android SDK. IN the Welcome screen, click “Use existing SDKs” and then browse for the directory of the SDK you installed at the beginning of this section. Once you click OK, your basic ADT installation is complete.

2. Android Studio

download and install as follow its instruction on double click on .exe file of android studio.

and other for Android SDK step is same of Eclipse set such as