Programming/Non programming

Tuesday, September 6, 2011

Android: Invalid file name: must contain only [a-z0-9_.]

Android:

When we create the new layout in Android project, we might encountered with the following error and looking for solution.

Error:


MyApp] res/layout/MyFileName.xml: Invalid file name: must contain only [a-z0-9_.]



Solution:


In the Android development, we might have created the layout with ".xml" extension. I created a layout as "MyFileName.xml". I got the same error.

The problem is, do not create layout with uppercase letters. The solution would be in my case is "myfilename.xml". So, create the layout with all lowercase letters.


Good luck!

M.P.Prabakar.
Tech lead.
Mobile app development.




Thursday, August 11, 2011

How to resize Android Emulator if it is too big?

How to resize Android Emulator if it is too big?


Issue:

Android Emulator is too big and unable to see options available in the bottom

Solution:

1. Launch Eclipse. I hope, it must have launched already.
2. Choose your project. Click on "Run" menu and choose "Run Configurations".
3. Choose your project from left window Android application section.
4. Choose "Target" tab from right side window.
5. There will be a option called "Additional Emulator Command Line Options" in the bottom of "Emulator Launch parameters".
[NOTE: If you are NOT able to see this option, it must be hidden there, you can drag Run Configurations window little more and make it big in the bottom. You will see this option. ]
6.  Add "-scale 0.8" this value without quote, in that "Emulator Launch parameters" field.
7. Click on "Apply"
Then, you can simply run your project as usual, the newly resized emulator will be launched. This is permanent solution for who are facing this issue.

Good luck guys!

Cheers!

M.P.Prabakar.
Tech lead, Mobile application development.


Tuesday, August 9, 2011

Android: Debug Certificate Error

Issue:

Sometimes when we upgrade Eclipse and Android, and try to build or run project, Eclipse may throw error as "Debug Certificate Error".

Reason:
Once debug.keystore file is created, it works for one year only. To work for another year, follow the below simple steps.

Solution for Mac users:

Close Eclipse.
Go to "~USERS/.android/" and remove the file "debug.keystore" (or) move(cut & paste) this file to another location.
Launch Eclipse again and build/run your projects.
It should create new debug.keystore file automatically to work for another a year without any issues.


Cheers! Enjoy reading this blog..

M.P.PRABAKAR
Tech lead Software mobile development.