This blog assumes that you have some basic knowledge in using the Eclipse IDE and the Java language. However, if you are new to the Eclipse and/or Java, there is a great video tutorial that can be found here (http://eclipsetutorial.sourceforge.net/totalbeginner.html). The same people there also makes a great video tutorial on the Eclipse workbench - the link to that is on the same page at the given URL. If you'd rather read than watch a video, the Eclipse IDE tutorial found here (http://www.vogella.com/articles/Eclipse/article.html) is a good stating point for learning about Eclipse. As for Java, there many great tutorials found on the internet - just use Google to search for them. Also, for a total beginner to Java, the "Java For Dummies", 5th Edition book is very highly recommended by the author.
Now let's start our journey, but before you begin your journey into Android software development, let me point you to the most useful resource that you can use for reference during your journey. This is, of course, Google's Android Developer web site (http://developer.android.com/develop/index.html).
When you arrive at this page, you will find 5 links at the top (2nd line) for Training, API guides, Reference, Tools, and Google Services. You already have visited the Tools web-page during the download of the Android SDK package. The other web-page that are of immediate interest to you at the moment is the Training page - so click on it - you will be greeted with the 'Getting Started' page. Of course, if you are a total beginner at developing Android software, you will spend some considerable time at this site, so I suggest that you bookmark it.
Where to start Android programming? At the beginning, of course, i.e., 'Building Your First App'. You can follow the steps outlined on the resulting web-page when you click on the 'Building Your First App' item or you can follow the same steps given below. The steps below shows more screen shots of the process - so if you are a total beginner, this may be of help. The choice of which to follow is entirely up to you.
- Start Eclipse and then click on the New button found in the toolbar (see figure below)
New project start - In the New project window that appears next (see figure below), expand the 'Android' item by clicking on the arrow to the left of the name and selecting 'Android Application Project'. Then click Next.
Android application project selected - Fill in the form that appears (see below) with the data shown. Note that after entering the Application Name, the Project Name and Package Name is automatically filled in - do not change this. The 'Minimum Required SDK', 'Compile With' and 'Theme' has also been filled in with the correct data - in my case, I have only to change the Target SDK to 'API 17: Android 4.2'). Then click Next.
New Android app data - Click Next when the 'Configure Project' screen (see below) appears.
Configure project - Click Next when the 'Configure Launcher Icon' screen (see below) appears.
Configure launcher icon - Click Next when the 'Create Activity' screen (see below) appears.
Create activity - Click Next when the 'New Blank Activity' screen (see below) appears.
New blank activity - In my case, an 'Install Dependencies' window appeard next (see below). Note that you may not see this screen if all the dependencies have been met. If this screen appears, you need to install or upgrade the dependencies before you can proceed with the project - so click on the 'Install/Upgrade' button. The package selection window (shown below) will appear with all the dependent packages pre-selected - click 'Accept All' and then 'Install'. The package(s) will be downloaded and installed. The 'Install Dependencies' screen will reappear - click the Finish button.
Install dependencies
Dependencies selection
Dependencies download and install
Dependencies installed - The main Eclipse workbench will reappear after a while (see figure below) - your first Android project has now been set up with some default files.
Workbench with first project
Note that the project that was just created includes a default "Hello World" source file that allows you to immediately run the application without having to enter any lines into your project.
- Now we will test out the application on the AVD you have previously created. First, make sure that you do not have any Android device plugged into your PC (we will test it on an actual Android device later). Then click on the Run button in the toolbar (see figure below).
Run the app - A Run As window will appear (see below) - select Android Application and click OK.
Run As window - The program will run and the AVD will appear - if this the first time you are running Eclipse, you may get an Auto Monitor Logcat window popping up as shown below. Click OK if it does.
Auto Monitor Logcat window - The AVD login window will appear (see below) - slide to unlock and the output of your first Android application will appear in the AVD (see below).
Slide to unlock
MyFirstApp output - If you press the 'Home' key and then the 'Applications' icon (as shown below) - you can see that your My First App will also be listed in the available applications.
Applications icon
My First App listed
Before you do any else, I suggest that you visit Google's Android Developer web site (URL given at the beginning of this blog), and then click on 'Tools' and 'Workflow' and finally 'Using Hardware Devices'. Acquaint yourself with the contents that appear- it gives clear instructions on how to set up and connect a device for testing during software development. The required steps are replicated here for your convenience.
- Since you are using Ubuntu/Mint Linux, all you need to do is open a terminal and execute:
sudo nano /etc/udev/rules.d/51-android.rules
This will open a blank file in which you need to enter the following:
SUBSYSTEM=="usb", ATTR{idVendor}=="4-digit-number", MODE="0666", GROUP="plugdev"
Replace the idVendor with a 4-digit hex number for your device - the web-page mentioned above has a list of the vendor's IDs listed there. Find the id for the vendor of your Android device on the and enter it into the file. Save and close the file. Then execute the command:
sudo chmod a+r /etc/udev/rules.d/51-android.rules
Then close the terminal.
As an example, for my Samsung Galaxy Tab 7.7 Tablet, I looked up the idVendor and found it to be 04e8 hex. So the line I entered looks like:
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
- Make sure that USB debugging is enabled on your device - the settings can normally be found at Settings >> Developer options but may vary from device to device, but it is always located in Settings.
- Connect your Android device to the PC via a USB cable. You may get one or more windows pop-up asking you what to do - select 'Do nothing' in all cases and then press OK. You may also get an error message saying that Ubuntu is unable to mount the Android device - click OK to dismiss the message, i.e., we will ignore it.
Now open a terminal and execute the following commands:
cd adt-bundle-linux-x86/sdk/platform-tools
./adb devices
If your Android device has been connected correctly, you should see something like this:
List of devices attached
464119060136df1f device
- Click on the Run button on Eclipse and a Device Chooser window (shown below) will pop up. Select the device and click OK.
Device Chooser window
After a brief period, the application will run and the same output as before will appear on the device. MyFirstApp will also appear in the Applications list of the device. I did not include any screen-shot displayed on my brand new tablet devices as I do not know how to do screen capture on the tablet - yet.
Wow Great information about toolbar. Toolbar is best way to increase your internet work speed and also increase online profit. Custom toolbar increase your online reputation and branding also. Learn more about Toolbar development then visit our website.
ReplyDeleteWow great information about toolbar development. Hire toolbar developer exhaustive analysis is capable of reshaping toolbar solutions with accuracy and precision. Here, cutting-edge technology in collaboration with cost-efficient methods is the stand-out corner for toolbar developer.
ReplyDeleteThanks for sharing Good InformationAndroid Online Training Bangalore
ReplyDeletetesting tools online trainings
ReplyDeleteselenium online trainings
python online training
SAP ABAP online training
SSAP PP online training
MMORPG OYUNLAR
ReplyDeleteInstagram takipçi satın al
tiktok jeton hilesi
Tiktok jeton hilesi
antalya saç ekim
Takipçi satın al
instagram takipçi satın al
Mt2 pvp serverler
Takipci satın al
ataşehir bosch klima servisi
ReplyDeletekartal mitsubishi klima servisi
üsküdar vestel klima servisi
beykoz bosch klima servisi
üsküdar bosch klima servisi
beykoz arçelik klima servisi
pendik mitsubishi klima servisi
tuzla vestel klima servisi
tuzla bosch klima servisi