Problems on upgrading from m3-rc37a to m5-rc14

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Problems on upgrading from m3-rc37a to m5-rc14

Postby plusminus » Wed Feb 13, 2008 8:12 pm

Hello Community,

After upgrading your SDK from m3-rc37a :arrow: m5-rc14 you might experience, that simply no single application is running anymore. This should help you to fix your AndroidManifest.xml-Problems.

Ar first, you will have to run the emulator with -wipe-data once, because there were internal changes to the system of course!

There are several changes to the AndroidManifest.xml file that will hit you immediately when porting an application to M5 and will need to be updated. The most likely ones you will see are:

  • The class= parameter throughout the AndroidManifest.xml file has been renamed, replace all instances of class= with android:name=.
  • The android:value= parameters used throughout the AndroidManifest.xml file have been renamed, replace all android:value= occurrences with android:name=.
  • The android:id= parameters used throughout the AndroidManifest.xml file have been renamed, replace all android:id= occurrences with android:name=.
  • In <intent-filter>, the previous <type>, <scheme>, <authority> and <path> tags are now replaced with a single <data> tag and uses attributes android:mimeType, android:scheme, android:host and android:path to replace those tags respectively. A new attribute: android:port has been added as well. Without these changes, intent-filters will not work correctly.
So, for example:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <intent-filter>
  2.     <action android:value="android.intent.action.INSERT" />
  3.     <category android:value="android.intent.category.DEFAULT" />
  4.     <type android:value="vnd.android.cursor.dir/vnd.google.note" />
  5. </intent-filter>
Parsed in 0.001 seconds, using GeSHi 1.0.8.4

Would be replaced with:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <intent-filter>
  2.     <action android:name="android.intent.action.INSERT" />
  3.     <category android:name="android.intent.category.DEFAULT" />
  4.     <data android:mimeType="vnd.android.cursor.dir/vnd.google.note" />
  5. </intent-filter>
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


Take a look at the AndroidManifest.xml document for more details, or simply ask here :)

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Postby Shepherd » Mon Feb 18, 2008 9:55 pm

I found an issue in new release of SDK. I've discovered it while trying to create a basic input form.

You can check it out at API demos /app/search/Invoke search.

The problem is in displaying screen elements. If you define a lot of views (text, buttons, etc.) in a single activity you can't see it all. There is no default scrolling of activity. Is this a fault in SDK, or a fault in my knowledge of this system :D ?

Or maybe there is always a need to put a long forms in a listactivity to get default scrolling ability of a form.
Aj, pa u zdravlju se videli!
Shepherd
Freshman
Freshman
 
Posts: 8
Joined: Thu Feb 14, 2008 11:44 pm

Postby Shepherd » Mon Feb 18, 2008 9:59 pm

Forgot to mention that you have to start emulator in HVGA-L mode.
Aj, pa u zdravlju se videli!
Shepherd
Freshman
Freshman
 
Posts: 8
Joined: Thu Feb 14, 2008 11:44 pm

Postby plusminus » Tue Feb 19, 2008 5:03 pm

Hello Shepherd,

you need to wrap a ScrolLView around, like this:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4.  
  5. android:orientation="vertical"
  6.  
  7. android:layout_width="fill_parent"
  8.  
  9. android:layout_height="fill_parent"
  10.  
  11. >
  12.  
  13.         <ScrollView  
  14.  
  15.         android:layout_width="fill_parent"
  16.  
  17.         android:layout_height="fill_parent" >
  18.  
  19.                 <LinearLayout
  20.  
  21.                 android:orientation="vertical"
  22.  
  23.                 android:layout_width="fill_parent"
  24.  
  25.                 android:layout_height="fill_parent">
  26.  
  27.                         <TextView  
  28.  
  29.                         android:layout_width="fill_parent"
  30.  
  31.                         android:layout_height="wrap_content"
  32.  
  33.                         android:text="Hello World, DummyProject"/>
  34.  
  35.                         <TextView  
  36.  
  37.                         android:layout_width="fill_parent"
  38.  
  39.                         android:layout_height="wrap_content"
  40.  
  41.                         android:text="Hello World, DummyProject"/>
  42.  
  43.                         <TextView  
  44.  
  45.                         android:layout_width="fill_parent"
  46.  
  47.                         android:layout_height="wrap_content"
  48.  
  49.                         android:text="Hello World, DummyProject"/>
  50.  
  51.                         <TextView  
  52.  
  53.                         android:layout_width="fill_parent"
  54.  
  55.                         android:layout_height="wrap_content"
  56.  
  57.                         android:text="Hello World, DummyProject"/>
  58.  
  59.                         <TextView  
  60.  
  61.                         android:layout_width="fill_parent"
  62.  
  63.                         android:layout_height="wrap_content"
  64.  
  65.                         android:text="Hello World, DummyProject"/>
  66.  
  67.                         <TextView  
  68.  
  69.                         android:layout_width="fill_parent"
  70.  
  71.                         android:layout_height="wrap_content"
  72.  
  73.                         android:text="Hello World, DummyProject"/>
  74.  
  75.                         <TextView  
  76.  
  77.                         android:layout_width="fill_parent"
  78.  
  79.                         android:layout_height="wrap_content"
  80.  
  81.                         android:text="Hello World, DummyProject"/>
  82.  
  83.                         <TextView  
  84.  
  85.                         android:layout_width="fill_parent"
  86.  
  87.                         android:layout_height="wrap_content"
  88.  
  89.                         android:text="Hello World, DummyProject"/>
  90.  
  91.                         <TextView  
  92.  
  93.                         android:layout_width="fill_parent"
  94.  
  95.                         android:layout_height="wrap_content"
  96.  
  97.                         android:text="Hello World, DummyProject"/>
  98.  
  99.                         <TextView  
  100.  
  101.                         android:layout_width="fill_parent"
  102.  
  103.                         android:layout_height="wrap_content"
  104.  
  105.                         android:text="Hello World, DummyProject"/>
  106.  
  107.                         <TextView  
  108.  
  109.                         android:layout_width="fill_parent"
  110.  
  111.                         android:layout_height="wrap_content"
  112.  
  113.                         android:text="Hello World, DummyProject"/>
  114.  
  115.                         <TextView  
  116.  
  117.                         android:layout_width="fill_parent"
  118.  
  119.                         android:layout_height="wrap_content"
  120.  
  121.                         android:text="Hello World, DummyProject"/>
  122.  
  123.                         <TextView  
  124.  
  125.                         android:layout_width="fill_parent"
  126.  
  127.                         android:layout_height="wrap_content"
  128.  
  129.                         android:text="Hello World, DummyProject"/>
  130.  
  131.                         <TextView  
  132.  
  133.                         android:layout_width="fill_parent"
  134.  
  135.                         android:layout_height="wrap_content"
  136.  
  137.                         android:text="Hello World, DummyProject"/>
  138.  
  139.                         <TextView  
  140.  
  141.                         android:layout_width="fill_parent"
  142.  
  143.                         android:layout_height="wrap_content"
  144.  
  145.                         android:text="Hello World, DummyProject"/>
  146.  
  147.                         <TextView  
  148.  
  149.                         android:layout_width="fill_parent"
  150.  
  151.                         android:layout_height="wrap_content"
  152.  
  153.                         android:text="Hello World, DummyProject"/>
  154.  
  155.                         <TextView  
  156.  
  157.                         android:layout_width="fill_parent"
  158.  
  159.                         android:layout_height="wrap_content"
  160.  
  161.                         android:text="Hello World, DummyProjectX"/>
  162.  
  163.                         <TextView  
  164.  
  165.                         android:layout_width="fill_parent"
  166.  
  167.                         android:layout_height="wrap_content"
  168.  
  169.                         android:text="Hello World, DummyProject"/>
  170.  
  171.                         <TextView  
  172.  
  173.                         android:layout_width="fill_parent"
  174.  
  175.                         android:layout_height="wrap_content"
  176.  
  177.                         android:text="Hello World, DummyProject"/>
  178.  
  179.                 </LinearLayout>
  180.  
  181.         </ScrollView>    
  182.  
  183. </LinearLayout>
Parsed in 0.011 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby Shepherd » Tue Feb 19, 2008 8:20 pm

I didn't know there is a ScrollView :oops: !

Thanks!
Aj, pa u zdravlju se videli!
Shepherd
Freshman
Freshman
 
Posts: 8
Joined: Thu Feb 14, 2008 11:44 pm

Postby plusminus » Tue Feb 19, 2008 8:37 pm

No shame.

The documentation is really overwhelming ^^.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Postby WauloK » Wed Feb 20, 2008 1:47 am

I noticed the default buttons are now HUGE! They and the EditText areas are about twice as high as they were in the previous SDK! I'm going to have to resize the buttons and text areas somehow...
AndroidChi - Applications for the Google Android platform.
User avatar
WauloK
Developer
Developer
 
Posts: 32
Joined: Wed Dec 19, 2007 4:32 am
Location: Sydney, Australia

Buttons Resize

Postby daniel.kick.ass » Wed Feb 20, 2008 5:46 am

Hey Waulo,

The buttons are huge and even worse - unrealizable.
Check this post: problems_with__new_sdk__m5-t892.html

There is one simple solution while you are waiting for a legit fix from the Google team.
Change the theme of your application to "Light" in the manifest:

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <application android:theme="@android:style/Theme.Light">
Parsed in 0.000 seconds, using GeSHi 1.0.8.4

This will make the emulator to display the buttons similar to what they used to look like in m3 (except you still can't resize them).

The other solution would be to make the whole view scrollable (like plusminus outlined previously in this post).

Good luck,
Daniel
daniel.kick.ass
Junior Developer
Junior Developer
 
Posts: 19
Joined: Sat Dec 22, 2007 9:54 pm

Postby martin_nuke » Sat Feb 23, 2008 5:10 am

Hello,

I just upgraded to the latest version 5 SDK and Plugin but my version 3 applications dont work anymore so I decided to install the previous version 3 SDK and plugin but I had a problem with brining back the old emulator because the version 5 emulator still comes out even I deleted ol the version 5 SDK and Plugin.

Image

How can I restore the old version 3 emulator when I compile and run my application?

Image
martin_nuke
Junior Developer
Junior Developer
 
Posts: 15
Joined: Sat Dec 08, 2007 7:44 am

Postby plusminus » Sat Feb 23, 2008 11:49 am

Hello martin_nuke,

the difference between your two images is now probably just the skin.
If the GUI in the emulator is still the new one, you have to run your application with "-wipe-data" once.
Use the new search-functionality :uarrow: in the top-menu of this page.
Search for (with """) "-wipe-data".

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby cabernet1976 » Wed Feb 27, 2008 3:46 pm

Hi,

Eclipse looks m5's new methods as undifined, e.g. android.app.ListActivity.getSelectionItemId()
I think I must miss something after upgrading to m5.
Help me please. Thank you.
Upload2Flickr's blog: http://upload2flickr.blogspot.com
cabernet1976
Senior Developer
Senior Developer
 
Posts: 154
Joined: Fri Nov 16, 2007 2:34 am
Location: China

m5 function name changes

Postby daniel.kick.ass » Wed Feb 27, 2008 4:06 pm

What you are looking for is

getSelectedItemId

Daniel
daniel.kick.ass
Junior Developer
Junior Developer
 
Posts: 19
Joined: Sat Dec 22, 2007 9:54 pm

Postby cabernet1976 » Wed Feb 27, 2008 4:45 pm

Hi Daniel,

Thanks for your reply, getSelectedItemId is looked as undfined too. Eclipse will list previous version's methods but no method in new version.
Another 'undifined' method I got: android.database.sqlite.SQLiteDatabase.rawQuery
I think it should be the issue of Eclipse.
Upload2Flickr's blog: http://upload2flickr.blogspot.com
cabernet1976
Senior Developer
Senior Developer
 
Posts: 154
Joined: Fri Nov 16, 2007 2:34 am
Location: China

Postby cabernet1976 » Thu Feb 28, 2008 1:56 am

:roll:
Could somebody tell me how to make Eclipse work fine with the new ADT/SDK? I have updated ADT and SDK to the new version.
Or give me some comments.
Thank you very much.
Upload2Flickr's blog: http://upload2flickr.blogspot.com
cabernet1976
Senior Developer
Senior Developer
 
Posts: 154
Joined: Fri Nov 16, 2007 2:34 am
Location: China

Postby plusminus » Thu Feb 28, 2008 2:31 am

Hello cabernet,

the Eclipse-Plugin needs to be reinstalled (not updated).

Also, with all your projects you need to do:

RightClick in Project Explorer --> Android Tools --> Fix Project Properties
(or similar, my Eclipse is just closed)

that will make your app actually use the m5 sdk instead of the old m3 sdk!

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top
Next

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 5 guests