***Last updated on 11 May 2013 ***

Saturday, 11 May 2013

Rooting your LG P350

 DISCLAIMER : Iknowdroid is not responsible for any damage that might be caused to your device during this process though the possibility of any damage is absolutely negligible. Try this at your own risk. 



Well folks this is certainly something off the topic but I think you should be aware of rooting as well. Here I will focus on how you can root LGP350.

Rooting : Rooting gives you admin privileges of your phone which means you can uninstall any android app you want from your phone which are given by the manufacturer.

First of all I would like everyone to download the app Gingerbreak. Install it in your phone's internal memory.

Requirements

To root your Optimus Me P350 using the GingerBreak app, you need the following:
  • LG Optimus Me P350 running Android 2.2 Froyo(Which should not be updated)
  • USB Debugging should be enabled on your phone
  • Have a properly formatted SD card inserted into the phone
  • A file explorer app installed on your phone 
 After you have installed the Gingerbreak app in your phone follow the given steps

  1. Launch the GingerBreak app.
  2. Tap “Root device” under “Options”.
  3. Wait for a few moments.
  4. If the rooting succeeded, your phone will reboot.  Again, wait for a few minutes (around 12 minutes) for your phone to reboot. 
Check whether the Superuser app has been successfully installed and is working on your phone.  If Superuser exists and works on your phone, your phone is rooted. 

After the process completes download Titanium Backup from Android Market. Titanium Backup will allow you to uninstall the pre-installed apps from your phone. This is tested on my LGP350 you can try it on similar phones at your own risk.

Wednesday, 17 April 2013

How to play or insert music in your android application

Welcome back friends after a long time. Apologies for the delay, this tute is going to tell you as how you can play music in your android app. Well to begin with I created a new project named as "Chooseme". What I am going to do is that when I would run my application then a music will be played and that too of my own choice. :-)

Ok friends just follow the following steps which are supported by the screenshot. First of all you should know that the activity in which I will be inserting the music is named as "Home.java" which will be the home-screen or you can call the menu screen of my application.

Follow the following steps

1. Create a sub folder named "raw" in your "res" folder.

2. Right click on "res" then "New" and then "Folder"



3. Now copy any "mp3" music in your raw folder.


4. Write the following code below the line "setContentView(R.layout.home);" of your activity. Refer the screenshot

     "MediaPlayer startingmusic = MediaPlayer.create(Home.this, R.raw.musichome);
      startingmusic.start();"


Save the project and run your app. Yes thats it!! Sweet and simple

EXPLANATION

MediaPlayer - is a class which is used when handling music related files.
startingmusic - It is just a variable name you can name it whatever you want
musichome - It is the name of my mp3 file which I pasted in raw folder
Rest all is just compulsory code like Home.this implies that we are dealing with the current class.
start() - This method plays the music and similarly you can use stop() method to stop the music.
In case you face any problem comment here.

Monday, 1 April 2013

How to insert a cool background in your android application

Well folks this tutorial is going to tell you as how you can get a cool background for your android app. The final product after this tutorial is going to look like this.
Step 1

Get a 400 X 600 image or crop an image of somewhat this dimension. Save it as a png format. In case you have a jpeg image convert it into a png. Edit it using paint and then save it as a png. The reason why I am focusing on png is that it is a standard image format.

You can download the background image that I have used from here : Background.png

Step 2

Save this image to the drawable-hdpi folder. See the screenshot below.

Step 3

Open the layout in which you want to insert the background image and add the following code in the layout

android:background="@drawable/bgimg"


And thats it you are done. Your final code should be like this.




Friends only have a look at the code that has to be inserted. I have used Android 4.2 here but that does not matters. In your android 2.2 development only add the "android:background" line to the respective layout. Any confusion or issues just comment here.

Friday, 29 March 2013

PART 4 : the finishing touch

hello everyone ,
here we are now to the final step of development, ie, adding the functionality, thinking it the logical way what actualy we want our app to do ?
to increment the counter and display the value in text (On addition)
to decrement the counter and display the value in text (On subtraction)

 Getting to work

In the onClickListener method,  below the "// TODO Auto-generated method stub"define the funtionality
for addition :-
                counter++;
                display.setText("your total is "+counter);
for subtraction :-
                 counter--;
                display.setText("your total is "+counter);
 the code will look like this
check to see if you have missed anything

EXECUTING THE APP 

  • select the application from package explorer
  • right click > Run as > 1 Android application
  •  The app will load onto the Emulator

thus we come to the end of making this app , this isnt much diffficult one but its very nice one to basically, explain the steps required in every android app. 

For any query comment below , and subscribe for more android development

cheers :)

PART 3 :Adding the funtionality


hello everyone ,
 hope you have up till now done the xml part , so now we will be adding the functionality to our app. That will be done by the java. If you have some basic knowledge about JAVA it will be helpful here , if not dont worry just follow the steps carefully , i will be explaining everything.


STEP 1 : Initializing the variables

  • go to the  Mistic > src > com.game.mistic > MainActivity.java  .This is where the java class is, open it and you will find something like this .

  • after this initialize the variable , here we will be needing add button , subtract buton and the textview to show our output. For this initialize the variables as shown below. Initially you will be having some error , for that you have to import the packages (importing packages mean to get the definitions for the keywords we are going to use). For this  just hover over the keywords (here Button and TextView) and click on import (the first option in yellow box).


STEP 2: connecting the java class with xml file  

  •  For this in OnCreate method  add below code   

     add = (Button) findViewById(R.id.badd);
        sub = (Button) findViewById(R.id.bsub);
        display = (TextView) findViewById(R.id.tvDisplay);  
                  This will allow the java program to know from where to take the values, ie from where it is    taking response

STEP 3: Adding the listeners

  • In this step will will be adding listeners which will listen to the user's activity.

  • add the listener  add.setOnClickListener( )     (just type add.setOn    and Eclipse will suggest you this one .)

  • take the void listener and in place of null write new.ViewOnClickListener() again this will be suggested by the eclipse so you dont have to worry about the method it defines.

  • Note: Since java is case sensitive so take good care of cases(uppercase/ lowercase)

  •  After this add one more listener for adition ie, sub.setOnClickListener()


    Uptill now will will be having this , after this will will be assigning the work to our listeners

     

     for any query or suggestions comment below or share this post so that others can also benefit from it .

     

     

Wednesday, 27 March 2013

How to backup android apps

Well people often face situations when they have to reset their phones due to many reasons(viruses,lags etc). But often they are caught in the dilemma of how can they backup their original apk files into their memory cards so that they do not lose their important games or applications. Let me make it a bit simple for you. When you reset your phone you just lose your downloaded android games and applications. I am going to tell you an amazing way to save your money, time and internet data. Just follow the following steps.

Step 1

Move all your downloaded applications in the SD card.(For applications that you can not move to SD card just do not use them, find alternatives. Developers must ensure that their apps should be movable to SD card)

Step 2

Now download this magical File Manager.I found it on the Google android market.
File Manager

Step 3

Install and move this File manager too on the memory card, so that you can take its backup also.

Step 4

Open the newly installed file manager. It should be having a yellow folder icon. See the screenshots.

Step 5

Touch the green "Up" button which is next to HOME button in the app.


Step 6

Now touch the "asec" folder.

Step 7

Now you could see the package names of the applications that you have installed from anywhere. Just touch/click the "Multi" button to select multiple folders. COPY them and PASTE them to your SD card. And yayeeee!! now you can reset your phones.
For those who have alternate methods please comment here!!!

Friday, 8 March 2013

Part 2: Setting up the xml

Hello there continuing from where we left ie, activity_main.xml 

copy the below code in between  the xml file where linear layout has been defined

 


after this xml part is done. (dont worry will come to explaining the code shortly )

Moving on to strings.xml located at   res>values>strings.xml 

 here the name is the variable we used in xml to reference the string defined in value. It is done so that if we need to change the variable we may change the value from here only and the value will be changed from complete application (off course where we have defined the variable)

for example: name app_name is defined with value my first app, this means if we want to change the name of our app all we need to do is change the value here and name will be changed from every where wher variable app_name is used.

to make attributes click on add > select String> enter the values for name& value, and you are done.

 

here we have used values as below


 

EXPLAINING THE CODE

So the section where we understand what everything we just did, comes here :)

<TextView  //defining the text area and the text to be displayed        android:layout_width="fill_parent" //defines the width of text area
        android:layout_height="wrap_content"// defines the height of text area
        android:text="@string/head" // this is where the variable head is defined      which has value in strings.xml
        android:textSize="45sp"  //defines the size of text
        android:layout_gravity="center" // defines the layout alignment
        android:gravity="center" //defines the text alignment
        android:id="@+id/tvDisplay" // defines the id. it will be used later in funcionality
        /> // closing the textview tag

 

After this we defined the two buttons one for add other for subtract, the attributes we used in them too are similar  and differ in id, and text. and ofcourse we used button tag for buttons<Button></Button>

So this was all for today after completing till here we will be having output that may look like this

 for any query or suggestions comment or share .

 

 

 


Friday, 1 March 2013

Android :some serious work :P

hello pancakes !!  this is my first post here hope you like me too as brijesh :)
so starting for the first app ..

  • Open up new android application and continue as explained previously, if you get any problem with that check the procedure again here .


making new program

  • After you complete with making g it you will get the starting screen .Up-till now everything is just as we previously did .hence forth the real work starts. we will be working on activity_main.xml first.
  • On activity_main.xml we will automatically be having some content as shown below and for rest we will be adding  some other things too.
  • EXPLAINING THE CODE 
    The first segment we have here is
    1.   <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     2.   xmlns:tools="http://schemas.android.com/tools"
      3.  android:layout_width="match_parent"
     4.   android:layout_height="match_parent"
      5.  tools:context=".MainActivity" >
    1.   This line is default which actually import pacakages.
    2. This line defines the where to import the android tools.
    3. android:layout_width defines the width of our app on emulator.
    4. android:layout_height defines height of our app on emulator.
    5. This line defines where to start ie, MainActivity
    The second segment we have is 
          1.  <TextView
          2.    android:layout_width="wrap_content"
          3.  android:layout_height="wrap_content"
          4.  android:layout_centerHorizontal="true"
          5.  android:layout_centerVertical="true"
          6.  android:text="@string/hello_world" />
    1. It marks the beginning of Textview tag which actually contains the features about how things are to be arranged in text view
    2. the other tags are preety self explainatory , you may try on some of them yourself by deleting the values upto = and eclipse will come to your service.
    3. in last one android:text="@string/hello_world" we actually referenced the string hello world saved in values. in other places too we will be using the same .

Monday, 25 February 2013

Learn android : Your first sensible app (PART 1)

Welcome back folks. From this post onwards we will continue with the development of something sensible.
Ok first of all the screenshot below will show you the views of the layout: graphical and the one which allows you to code.

You can drag-and-drop in the graphical interface and write the code in the other. We will be using "coding" not the graphical part. We will use it just to have a quick preview.



Now for the most of the part I will be talking about the XML code only. Beginning from now I am going to explain each and every line.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

This is your first line, you dont have to remember it as it is generated by the IDE itself. The main part that has to be noticed is that the Layout type mentioned here is relative.
And we will change it to a Linear Layout since we are still a beginner, so consider that Relative Layout at this point of time is not better for you. Please follow the following screenshot to change it to a Linear Layout.
Same as you do in HTML, you have to open and close the Linear Layout Tag.





When you see the layout in your graphical view. You wont find any changes but that doesnt means that they are the same. We will go deep into it further later. You have to deal with Linear Layout just keep that in mind.

The next post will be about some of its attributes and their respective explanations.


Friday, 15 February 2013

Project Exlorer Explored(CONTINUED)

Now some remaining folders :

assets,bins,libs : Dont care about these folders. Not important at this point of time .Ther have just some library files.

res :  This is the most used folder. Please be very particular about this. This will contain everything. The resources which you use such as "images","sounds","animations" etc. Go in this. It has been categorized for our convenience. We can add the categories as per our choice too.


1. drawable-xxxx
   The drawable folder has 3 sub folders and is differentiated on the basis of image quality. And yes it stores images. See phone has different resolutions and you simply can't use an image of 240*320 on your screen of 800*600. So to allow your app to be more user friendly or rather phone friendly these folders have been defined. The high resolution images can be sent to drawable-hdmi, medium to drawable-mdpi..and so on. When we will go more deep into it we will discover more about them.

2. layout
 This is used to store the different XML layouts we are using.You will see in it our home.xml file.

3. menu
   Menus are also layouts and this will store them. Menu is something where you see stuff like "About Us","Help" etc. in your android apps

4. values
    This folder is generally used to store some values. Just take it that way we will be discussing it later as we use it practically for better info.

Thats all in the Exploring stuff section.GOOD NEWS.ALL the boring part is over :-)
From next post the droiding fun begins.

Monday, 11 February 2013

Project Explorer Explored

What is "src" in my Project Explorer? 
As stated earlier by me in Android development we are going to deal with JAVA files and the XML files for most of the part. Every java file that you create goes in the source or "src" folder. The basic funda is that XML files will be developed to create layouts, how your app looks and then it will be embedded in the JAVA file(some how, I will tell you) to give it a proper functioning. For web developers it is just like making an html login form and then doing rest of the part through your php/C#/JSP programming.

Inside the "src" folder you can see the name "com.myfirm.myapp"
"com.myfirm.myapp" - is a package 

A package is nothing but a container of classes.
Those new to the concepts of programming think package of a folder which will store all the classes(i.e. *.JAVA files)


What is a "gen"?
Seriously speaking just don't care about this. It is a folder that contains the automatically generated files by JAVA. We use it very often(we will come to that part later). It is in the same package. BuildConfig.java : I dont know about it because I have never used it.
R.java : This is an automatically generated file. I am just telling you its use. It is used to let your graphic,sound,button elements to be read in programming. It basically sets up your resources(audio/video/images) so that we can use them in our Java files.

What is that thing "Android 2.2 and Android Dependencies"?
Well they are nothing but packages, they contain jar files. Jar files contain classes. Classes contains methods/functions which we can use to make our applications do something. For example if we are making any camera based application. Then to read the image we took we need some functions. Those will be provided to us with the help of these. We are working with Android2.2 that is why the name.
<<<<TO BE CONTINUED>>>>

Friday, 8 February 2013

Layout In Android

Well Hello, Today we are going to learn about Layouts. What are layouts? But first you all know that an android app consists of several screens or windows rather. For example when you open Angry Birds what you see first is a Welcome screen loading some stuff, then you see a screen where you choose the level you want to play etc. Well designing those screens and how they should look is all about layouts. For making android apps we will be using XML for layouts. See the following screenshot. The area marked as red has two tabs.

1. Graphical Layout : It is where you see how your layout/screen will look after you are done with your app. Dragging and dropping elements can be done here.


2. home.xml : It is the xml file that will be used for designing the Home class/activity's screen. Which means when your apps runs in your phone. Whenever the the Home Activity or the Home Class(Both are the same thing)  is run you are going to see the layout designed in home.xml. Any change done while dragging and dropping in the Graphical Layout will be reflected into your xml file. Beginners please do not use Graphical Layout for designing now. We will be using XML only and there is no need to refer XML as it is not required. So if you do not know XML, don't panic.

All the layout files must be stored/saved in res/layout

res : res is the resources directory in your project. Here all the project related data such as sound, buttons, animations,background images,icons etc. are saved.

These are somethings that I have covered in this post. Rest later..You can try changing the text "hello world" for the time being and see the changes reflected on the layout. By default the layout used in our xml file is Relative Layout. I will throw more light on that in my next post. For any queries shoot me with comments.

Tuesday, 5 February 2013

View your Hello World Application on the Emulator

This post is for extreme beginners and will tell them how to view any project on the Android Emulator. Here we are taking the Hello World App that we made in the previous post. Just follow the screenshots.
1. Open Windows Menu->Android AVD Manager












2. Select your AVD and click start













3.You will have the following "whatever"













Just click launch. Your emulator will be launched in few seconds. For admin privileges it might ask for your permission just allow the damn thing. Don't forget to unlock the screen just like in any android phone.

4.Now run your project. Right Click your project name on Project Explorer(See I told you its very useful). Click RunAs-> Android Application

Yuhuuu wait for a few seconds and its there in your emulator.


5. My emulator screen looks like this now.
IN CASE YOU HAVE SOME PROBLEM SAME OLD THING DROP A COMMENT OR MAIL ME. WILL BE BACK SOON WITH SOME IMPORTANT CONCEPTS


Setting up your first android project


This post will focus on how to setup your first android project. Sorry for being tooooooooo late. Just follow the screenshots.


1.This will be your default screen when you will open Eclipse. The project explorer is basically...let me think...yep its like a browser window that will show all the files related to your project.













2. Now go to File->New->Project. You will get the following window. Select the Android Application Project and Click Next.



3. Now as told earlier we will be developing applications for Android 2.2. Enter the relevant details. Explanations are given in the screenshot. Change the application name as you see in the screenshot. You can give it any name you want, but for learning purpose and to avoid any mistake just follow what I am doing.


4. A custom launcher icon is the icon of your application. For example you see birds
in Angry Birds Application icon..same thing. Those familiar with java or C++ Activity in android are nothing but another term given to classes.
Workspace is the location where your projects are saved on your hard drive.

5.  Browse the launcher icon. Doesn't requires any explanation




6. Now create the activity class. For the time being make it a Blank Activity.Click next.




7.  Follow the screenshot.



8. Click finish and your final screen should be like this.

 
More Explanations would be given in next post + We will begin with the layouts. Any queries, suggestions just leave here. Video Tutorials are in progress but first lets see the demand. For those with limited data plans, these tutes are specially for them.

Friday, 18 January 2013

Android Series : Part 2 - Exploring your emulator(AVD Manager)

Welcome back folks, if you followed me till the last tute then we are ready now. But before we begin you must be aware about the AVD Manager. Now prior to that when we develop an app each time we would not be creating an executable apk to directly test them on our phones. We will be using an emulator for that. Eclipse provides to you an inbuilt android emulator. Before using it we should first configure  it as per our target machine. I have an android phone with a resolution of 240*320( width * height) with Android 2.2 (Don't you dare laugh when I got my first android it was the latest Android Version) on it. Now I am going to show you how you have to configure it. I will be configuring it according to my phone, you just replace mine configs with yours. Confused? Just follow the screenshots.Wait! Wait! open eclipse , goto windows menu, select Android Virtual Device Manager, now follow the screenshots :-)


1. If you dont have this option in your Windows menu you did something terribly wrong. No need to worry read my earlier posts or drop your message.






2. Now you get a following window. In case you already have setup your Emulator no need to proceed further if not or you are confused please continue.




 3. After clicking NEW you get the following window.



AVD NAME : You can write watever name you like.

DEVICE : I set it according to my target machine's resolution. Since I physically test my apps on that hence 240*320.

 TARGET :Compulsory- Make It Android 2.2. We are learning with Android 2.2

CPU/ABI :ARM Processor (I will not go in depth of  it wiki it)

Make all the settings as per the screenshots as they are self explanatory.















4.Press OK

 In case any problem or queries(WHY,WHAT,HOW)  leave comments or drop a mail. Next we will start with the very famous Hello World Application. :-) And also Install Adobe CS3 Suite for designing graphics for our applications. I will give you a small intro of it. That is all for today.Tired.

Thursday, 17 January 2013

Android Series : Part 1 - Basics Continued

Continuing from where we left I suppose by now you would have downloaded the android bundle. Extract it using any compression/decompression tool. You will find in it Eclipse IDE. Open it and now we will configure Eclipse for Android 2.2 development , follow the following instructions-
1. Open Eclipse with Admin privileges (Right click.Run as administrator)
2. Go to Windows menu and open Android SDK Manager.
3. You will get checkboxes for each respective Android version available. You have to check             Android    2.2(API Level 8). We will get further into the details of API etc. later. Refer the screenshots.

4. Click Install Packages. A license agreement window appears with probably 3 radio buttons. You have to select Accept All.

5. Click Install

This particular download in most cases is not resume supported. So do not disconnect your internet connection or you might have to re-download it again from beginning. After your downloading is finished you will get the status as "installed"



Now we are done with it. In case you face any problems leave comments. You can also send me screenshots of the problems you are facing on my email id please don't poke me on my facebook account. This post is dedicated to my friend Himanshu Singh for his immense support(which he never gave and emotionally blackmailed me to write his name). :-)

Android Series : Part 1 - The Basics

In order to develop applications in Android it is a must for you to have basic JAVA programming concepts. Those who are familiar with Struts framework in Java you won't face any problem at all. Android applications are also developed in other languages also but  it is a lot more comfortable in JAVA so I am going to code in JAVA. If you have  knowledge of any programming language you can easily migrate to JAVA. In case you have any problem in migrating just let me know, I might be able to help you. Unlike other blogs I have decided to make a separate post for everyone's problems(technical). Now for today just follow the following instructions : - 
1. Open the following link 


2. Click "Download the sdk" on the left hand side.
  
 3. After clicking you would get a license agreement page and believe me its fun to read it so if you want you can read it for sure. Now the very important part that I forgot to tell you is that we will be developing our apps on Windows 7. Those who still have Windows XP please install Windows 7 too and those running Windows 8 please downgrade yourself to Windows 7 your pride won't suffer believe me. Those having problems installing Windows 8, better google it or ofcourse I am ask me. Accept the license agreement.  You will be getting two radio buttons 32-bit and 64-bit. Download as per your OS versions.

4. The download is resume supported so using a download manager would be best.

You might be curious to know the inside of the bundle so let me tell you. It would have Android SDK(Software Developer Kit) and  Eclipse IDE. Like Netbeans or any other IDE we use Eclipse for android development. Why we wil not use Netbeans is because I learnt it on Eclipse , most of the people of the world learnt it on Eclipse and so will you. However you can experiment later with netbeans.

Wait for the next post now the tutorial is getting too heavy

Wednesday, 16 January 2013

Android Application Development Series

Hello everyone I am going to start an e-learning series for Android. This series will be strictly for application development only. Concepts of gaming will be discussed but a lot of patience is required. However my focus would be more on application development and also how can you monetize your apps and earn! Yes! earnings don't get excited its a long journey till there. People thinking that it is a crash course please don't open this blog again. The future of the blog solely depends on you. Feed backs are important.Queries are welcomed. Enjoy droiding!!!