Saturday 19 September 2015

EVER THOUGHT OF BUILDING YOUR OWN APP???

Please +1'd this post on Google+ and please share it on Facebook...
Merely by reading the topic don't think that this post may be a boredom for you.
You may have downloaded hundreds of applications from the Google Play Store. But had ever looked behind the scenes.
Many of you'll may have, but for those who haven't, its a gift.
Now lets stop jumping and lets get into the process of Android App Development.

1. Choose a programming language to start with.
Picking the best programming language help you to create huge apps and huge app content with a low memory usage.
I had started with Java as the base of my programming. I found it the best among all the programming languages I had learnt (C, C++ and Python). Java is the best programming language you could depend on if you think of making awesome apps.
In order to install Java on your computer just install JDK (Java Development Kit), which is available from HERE.

2. Choosing an IDE (Integrated Development Environment)
To many of you this term may be new, but don't get scared its not that hard. IDE basically refers to a platform for a particular programming language. Always prefer for IDE over platforms like BlueJ.
The best IDE I can suggest is Oracle Netbeans IDE.
In order to install Netbeans you first need to install JDK on your computer.
So go forward and download Oracle Netbeans 8 from HERE.

3. Creating an apk file of the source code you have written:
I. INSTALL AND SETUP ANDROID SDK 

1. You need to download the Android SDK: 
http://developer.android.com/sdk/installing/index.html 

2. Install the Android SDK to C:\Android\android-sdk 

3. Run Android SDK and install the recommended installations. 
If you want to use your programs on your Android device, I suggest 
installing the emulator for your device as well as the emulator for 
the newest Android versions. 

II. SETUP ANDROID VIRTUAL DEVICE(AVD) 

4. In Android SDK, go to Tools> AVC Manager. 

5. Create a new Android Virtual Device(Emulator). Name it whatever you want. 
Set the target to the version of Android you want to emulate. 

6. Set the size of the virtual SD card to whatever you want. For my first 
Emulator i set it to 100 MB. 

7. Set Snapshot enabled to true to speed up future loading time. This takes a 
snapshot of the Emulator State on closing so that it does not go through 
the startup animations. 

8. Finally, click Create AVD at the bottom. 

III. TEST YOUR ANDROID EMULATOR 

9. Still in the AVD Manager, click Start. 

10. You will see that Save to snapshot has been selected. 

11. If you want it to load from that snapshot everytime, select 
"LAUNCH FROM SNAPSHOT" 

12. The emulator runs very slowly, especially the first time 
with the startup animations. You will get used to it after awhile. 

13. You should get to the menu screen. 

14. After checking that everything is okay, you can test out 
the emulator, or exit out. 

15. Exiting saves a snapshot, which takes awhile. After taking the 
first snapshot, it is okay to uncheck the "Save to snapshot". You really 
don't need to do it after the first time, unless you want to save info 
to the emulator for testing purposes, such as adding phone numbers, etc. 

IV. INSTALLING THE PLUGIN ON NETBEANS 

16. Start Netbeans. Go to Tools->Plugins->Settings 
This is a list of all the places your plugin manager checks for updates. 

17. Add a new update center: http://kenai.com/projects/nbandroid/downloads/download/updatecenter/updates.xml 
this is the home of the NetBeans Android project. 

18. After installing, go to Tools->Plugins->Available Plugins. There 
should be a new plugin called Android. Install it. It is only about 
700 kb. 
I have had problems with the test runner on Netbeans 7.2. I think 
the Test Runner for Netbeans 7.0 isn't compatable with 7.2. 

NOTE: On previous versions, you had to add Android to the Tools->Java Platforms. 
(I Think). You don't need to do this anymore. 

19. Go to Tools->Options->Miscellaneous->Android 
There is now an android tab in your options. Set the location 
of your android SDK installation. Mine is C:\Android\android-sdk 

20. You should now be able to create an Android Project. File->New->Android->Android Project 

21. Name your Project. 

22. The convention for naming an Android Package is different than for 
normal Java Projects. 
WRONG: "MyPackage" //ERROR! 
RIGHT!: "My.Package" //GOOD! 
This is what it means when it says "Package name must have at least two parts" 

23. This is the source code for your main file: 

package bl.ah; 

import android.app.Activity; 
import android.os.Bundle; 

public class MainActivity extends Activity 

/** Called when the activity is first created. */ 
@Override 
public void onCreate(Bundle savedInstanceState) 

super.onCreate(savedInstanceState); 
setContentView(R.layout.main); 



24. add import "My.Package.R" where My.Package is the name of your package. 

25. After Building, you can press Start to startup your android emulator. 


YOU CAN ALSO INSTALL A PACKAGE MANUALLY 
This is good practice anyway. 

26. Use the explorer to go to your project folder. In the bin folder, 
you should find a .apk file. This is the compressed version of your program. 
It works sort of like a .jar file. 

You can install it manually onto your emulator from the command line(start->search->cmd.exe if you haven't 
used the command line before. It can also be found in c:\windows\System32 or SysWOW64 

26. If you know how to set system variables, add C:\Android\android-sdk\platform tools; to your path 
26.b. If you don't know how, use the commandline: cd C:\Android\android-sdk\platform tools 

27. In this folder is adb.exe. This is the android debug bridge. 

START YOUR ANDROID EMULATOR NOW 
28. In the command prompt, type adb install C:\{path to project}\bin\{projectName}.apk 

EX: adb install C:\Sean\aa1\bin\aa1-debug.apk 

29. You should get 3 lines saying how large the installation file was, 
where it was installed, and whether it was successful. 

If it doesn't print this, either you typed in the instructions wrong, or you had an error. 
Here is more information about android bridgehttp://developer.android.com/tools/help/adb.html 


NOW, Run your android emulator. 
There should be an app named MainActivity. It was named after the class 
name. The icon is the green android. 

----------------------------- 
CONGRATS 

----------------------------- 
If you have any problems, this is the place to post them! 

2 comments:

  1. Sir could u tell me how to create an exe file of a program.

    ReplyDelete
    Replies
    1. Yeah sure, why not.
      For that you need to download Oracle eclipse, enter your coding and compile it.
      If you didn't get it I'll post it.
      http://www.oracle.com/technetwork/developer-tools/eclipse/downloads/index.html
      Thank You for reading my post.

      Delete

Unordered List

Sample Text

Powered by Blogger.

TeKPace Followers:

Popular Posts

Recent Posts

Text Widget