Archive

Archive for the ‘Tools’ Category

Viewing logs and exceptions in Android

November 9, 2009 Leave a comment

We moved. Please visit this link for this post.

 

 

 

I found that there is no logcat console in android plugins for NetBeans and IDEA 8.

But when you develop application you need to see exceptions or see simple log.

I am going to show how easy is to see all these things in system console.

At first you should have installed Android SDK.

At second type in your console:

adb logcat

Note: emulator instance should be working.

Advertisements
Categories: Android, Android how to, Tools

Changing Android Emulator’s orientation

October 27, 2009 Leave a comment

We moved. Please visit this link for this post.

 

 

 

It’s important to test your application on different layout orientations and also on different screen sizes.

I am going to show how to change your emulator orientation.

The solution is next:

Switch to previous layout orientation (for example, portrait, landscape) - KEYPAD_7 or Ctrl-F11
Switch to next layout orientation (for example, portrait, landscape) - KEYPAD_9 or Ctrl-F12

Note:

If you prefer to use KEYPAD_7 or KEYPAD_9 you need to turn off your Num Lock.

As you see it is very easy.

Categories: Android, Android how to, Tools

Putting files on SDCard in Android

October 17, 2009 Leave a comment

We moved. Please visit this link for this post.

 

 

 

If you have SDCard which is mounted to the Android emulator then you want to put some files. I will not describe how to do it in Eclipse IDE. I will describe how to do it by command line. For this operation need to use Android Debug Bridge

This is very simple operation (don’t forget to mount SDCard):

adb push <source path> /sdcard/<filename>

Example:

adb push C:/image.png /sdcard/image.png

That’s all.

Categories: Android, Android how to, Tools

Installing an application on Android emulator

October 17, 2009 1 comment

We moved. Please visit this link for this post.

 

 

 

If you work in IDE you don’t install your apk file manually on an emulator. This operation do ADT when you start application.

But sometimes you need to install it manually on an emulator or device instance.

I am going to show how to do this operation from command line. For this need to use Android Debug Bridge

adb install <path_to_apk>

<path_to_apk> – path to apk file which need to install

Example:

adb install D:/release/WallpaperChanger.apk
Categories: Android, Android how to, Tools

Using Android Virtual Devices (AVD’s)

October 14, 2009 6 comments

We moved. Please visit this link for this post.

 

 

 

What is the AVD? AVD is an emulator instance with specific configurations.

Creating the AVD

Need to enter this command:

android create avd -n <name> -t <targetID>

-n – name of creted AVD

-t – target ID, please check allowed targets by entering

android list targets

Select for which target need create AVD

When you enter this command you should receive a question which ask you whether you want to create a custom hardware profile. If yes then you should go through all steps and after that you will create custom AVD’s hardware profile.

Example:

android create avd -n my1.6 -t 2

I created AVD with name my1.6 for target 2(in my android SDK target 2 is Android 1.6, API level 4)

We created this one. What about moving AVD to the other location? Read more…

Categories: Android, Android how to, Tools

Emulating SDCard in Android emulator

October 13, 2009 Leave a comment

We moved. Please visit this link for this post.

 

 

 

If you don’t know how to create SDCard image please refer to Creating SDCard for Android emulator.

This procedure is simple.

There are 2 ways.

First

This command need to run when you have running emulator instance

emulator -sdcard <filepath>

<filepath> is a path to the SDCard image. Example:

emulator -sdcard C:\My.iso

What I did? I loaded my image which located on C:\My.iso to the running emulator instance.

Second

This command is useful when you create new emulator instance.

android create avd -n <avd_name> -t <targetID> -c <path_to_sdcard>

Example:

android create avd -n NewEmulator -t 1 -c C:\My.iso

What I did? I created new emulator instance called NewEmulator and load SDCard image which located on C:\My.iso. Now NewEmulator instance will always load automatically this SDCard image.

Is this information useful for you? Leave the comment.

Categories: Android, Android how to, Tools

Creating SDCard for Android emulator

October 13, 2009 2 comments

We moved. Please visit this link for this post.

 

 

 

There are 2 ways how to create SDCard

First

Android SDK contains tool which called mksdcard. This tool helps with this process. It works from command line.

Usage:

mksdcard [-l label] <size>[K|M] <file>

-l – A volume label for the disk image which need to create

size – An integer value which specify size of image. It is possibility to specify size in kilobytes or megabytes. Examples:  1024K or 1M

file – The filename/path of the disk image

Ok. Now we know all parameters and can create needed disk image.

Just type command which is below with your parameters.

I used:

mksdcard -l sdCard 128M C:\sdCard.iso

Second

Android SDK also contains android tool.

android create avd -n <avd_name> -t <targetID> -c <size>[K|M]

-n – name of created emulator

-t – target ID of emulator instance. Type

android list targets

and you will find out which target IDs are allowed

-c – size of created SDCard

In my case I type:

android create avd -n MyEmulator -t 1 -c 10M

What I did. I create emulator instance called MyEmulator with SDCard image which has 10 megabytes.

As you can see it is very simple operation.

Is this information useful for you? Leave the comment.

Categories: Android, Android how to, Tools