I will try to write three simple apps to investigate the use of Android Studio. And try to see whether Android Studio is better or Eclipse is better. Although now from the User Interface seems Android Studio can immediately display the preview beautifully, most of us are familiar on using Eclipse to develop Android application.
A. Very Simple Hello Word Application.
Below are the Steps to create a new Project:
1. Click "File" on the top menu, the click "New Project..."
The following screen will pop up and shown:
And you can fill in the Application name you want and choose the SDK correspondingly.
The option "Create activity" is default selected.
Then fill in the form and clicked "Next":
3. After that you can choose which kind of activity to be created, here I just simply just the empty activity as it is just a simple testing hello world application:
4. Next you can enter the Activity Name and click "Finish"
Oops... Suddenly this error occurred:
Failed to set up project 'HelloWorld':
You can find all errors in the 'Messages' window, under the 'Gradle Sync' tab.
When I clicked the link "Open Messages Window", one occurrence is found:
dependencies {
compile 'com.android.support:appcompat-v7:19.+'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
My solution for the above problem is as follows:
As I found that when I used the cursor to touch the 'com.android.support:appcompat-v7:19.+' , a message is shown: " ... but the SDK installation does not have the "Extra > Android Support Repository" installed. ..."
Thus after I open the SDK Manager and installed the component it mentioned. My project can run smoothly the Gradle Sync works fine.
5. You should now see the "Hello World" text shown in the mobile emulator screen. Seems Android Studio will automatically help you to insert the HelloWorld string for relevant project name.
If the text is not shown, you can drag the "Textview" from the left hand side and amend the content in Properties -> text. After that you can click extract and create the resource if you like to create one.
6. Click the "Save" button and then click "Run". After the gradle sync process run successfully, a form will pop up. Then you can choose which device or emulator to be used for running the application. Wait until the whole process done. Then you can check your phone or device. The application should be well installed on it.
You should see the following screenshot on your phone or on your emulator:
I have amended the text ... haha
Remarks:
At this stage, although the steps are little bit simpler compare to Eclipse as it does not need to touch any codings, I spend more time to finish this simple HelloWorld just because some error occurred. I hope these errors will just appear at the beginning. Nevertheless, it is just a preview version so facing errors is the thing that I expect. Next, I will try to make an Alarm Clock application as I saw the clock elements are ready on the left hand side at the Design Panel which seems very convenient to me.
Using this Android Studio to build apps seems don't need to involve codings or technical stuffs "yet".
As I found that when I used the cursor to touch the 'com.android.support:appcompat-v7:19.+' , a message is shown: " ... but the SDK installation does not have the "Extra > Android Support Repository" installed. ..."
Thus after I open the SDK Manager and installed the component it mentioned. My project can run smoothly the Gradle Sync works fine.
5. You should now see the "Hello World" text shown in the mobile emulator screen. Seems Android Studio will automatically help you to insert the HelloWorld string for relevant project name.
If the text is not shown, you can drag the "Textview" from the left hand side and amend the content in Properties -> text. After that you can click extract and create the resource if you like to create one.
6. Click the "Save" button and then click "Run". After the gradle sync process run successfully, a form will pop up. Then you can choose which device or emulator to be used for running the application. Wait until the whole process done. Then you can check your phone or device. The application should be well installed on it.
You should see the following screenshot on your phone or on your emulator:
I have amended the text ... haha
Remarks:
At this stage, although the steps are little bit simpler compare to Eclipse as it does not need to touch any codings, I spend more time to finish this simple HelloWorld just because some error occurred. I hope these errors will just appear at the beginning. Nevertheless, it is just a preview version so facing errors is the thing that I expect. Next, I will try to make an Alarm Clock application as I saw the clock elements are ready on the left hand side at the Design Panel which seems very convenient to me.
Using this Android Studio to build apps seems don't need to involve codings or technical stuffs "yet".



