[android-developers] ProgressDialog doesnt show when called...?

2009-09-22 Thread Feras

I have 2 questions actually, while we're on the subject :)

1.  I have some code in my program that processes some stuff, and
takes a few seconds. So I thought logically I can place my dialog show
at the beginning before processing begins, and cancel it at the end.
What ACTUALLY seems to be happening is my dialog shows after the
processing is done... Some demo code to show what I mean with a simple
sleep:

ProgressDialog p = ProgressDialog.show(v.getContext(), updating
things things are updating);
try{
   Thread.sleep(4000);
}catch(Exception e){}
p.cancel();

You would assume it'd show the dialog, process/sleep for 4 seconds,
then cancel it. but it doesnt.


2. How can I remove the title bar entirely from the dialog? I've seen
some apps that do this, and am wondering if there's a simple way to do
this programatically, since I dont see that option in the docs.

thanks :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] HTC Magic Keyboard compatibility issue

2009-09-22 Thread Lee

I've been testing my application on a HTC magic and it's incompatible
with the keyboard that ships with the magic.

My application allows the on-screen keyboard to be displayed when the
user clicks on icon on the screen.  When using the emulator the way
that I determine that the keyboard has been hidden is through
responding to the KEYCODE_BACK keyevent.

On the HTC keyboard there is an additional key that allows the
keyboard to be hidden.  When this key is pressed the keyboard is
hidden but no KeyEvent is sent to the application with the result that
the application is now out of sync with the keyboard state.

In general is there a way to detect software keyboard hide / show
events in a non-vendor specific manner? This would be highly useful
for any application that is implementing custom views.

Thanks
Lee
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to split a screen into two? One running with an application and the other with another application?

2009-09-22 Thread Dianne Hackborn
You need to set the theme in the manifest.  The code sample is missing the @
in front of android.  There are various examples in ApiDemos of dialog and
translucent themed activities.

On Mon, Sep 21, 2009 at 10:26 PM, Karthik P karthi...@gmail.com wrote:

 I saw the below portion in the documentation,
 By setting the theme of an activity to
 android:theme=android:style/Theme.Dialog, your activity will take on the
 appearance of a normal dialog, floating on top of whatever was underneath
 it. You usually set the theme through the android:theme attribute in your
 Android Manifest.xml. The advantage of this over Dialg and AlertDialog is
 that Application has a much better managed.

 I tried to follow this but it throwed up an error saying unable to parse
 AndroidManifest.xml. I guess you are saying in the similar lines to make it
 translucent.

 My AndroidManifest.xml looked like this
 ?xml version=1.0 encoding=utf-8?
 manifest xmlns:android=http://schemas.android.com/apk/res/android;
   package=com.sample.window
   android:versionCode=1
   android:versionName=1.0
 application android:icon=@drawable/icon
 android:label=@string/app_name
 activity android:name=.window
   android:label=@string/app_name
 android:theme=android:style/Theme.Dialog
 intent-filter
 action android:name=android.intent.action.MAIN /
 category android:name=android.intent.category.LAUNCHER
 /
 /intent-filter
 /activity
 /application
 uses-sdk android:minSdkVersion=4 /
 /manifest

 then I tried thru the code using
 setTheme(android.R.style.Theme_Dialog);

 Above piece of code has built successfully but still I couldnt see any
 floating app, the app was occupying full screen. The same experiment I did
 with Theme.Translucent as well. Any light on this?

 Karthik

 On Tue, Sep 22, 2009 at 8:47 AM, Dianne Hackborn hack...@android.comwrote:

 There is no need to use SurfaceView for that, just make your own activity
 transparent such as with Theme.Translucent.
 Anyway, the UI model is designed around having one main fullscreen
 activity visible to the user (any number of non-fullscreen or translucent
 activities can be stacked on top of it).  There is no way to have two
 running side-by-side without significant deep cooperation between the two
 apps.

 On Mon, Sep 21, 2009 at 8:05 PM, Rud rudmerr...@gmail.com wrote:


 Just speculating but maybe using SurfaceView with a transparent
 region? The background app might show through the transparent area of
 the foreground app.

 Rud


 On Sep 21, 7:43 am, Karthik P karthi...@gmail.com wrote:
  Does anyone has an idea of how to split the screen into two? Is it
 possible
  for me to run an application in one screen and another app in other
 screen?
  Any help in this regard will be of great help.
  Karthik




 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.





 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] layout xml question.

2009-09-22 Thread sdphil

I have a table which is 2x2.  in the left column is some text fields,
and the right column has edit boxes.  when I have a long text string
in the edit boxes it seems like it truncates the edit box on the right
hand side (so instead of rounded corners on the right, it cuts off
hard).

If I set the EditText element layout_width to 0px (or 100px), it
works fine.  in other words, the text scrolls over and is right
adjusted.

Any ideas?

tia.

TableLayout android:id=@+id/MyTable
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:stretchColumns=1
 android:paddingLeft=20px

TableRow
TextView android:text=@string/MyText1
  android:textStyle=bold
  android:gravity=right/
EditText android:id=@+id/MyEdit1
  android:layout_width=fill_parent
  android:gravity=left
  android:singleLine=true/
/TableRow

TableRow
TextView android:text=@string/MyText2
  android:textStyle=bold
  android:gravity=right/
EditText android:id=@+id/MyEdit2
  android:layout_width=fill_parent
  android:password=true
  android:gravity=left
  android:singleLine=true/
/TableRow

/TableLayout

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Problem to add an image in ListActivity.

2009-09-22 Thread ragavendran s
I am new to android

Problem to add an image in ListActivity...i took this code from

*http://commonsware.com/Android/excerpt.pdf* ..eventhough i m having
problem...if i run it says The Application Stopped Unexpectedly.. try
Again...i dont know the reason..can u tel anybodypls point out the error
in my code

Thanks in advance...

With Regards,
Raghav.S



Here is my Code:

*Staticdemo.java*


package image.demo;


import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

public class StaticDemo extends ListActivity {
TextView selection;
String[] items={lorem, ipsum, dolor, sit, amet,
consectetuer, adipiscing};
ImageView android1;
 /** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);


setListAdapter(new
ArrayAdapterString(this,R.layout.row,R.id.label,items));
selection=(TextView)findViewById(R.id.selection);

android1=(ImageView)findViewById(R.id.android1);

}
public void onListItemClick(ListView parent, View v,
int position, long id) {
selection.setText(items[position]);


}
}
/LinearLayout


*row.xml*


?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
android:layout_width=fill_parent
android:layout_height=wrap_content
android:orientation=horizontal


ImageView
android:id=@+id/android1
android:layout_width=22px
android:paddingLeft=2px
android:paddingRight=2px
android:paddingTop=2px
android:layout_height=wrap_content
android:src=@drawable/images
/
TextView
android:id=@+id/label
android:layout_width=wrap_content
android:layout_height=wrap_content
android:textSize=44sp
/




*main.xml*


?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;
android:layout_width=fill_parent
android:layout_height=wrap_content
android:orientation=horizontal



TextView
android:id=@+id/selection
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=
/


/LinearLayout

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Making UPNP (Universal Plug and Play) Protocol work for Android

2009-09-22 Thread Satish Kota

 Hi Guys,

 I am in this BIG BIG problem...getting UPNP working on my computer and for
 many reasons...it doesn't seem to be working...

 Any body has any clue on how to get it working? Are there any one who has
 any kind of code that could help me on this?

 I believe Andromote is the only person who has done it...but dunno how did
 he do it?

 Before I ask this great great help..I want to explain what all I have
 done...

 I am supposed to build an android remote to control a UPNP device... and I
 have done some research on UPNPtoolkits on Java...there were about 2 or 3
 (Clink, SBBI, libupnp, etc.,) and the one which I seem to be more
 comfortable is the CyberGarage's clink upnp toolkit (
 http://cgupnpjava.sourceforge.net/). Clink uses xerces xml
 reader/converter... I followed the pdf file he attached (
 http://sourceforge.net/projects/cgupnpjava/files/) and went through the
 samples... However looking and using them on a java app... it worked fine
 and did good too..however the similar code failed on Android..

 When I ran it on Android...I was able to do the Discover but could not get
 the devices list...and thats the one I need...

 Can someone help me do this part? I believe I just need to achieve on how
 to get the correct device from UPNP...Once I  have the UPNP, I believe I can
 always get the actions...

 CAN SOMEONE PLEASE HELP ME?

 *My  Environment:* Windows XP and Android 1.5  1.1 ( but I am working
 this on 1.1)

 Thanks and Regards
 Satish N Kota



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] XercesParser for Android

2009-09-22 Thread Satish Kota
Hi All,

Just wanted to check if anyone has integrated XercesParser for Android...  I
need to integrate for one of my systems... I  think its not available...

Thanks and Regards
Satish N Kota

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to split a screen into two? One running with an application and the other with another application?

2009-09-22 Thread Karthik P
I tried that too... I get the following error.
[2009-09-22 12:56:19 - win]ERROR: Failed to parse %1$s
[2009-09-22 12:56:19 - win]AndroidManifest.xml


activity android:name=.win
  android:label=@string/app_name
android:theme=@android:style/Theme.Dialog

As I understand these are default themes and it doesnt require any change in
my resource files. Am I right?

Karthik


On Tue, Sep 22, 2009 at 12:26 PM, Dianne Hackborn hack...@android.comwrote:

 You need to set the theme in the manifest.  The code sample is missing the
 @ in front of android.  There are various examples in ApiDemos of dialog and
 translucent themed activities.


 On Mon, Sep 21, 2009 at 10:26 PM, Karthik P karthi...@gmail.com wrote:

 I saw the below portion in the documentation,
 By setting the theme of an activity to
 android:theme=android:style/Theme.Dialog, your activity will take on the
 appearance of a normal dialog, floating on top of whatever was underneath
 it. You usually set the theme through the android:theme attribute in your
 Android Manifest.xml. The advantage of this over Dialg and AlertDialog is
 that Application has a much better managed.

 I tried to follow this but it throwed up an error saying unable to parse
 AndroidManifest.xml. I guess you are saying in the similar lines to make it
 translucent.

 My AndroidManifest.xml looked like this
 ?xml version=1.0 encoding=utf-8?
 manifest xmlns:android=http://schemas.android.com/apk/res/android;
   package=com.sample.window
   android:versionCode=1
   android:versionName=1.0
 application android:icon=@drawable/icon
 android:label=@string/app_name
 activity android:name=.window
   android:label=@string/app_name
 android:theme=android:style/Theme.Dialog
 intent-filter
 action android:name=android.intent.action.MAIN /
 category android:name=android.intent.category.LAUNCHER
 /
 /intent-filter
 /activity
 /application
 uses-sdk android:minSdkVersion=4 /
 /manifest

 then I tried thru the code using
 setTheme(android.R.style.Theme_Dialog);

 Above piece of code has built successfully but still I couldnt see any
 floating app, the app was occupying full screen. The same experiment I did
 with Theme.Translucent as well. Any light on this?

 Karthik

 On Tue, Sep 22, 2009 at 8:47 AM, Dianne Hackborn hack...@android.comwrote:

 There is no need to use SurfaceView for that, just make your own activity
 transparent such as with Theme.Translucent.
 Anyway, the UI model is designed around having one main fullscreen
 activity visible to the user (any number of non-fullscreen or translucent
 activities can be stacked on top of it).  There is no way to have two
 running side-by-side without significant deep cooperation between the two
 apps.

 On Mon, Sep 21, 2009 at 8:05 PM, Rud rudmerr...@gmail.com wrote:


 Just speculating but maybe using SurfaceView with a transparent
 region? The background app might show through the transparent area of
 the foreground app.

 Rud


 On Sep 21, 7:43 am, Karthik P karthi...@gmail.com wrote:
  Does anyone has an idea of how to split the screen into two? Is it
 possible
  for me to run an application in one screen and another app in other
 screen?
  Any help in this regard will be of great help.
  Karthik




 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.









 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Location constructors are stubs?

2009-09-22 Thread Walles

Seems like the contents of that jar file only has dummy
implementations of all methods.  Found this thread explaining it a
bit:
http://groups.google.com/group/android-developers/browse_thread/thread/a680b65f287e1b8c

Solution is to run all tests on the simulator (or the real device).
Visually it still looks the same in Eclipse, thank you Eclipse ADT
plugin developers :-).

  //Johan

On 21 Sep, 08:27, Walles johan.wal...@gmail.com wrote:
 Hi!

 I'm writing unit tests for a class containing Locations.  To create a
 (mock) Location, I do this:

 Location from = new Location(Johan);

 However, the Location(String) constructor throws a RuntimeException
 saying Stub!.

 How can I create a mock location?

 Note that I'm running this on the plain JDK with android.jar in the
 path, after JUnit but before my own stuff.  No device or emulator is
 involved.  The android.jar file is from the platforms/android-1.5
 directory of android-sdk-linux_x86-1.6_r1.

   Regards //Johan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to force soft keyboard to be visible?

2009-09-22 Thread dwass

Hi Dianne,

You say that the G1 has a keyboard and so the IME is not shown by
default. I don't understand that statement. Yes, the G1 has a
keyboard, but it isn't always OPEN. Especially if the device is in
portrait mode, the keyboard is probably NEVER open. The device should
be smart enough so that it opens the keyboard if there is no keyboard
open. Either that, or we need a way to show the keyboard when we want
to (and hide it again when we don't).

My current problem is this: When I start an activity, the first
EditText field in the layout is focused automatically, but the soft
keyboard is not automatically shown. The user must either click (with
trackball) or touch the field to open the soft keyboard. IMHO the
developer should be able to say that he wants the keyboard shown at
this point.

Any suggestions? I've tried all the force show keyboard suggestions
and they sometimes do work, but usually you get stuck with the
keyboard being shown after you leave the field and this causes more
problems that it solves.

Thanks,
-DWass


 On Sep 19, 8:42 am, Dianne Hackborn hack...@android.com wrote:

  The G1 has akeyboard, so it works as I said -- the IME is not shown by
  default.  This is a policy decision of the platform.

  On a myTouch, since it doesn't have akeyboard, the IME will be shown by
  default in various cases (for example when you enter the edit contacts
  screen) when the app has indicated that is desired with the input options.

  --
  Dianne Hackborn
  Android framework engineer
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Widgets changes with 1.6?

2009-09-22 Thread BoD

Thanks for the replies.
Ill try to make a canonical (as simple as possible) Widget project
and start from here.

BoD


On Sep 22, 2:19 am, Christopher ch1...@gmail.com wrote:
 I have awidgetthat updates every hour and is working fine.

 However does anyone else have the problem that on install on a1.6
 system that their app asks for permission to phone calls and storage?
 Not a problem in 1.5, but even Hello World asks for it on1.6roms.

 Chris

 On Sep 20, 4:15 pm, BoD bodl...@gmail.com wrote:

  Hi!
  I'm developing aWidgetthat updates every 10 seconds
  (android:updatePeriodMillis=1).
  On the 1.5 emulator, as well as on my adp1, it works as expected.
  On the1.6emulator, my widgets are not updated. Apparently,
  AppWidgetProvider.onUpdate(...) is never called.

  Is there something I missed?

  Thanks a lot,

  BoD


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Problem to add an image in ListActivity.

2009-09-22 Thread Mark Murphy


 I am new to android

 Problem to add an image in ListActivity...i took this code from

 *http://commonsware.com/Android/excerpt.pdf* ..eventhough i m having
 problem...if i run it says The Application Stopped Unexpectedly.. try
 Again...i dont know the reason..can u tel anybodypls point out the
 error
 in my code

You need to look at your Java stack trace to find your error. You can get
to the Java stack trace via adb logcat, DDMS, or the DDMS perspective in
Eclipse.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to split a screen into two? One running with an application and the other with another application?

2009-09-22 Thread Dianne Hackborn
No new resources needed.  Again, please see the complete working examples in
ApiDemos.  Fwiw, I can't see what the error you are printing has to do with
your code (nor did you include the part where it says the line number of the
error).

On Tue, Sep 22, 2009 at 12:28 AM, Karthik P karthi...@gmail.com wrote:

 I tried that too... I get the following error.
 [2009-09-22 12:56:19 - win]ERROR: Failed to parse %1$s
 [2009-09-22 12:56:19 - win]AndroidManifest.xml


 activity android:name=.win
   android:label=@string/app_name
 android:theme=@android:style/Theme.Dialog

 As I understand these are default themes and it doesnt require any change
 in my resource files. Am I right?

 Karthik


 On Tue, Sep 22, 2009 at 12:26 PM, Dianne Hackborn hack...@android.comwrote:

 You need to set the theme in the manifest.  The code sample is missing the
 @ in front of android.  There are various examples in ApiDemos of dialog and
 translucent themed activities.


 On Mon, Sep 21, 2009 at 10:26 PM, Karthik P karthi...@gmail.com wrote:

 I saw the below portion in the documentation,
 By setting the theme of an activity to
 android:theme=android:style/Theme.Dialog, your activity will take on the
 appearance of a normal dialog, floating on top of whatever was underneath
 it. You usually set the theme through the android:theme attribute in your
 Android Manifest.xml. The advantage of this over Dialg and AlertDialog is
 that Application has a much better managed.

 I tried to follow this but it throwed up an error saying unable to parse
 AndroidManifest.xml. I guess you are saying in the similar lines to make it
 translucent.

 My AndroidManifest.xml looked like this
 ?xml version=1.0 encoding=utf-8?
 manifest xmlns:android=http://schemas.android.com/apk/res/android;
   package=com.sample.window
   android:versionCode=1
   android:versionName=1.0
 application android:icon=@drawable/icon
 android:label=@string/app_name
 activity android:name=.window
   android:label=@string/app_name
 android:theme=android:style/Theme.Dialog
 intent-filter
 action android:name=android.intent.action.MAIN /
 category android:name=android.intent.category.LAUNCHER
 /
 /intent-filter
 /activity
 /application
 uses-sdk android:minSdkVersion=4 /
 /manifest

 then I tried thru the code using
 setTheme(android.R.style.Theme_Dialog);

 Above piece of code has built successfully but still I couldnt see any
 floating app, the app was occupying full screen. The same experiment I did
 with Theme.Translucent as well. Any light on this?

 Karthik

 On Tue, Sep 22, 2009 at 8:47 AM, Dianne Hackborn hack...@android.comwrote:

 There is no need to use SurfaceView for that, just make your own
 activity transparent such as with Theme.Translucent.
 Anyway, the UI model is designed around having one main fullscreen
 activity visible to the user (any number of non-fullscreen or translucent
 activities can be stacked on top of it).  There is no way to have two
 running side-by-side without significant deep cooperation between the two
 apps.

 On Mon, Sep 21, 2009 at 8:05 PM, Rud rudmerr...@gmail.com wrote:


 Just speculating but maybe using SurfaceView with a transparent
 region? The background app might show through the transparent area of
 the foreground app.

 Rud


 On Sep 21, 7:43 am, Karthik P karthi...@gmail.com wrote:
  Does anyone has an idea of how to split the screen into two? Is it
 possible
  for me to run an application in one screen and another app in other
 screen?
  Any help in this regard will be of great help.
  Karthik




 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.









 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.





 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at

[android-developers] Re: HTC Magic Keyboard compatibility issue

2009-09-22 Thread Dianne Hackborn
You find out about the IME impacting your application by your application
window getting resized.  That is the -only- way.  Different IMEs may have
radically different approaches to interacting with the user.  You certainly
can't assume they are doing anything solely or at all with the back key.
This has nothing to do with different vendors, it applies to any IME the
user may install as well.

On Mon, Sep 21, 2009 at 11:55 PM, Lee labor...@gmail.com wrote:


 I've been testing my application on a HTC magic and it's incompatible
 with the keyboard that ships with the magic.

 My application allows the on-screen keyboard to be displayed when the
 user clicks on icon on the screen.  When using the emulator the way
 that I determine that the keyboard has been hidden is through
 responding to the KEYCODE_BACK keyevent.

 On the HTC keyboard there is an additional key that allows the
 keyboard to be hidden.  When this key is pressed the keyboard is
 hidden but no KeyEvent is sent to the application with the result that
 the application is now out of sync with the keyboard state.

 In general is there a way to detect software keyboard hide / show
 events in a non-vendor specific manner? This would be highly useful
 for any application that is implementing custom views.

 Thanks
 Lee
 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Resetting the activity stack

2009-09-22 Thread tauntz

Hi

Activities:
A  B  are activities that once you have navigated away from them,
it's not logical that you can get back to them using the back button.
C ... X are activities that follow the usual can go back to where you
came from flow.

App flow:
* Launch app from Home - starts A
* From A start B
* Finish A (removes it from stack)
* From B start C
* Finish B (removes it from stack)
* From C start D
* From D start E

Once the user has reached E, the activity stack looks like this: C - D - E.

Can I somehow reset the whole stack so it starts again at A so it's as
the user just launched it from Home (so that C... E are removed from
the history stack)?

From http://developer.android.com/guide/topics/fundamentals.html#clearstack:
In my case alwaysRetainTaskState = true, clearTaskOnLaunch = false,
finishOnTaskLaunch = false, because it's logical that the user
continues in the same activity where he left - even after long periods
of time. Even if alwaysRetainTaskState was false, it would still not
address my problem of manually clearing the stack at a random point
in time from within the application.
There's another way to force activities to be removed from the stack.
If an Intent object includes the FLAG_ACTIVITY_CLEAR_TOP flag, and the
target task already has an instance of the type of activity that
should handle the intent in its stack, all activities above that
instance are cleared away so that it stands at the top of the stack
and can respond to the intent. - that also doesn't work for me since
A isn't in the stack so launching it with that flag won't clear
anything from the stack :(


Tauno

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: OpenGL 2D Game Framework

2009-09-22 Thread Cédric Berger

On Tue, Sep 22, 2009 at 01:28, Dan Sherman impact...@gmail.com wrote:

 I'm not too knowledgable on the LGPL, but the Mozilla license would be
 something to look into.


Apache license (same as Android code license) may be the best choice.

And this would also allow for easy inclusion of some of this code
directly into android if ever needed.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Chance Discover your Future now.health tips $

2009-09-22 Thread 100% Free


Love, Money, Career, Family, Chance Discover your Future now. 100% Free 

http://www.preeto.co.cc
http://www.preeto.co.cc
http://www.preeto.co.cc

A Detailed Life History 15 Pages of Biographical Content

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ProgressDialog doesnt show when called...?

2009-09-22 Thread Beanie

This should work

ProgressDialog pDialog = new ProgressDialog(context);
pDialog.setMessage(Your Message);
pDialog.show();


And when you want to close the dialog,
pDialog.dismiss();

Dexter.

On Sep 22, 11:38 am, Feras mou...@gmail.com wrote:
 I have 2 questions actually, while we're on the subject :)

 1.  I have some code in my program that processes some stuff, and
 takes a few seconds. So I thought logically I can place my dialog show
 at the beginning before processing begins, and cancel it at the end.
 What ACTUALLY seems to be happening is my dialog shows after the
 processing is done... Some demo code to show what I mean with a simple
 sleep:

 ProgressDialog p = ProgressDialog.show(v.getContext(), updating
 things things are updating);
 try{
    Thread.sleep(4000);}catch(Exception e){}

 p.cancel();

 You would assume it'd show the dialog, process/sleep for 4 seconds,
 then cancel it. but it doesnt.

 2. How can I remove the title bar entirely from the dialog? I've seen
 some apps that do this, and am wondering if there's a simple way to do
 this programatically, since I dont see that option in the docs.

 thanks :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Control styling

2009-09-22 Thread Dmitry Zelenetskiy

Hello,

I need create some EditText dynamically in my application, but these
components have to apply one custom style in styles.xml.

I am trying to this next way:

XmlResourceParser parser = getResources().getXml(R.style.MyStyle);
AttributeSet attributes = Xml.asAttributeSet(parser);
...
for (SomeObject obj : ObjArray) {
  EditText edit = new EditText(this, attributes);
  edit.addTextChangedListener(new CustomTextWatcher(obj));
  parentObj.addView(edit);
}

but while executing it fails with exception

android.content.res.Resources$NotFoundException: Resource ID
#0x7f050001
at android.content.res.Resources.getValue(Resources.java:846)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:
1796)
at android.content.res.Resources.getXml(Resources.java:734)

Can somebody tell me - how to do this feature?
Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Resetting the activity stack

2009-09-22 Thread Andrei Bucur
http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_CLEAR_TOP

On Tue, Sep 22, 2009 at 11:26 AM, tauntz tau...@gmail.com wrote:


 Hi

 Activities:
 A  B  are activities that once you have navigated away from them,
 it's not logical that you can get back to them using the back button.
 C ... X are activities that follow the usual can go back to where you
 came from flow.

 App flow:
 * Launch app from Home - starts A
 * From A start B
 * Finish A (removes it from stack)
 * From B start C
 * Finish B (removes it from stack)
 * From C start D
 * From D start E

 Once the user has reached E, the activity stack looks like this: C - D -
 E.

 Can I somehow reset the whole stack so it starts again at A so it's as
 the user just launched it from Home (so that C... E are removed from
 the history stack)?

 From
 http://developer.android.com/guide/topics/fundamentals.html#clearstack:
 In my case alwaysRetainTaskState = true, clearTaskOnLaunch = false,
 finishOnTaskLaunch = false, because it's logical that the user
 continues in the same activity where he left - even after long periods
 of time. Even if alwaysRetainTaskState was false, it would still not
 address my problem of manually clearing the stack at a random point
 in time from within the application.
 There's another way to force activities to be removed from the stack.
 If an Intent object includes the FLAG_ACTIVITY_CLEAR_TOP flag, and the
 target task already has an instance of the type of activity that
 should handle the intent in its stack, all activities above that
 instance are cleared away so that it stands at the top of the stack
 and can respond to the intent. - that also doesn't work for me since
 A isn't in the stack so launching it with that flag won't clear
 anything from the stack :(


 Tauno

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Why there is no log message output in the logcat after installed SDK 1.6

2009-09-22 Thread android.bu...@gmail.com

After installing SDK 1.6 and ADT 0.9.3, I created a new AVD with SDK
level 4. Then I found that my application can not output log in the
logcat. Can anyone tell me why?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Resetting the activity stack

2009-09-22 Thread tauntz

FLAG_ACTIVITY_CLEAR_TOP - If set, and the activity being launched is
already running in the current task, then instead of launching a new
instance of that activity, all of the other activities on top of it
will be closed and this Intent will be delivered to the (now on top)
old activity as a new Intent. 

Sadly this one doesn't help since it only clears the stack if the
launched activity is already running in the task somewhere (and that's
not the case here, sadly :( )


Tauno


On Tue, Sep 22, 2009 at 12:17 PM, Andrei Bucur andrei.bu...@gmail.com wrote:
 http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_CLEAR_TOP

 On Tue, Sep 22, 2009 at 11:26 AM, tauntz tau...@gmail.com wrote:

 Hi

 Activities:
 A  B  are activities that once you have navigated away from them,
 it's not logical that you can get back to them using the back button.
 C ... X are activities that follow the usual can go back to where you
 came from flow.

 App flow:
 * Launch app from Home - starts A
 * From A start B
 * Finish A (removes it from stack)
 * From B start C
 * Finish B (removes it from stack)
 * From C start D
 * From D start E

 Once the user has reached E, the activity stack looks like this: C - D -
 E.

 Can I somehow reset the whole stack so it starts again at A so it's as
 the user just launched it from Home (so that C... E are removed from
 the history stack)?

 From
 http://developer.android.com/guide/topics/fundamentals.html#clearstack:
 In my case alwaysRetainTaskState = true, clearTaskOnLaunch = false,
 finishOnTaskLaunch = false, because it's logical that the user
 continues in the same activity where he left - even after long periods
 of time. Even if alwaysRetainTaskState was false, it would still not
 address my problem of manually clearing the stack at a random point
 in time from within the application.
 There's another way to force activities to be removed from the stack.
 If an Intent object includes the FLAG_ACTIVITY_CLEAR_TOP flag, and the
 target task already has an instance of the type of activity that
 should handle the intent in its stack, all activities above that
 instance are cleared away so that it stands at the top of the stack
 and can respond to the intent. - that also doesn't work for me since
 A isn't in the stack so launching it with that flag won't clear
 anything from the stack :(


 Tauno




 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Animation

2009-09-22 Thread HVT

So kindly can you suggest me what am I supposed to use?

Thanks in advance.

On Sep 21, 10:20 pm, Dianne Hackborn hack...@android.com wrote:
 Don't use animations.  This is not what they are for.  They are for
 performing transitions between different states of a UI, not for writing
 game-like interactions.





 On Mon, Sep 21, 2009 at 1:56 AM, HVT vikramhiman...@gmail.com wrote:

  Hello All,

  I'm facing a problem while clicking the objects while they animate.
  Please help me identify the click on the objects while they are
  animating.

  My requirement is to randomly move a ball around the screen and the
  user should be able to click this ball any time.

  Also this ball changes colours. For this is i have 3 different images
  of different colours and I want to create a frame by frame animation
  between them while they are animating.

  This makes it 2 animations at a time. a frame-by-frame animated image/
  object has to animated may be a /translate animation and this should
  be click able.

  Please help me fix this. I have stuck on this part for almost over a
  month now.

  Thanks,
  HVT

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ProgressDialog doesnt show when called...?

2009-09-22 Thread Feras

No, it doesn't. It's essentially same thing I did, but to make sure I
ran your code with the following test code to make sure:

ProgressDialog pDialog = new ProgressDialog(this);
pDialog.setMessage(Your Message);
pDialog.show();
try{
Thread.sleep(4000);
}catch(Exception e){}
pDialog.dismiss();

What happens is: a dialog is never shown and seems like nothing
happens for the 4 seconds. If i remove the dismiss(), the program
waits 4 seconds, and THEN shows the dialog. Makes it appear as if show
() gets run only after thread sleeps.

Any ideas?

On Sep 22, 2:00 am, Beanie coomar@gmail.com wrote:
 This should work

 ProgressDialog pDialog = new ProgressDialog(context);
 pDialog.setMessage(Your Message);
 pDialog.show();

 And when you want to close the dialog,
 pDialog.dismiss();

 Dexter.

 On Sep 22, 11:38 am, Feras mou...@gmail.com wrote:

  I have 2 questions actually, while we're on the subject :)

  1.  I have some code in my program that processes some stuff, and
  takes a few seconds. So I thought logically I can place my dialog show
  at the beginning before processing begins, and cancel it at the end.
  What ACTUALLY seems to be happening is my dialog shows after the
  processing is done... Some demo code to show what I mean with a simple
  sleep:

  ProgressDialog p = ProgressDialog.show(v.getContext(), updating
  things things are updating);
  try{
     Thread.sleep(4000);}catch(Exception e){}

  p.cancel();

  You would assume it'd show the dialog, process/sleep for 4 seconds,
  then cancel it. but it doesnt.

  2. How can I remove the title bar entirely from the dialog? I've seen
  some apps that do this, and am wondering if there's a simple way to do
  this programatically, since I dont see that option in the docs.

  thanks :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] HTTP POST through intent

2009-09-22 Thread Hunter Peress

Yo.

Im finding this topic severely lacking in attempts.

I have an http post. I want to post it THROUGH an intent to a browser
and browse. howto

Use the data part of an intent??

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to force soft keyboard to be visible?

2009-09-22 Thread James W

Well, curiouser and curiouser.

I made a very simple test app running under 1.5 on my Hero, with an
activity showing a single EditText, after the SetContentView() call, I
use the ToggleSoftInput as described above.

When I run it, it does not show the keyboard. However (and I found
this by accident), if you then turn it to Landscape, the keyboard
magically appears. And then if you turn it back to Portrait, the
keyboard is still there. Yet it won't appear initially in the Portrait
mode when the app is first opened, which is the behaviour I am after.

Yet if I start the app in Landscape, the keyboard appears, and is
there when I move back to Portrait.

Here is my code:

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.inputmethod.InputMethodManager;

public class TestApp extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.main);
InputMethodManager imm =
(InputMethodManager)getSystemService
(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,
InputMethodManager.HIDE_IMPLICIT_ONLY);

}
}

and the main.xml:

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent

TextView
android:layout_width=fill_parent
android:layout_height=wrap_content
android:text=@string/hello
/
EditText android:text=EditText01
android:id=@+id/EditText01
android:layout_width=wrap_content
android:layout_height=wrap_content
/EditText
/LinearLayout

Could someone confirm that this works as expected on non-Hero
hardware? Or anyone have any other ideas as to the weird behaviour?




On Sep 22, 1:16 am, Dianne Hackborn hack...@android.com wrote:
 Oh also it doesn't show by default if the IME needs to run in fullscreen
 (typically because the device is in landscape).  Both of these are because
 showing the IME is these cases is much more disruptive than showing it when
 the target window can resize nicely to show all of its important UI in
 conjunction with the IME.

 On Mon, Sep 21, 2009 at 10:15 AM, Dianne Hackborn hack...@android.comwrote:





  All I can say is the edit contacts activity in the standard platform does
  this just fine, using the standard API.  Either you are doing something
  different than it, or HTC's IME has some different behavior, but I don't
  know much about either of those.  Do note that normally the system will not
  show the IME by default if it has to use panning on the target window
  (instead of resize), and the only way to get around this would be to
  explicitly show the IME when you receive focus.

  On Mon, Sep 21, 2009 at 6:13 AM, James W jpbwebs...@gmail.com wrote:

  I have exactly the same requirement.

  Running on a Hero, which only has a soft keyboard. The above code is
  copied exactly, yet it doesnt work. The keyboard is not shown no
  matter where I put the code, before or after SetContentView().

  This seems like a pretty standard thing to want to do, is there some
  other way of doing this?

  Thanks in advance..
  James

  On Sep 19, 8:42 am, Dianne Hackborn hack...@android.com wrote:
   The G1 has a keyboard, so it works as I said -- the IME is not shown by
   default.  This is a policy decision of the platform.

   On a myTouch, since it doesn't have a keyboard, the IME will be shown by
   default in various cases (for example when you enter the edit contacts
   screen) when the app has indicated that is desired with the input
  options.

   On Fri, Sep 18, 2009 at 4:13 PM, Mike Collins mike.d.coll...@gmail.com
  wrote:

The behavior I'm talking about is on a locked G1 with 1.5, I did not
expect the
emulator to be very useful.

The behavior on a myTouch (locked, 1.5) is really bizarre.

I'm beginning to think that I'm going to pull all the soft keyboard
code out
and let the user do the extra work.

 mike

   --
   Dianne Hackborn
   Android framework engineer
   hack...@android.com

   Note: please don't send private questions to me, as I don't have time to
   provide private support, and so won't reply to such e-mails.  All such
   questions should be posted on public forums, where I and others can see
  and
   answer them.- Hide quoted text -

   - Show quoted text -

  --
  Dianne Hackborn
  Android framework engineer
  hack...@android.com

  Note: please don't send private questions to me, as I don't have time to
  provide private support, and so won't reply to such e-mails.  All such
  questions should be posted on public forums, where I and others can see and
  answer them.

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send 

[android-developers] Any news about ADC2 ???

2009-09-22 Thread omnitial

Hi,
is there any news about ADC 2 ? Is the judging application is in the
market ??
It's 22nd September today.

regards
omnitial
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] setting mapView to R.id.mapview throws ClassCastException

2009-09-22 Thread Lex

...I really don't understand how something this simple (and I have
done it before) doesn't work. I'm pretty sure it will turn out that I
am missing something obvious.

I just created a MapView, all it does is show the map and when I
allocate mapView to it's layout, there's a ClassCastException:

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;

import android.app.Activity;
import android.os.Bundle;



public class PPMMap extends MapActivity {

public MapView mapView;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

mapView =  (MapView) findViewById(R.id.mapview); // THROWS
CLASSCASTEXCEPTION
mapView.setBuiltInZoomControls(true);


}

@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}

}

?xml version=1.0 encoding=utf-8?

RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:id=@+id/mapview
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent 

 com.google.android.maps.MapView
 android:layout_width=fill_parent
 android:layout_height=fill_parent
 android:apiKey=
 /

/RelativeLayout

09-22 17:16:03.676: ERROR/AndroidRuntime(730):
java.lang.RuntimeException: Unable to start activity ComponentInfo
{patyo.PPMMap}: java.lang.ClassCastException:
android.widget.RelativeLayout
09-22 17:16:03.676: ERROR/AndroidRuntime(730): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2268)
09-22 17:16:03.676: ERROR/AndroidRuntime(730): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2284)
09-22 17:16:03.676: ERROR/AndroidRuntime(730): at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
09-22 17:16:03.676: ERROR/AndroidRuntime(730): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
09-22 17:16:03.676: ERROR/AndroidRuntime(730): at
android.os.Handler.dispatchMessage(Handler.java:99)
09-22 17:16:03.676: ERROR/AndroidRuntime(730): at
android.os.Looper.loop(Looper.java:123)
09-22 17:16:03.676: ERROR/AndroidRuntime(730): at
android.app.ActivityThread.main(ActivityThread.java:3948)
09-22 17:16:03.676: ERROR/AndroidRuntime(730): at
java.lang.reflect.Method.invokeNative(Native Method)
09-22 17:16:03.676: ERROR/AndroidRuntime(730): at
java.lang.reflect.Method.invoke(Method.java:521)
09-22 17:16:03.676: ERROR/AndroidRuntime(730): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
09-22 17:16:03.676: ERROR/AndroidRuntime(730): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
09-22 17:16:03.676: ERROR/AndroidRuntime(730): at
dalvik.system.NativeStart.main(Native Method)
09-22 17:16:03.676: ERROR/AndroidRuntime(730): Caused by:
java.lang.ClassCastException: android.widget.RelativeLayout
09-22 17:16:03.676: ERROR/AndroidRuntime(730):
at PPMMap.onCreate(PPMMap.java:21)
09-22 17:16:03.676: ERROR/AndroidRuntime(730): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1123)
09-22 17:16:03.676: ERROR/AndroidRuntime(730): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2231)

Call me an idiot, but I just don't get it.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Changing application label from code

2009-09-22 Thread Dianne Hackborn
There are lots of examples in the framework here:

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;f=core/res/res

On Tue, Sep 22, 2009 at 7:43 AM, Tsu rse...@gmail.com wrote:


 Hi,

 I need to change application label based on the SIM Card carrier. I'm
 trying to work around the above by adding values folders with mcc and
 mnc information as stated on the following link.

 http://developer.android.com/guide/topics/resources/resources-i18n.html#ReferencesToResources

 On my sample application Im adding a values folder in the following
 way values-mccxxx-mncyyy but this is also not working. Is there a
 problem in the format Im using? Is any twikis on code needed?

 Thanks a lot,
 Renato


 On 27 ago, 23:07, Dianne Hackborn hack...@android.com wrote:
  Sorry, there is currently no way to change the label dynamically.
 
  On Thu, Aug 27, 2009 at 11:06 AM, Taísa Cristina taisa.san...@gmail.com
 wrote:
 
 
 
 
 
   Hi all,
 
   I have a Service which enables/disables an application launcher
   activity as follows. Can I change the application label from my code,
   while enabling the application launcher?
 
   
   ComponentName cName = new ComponentName(my.package.name,
   my.launcher.activity);
   int state = install ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
  : PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
   try {
  pm.setComponentEnabledSetting(cName, state,
   PackageManager.DONT_KILL_APP);
   } catch (Exception e) {
  Log.d(TAG, Could not change my app state);
   }
   
 
   Thanks,
   Taísa
 
  --
  Dianne Hackborn
  Android framework engineer
  hack...@android.com
 
  Note: please don't send private questions to me, as I don't have time to
  provide private support, and so won't reply to such e-mails.  All such
  questions should be posted on public forums, where I and others can see
 and
  answer them.

 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to pass a LIst of MyObject in .aidl

2009-09-22 Thread n179911

I read this.
http://developer.android.com/guide/developing/tools/aidl.html

And I have
* created a MyObject.java which implements Parceable.
* created a MyObject.aidl file which just contains:

package com.mycompany.mypackage;

parcelable MyObject;

* In my IMyService.aidl, I have added
import com.mycompany.mypackage.MyObject;

* in my Android.mk file, I have added:
LOCAL_SRC_FILES += \
src/com/mycompany/mypackage/MyObject.aidl \
src/com/mycompany/mypackage/IMyService.aidl \

But when I compile, I get this error:
Aidl: Test = src/com/mycompany/mypackage//MyObject.aidl
src/com/mycompany/mypackage/MyObject.aidl:19 aidl can only generate
code for interfaces, not parcelables,
src/com/mycompany/mypackage/MyObject.aidl:19 .aidl files that only
declare parcelables don't need to go in the Makefile.
make: *** 
[out/target/common/obj/APPS/Test_intermediates/src/src/com/mycompany/mypackage/MyObject.java]
Error 1

I appreciate if anyone can help me.

On Tue, Sep 22, 2009 at 5:12 PM, n179911 n179...@gmail.com wrote:
 I have this method in my .aidl file:

 void getObjects(out ListMyObject objList);
 But I get this error

 src/com/mycompany/mypackage/ITestService.aidl:26 parameter objList (1)
 unknown type List objList

 How to create a List of MyObject in .aidl?
 I know I need to create a Java class MyObject which implements
 Parceable.  I just don't know what I need to do in .aidl file.

 Thank you.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: HTC Magic Keyboard compatibility issue

2009-09-22 Thread Chris Stratton

Expecting applications to be arbitrarily resizable strikes me as
seriously unworkable in the general case, especially as you include
the ime taking over the full screen in your list of possibilities.
This really only works for apps where the necessary context can be
limited to a single text entry field.

If that's really the strategy I suspect developers will often end up
having to do their own size-appropriate on screen keyboards and try to
keep the ime inactive...

On Sep 22, 12:53 pm, Dianne Hackborn hack...@android.com wrote:
 We don't have any plan on adding that.  An IME being visible can mean
 anything from a small bar along the bottom to it covering the full screen of
 your UI.  An API telling whether it is visible or not is just not sufficient
 for this.  The intended way for this to work is for the underlying
 application to be resizeable and do the appropriate thing for whatever size
 it gets.
 Also this is really an independent issue from different devices -- the input
 method system is pluggable, users can download and use whatever input method
 they want, so even if there was only ever one device running Android
 applications still need to deal with input methods that work in very
 different ways.





 On Tue, Sep 22, 2009 at 5:20 AM, Lee labor...@gmail.com wrote:

  Thanks

  A recommendation that I'd make for a future rev of the API is that it
  be possible to register a callback interface to indicate when an IME
  is activated or deactivated.

  I've read various statements that it's not good practice to trigger
  off an IME transition but for our app it's a pretty essential feature
  because we aren't interacting with local input controls at all and we
  need to provide a UI to both show the IME (simple) but also we need to
  be notified when the IME is no longer active.

  This is where Android development is going to get complicated.
  Applications that work great on the G1 or the emulator look and behave
  totally differently on other platforms, so although we're developing
  for a base system the UX is going to potentially be very different
  depending on the phone.  Having additional interfaces like this would
  allow us to reduce some of these impacts.

  Thanks
  Lee

  On Sep 22, 6:24 pm, Dianne Hackborn hack...@android.com wrote:
   You find out about the IME impacting your application by your application
   window getting resized.  That is the -only- way.  Different IMEs may have
   radically different approaches to interacting with the user.  You
  certainly
   can't assume they are doing anything solely or at all with the back key.
   This has nothing to do with different vendors, it applies to any IME the
   user may install as well.

   On Mon, Sep 21, 2009 at 11:55 PM, Lee labor...@gmail.com wrote:

I've been testing my application on a HTC magic and it's incompatible
with the keyboard that ships with the magic.

My application allows the on-screen keyboard to be displayed when the
user clicks on icon on the screen.  When using the emulator the way
that I determine that the keyboard has been hidden is through
responding to the KEYCODE_BACK keyevent.

On the HTC keyboard there is an additional key that allows the
keyboard to be hidden.  When this key is pressed the keyboard is
hidden but no KeyEvent is sent to the application with the result that
the application is now out of sync with the keyboard state.

In general is there a way to detect software keyboard hide / show
events in a non-vendor specific manner? This would be highly useful
for any application that is implementing custom views.

Thanks
Lee

   --
   Dianne Hackborn
   Android framework engineer
   hack...@android.com

   Note: please don't send private questions to me, as I don't have time to
   provide private support, and so won't reply to such e-mails.  All such
   questions should be posted on public forums, where I and others can see
  and
   answer them.

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] System.setProperty() cannot change system property in Android

2009-09-22 Thread xeagle

I use Java API System.setProperty() to set a system property.  After
invoke System.setProperty(), API System.getProperty() can return
the value just I set. However, when I use command adb shell getprop
to verify, it shows that this property is not set at all.
Do I wrongly understand API System.setProperty() ?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: System.setProperty() cannot change system property in Android

2009-09-22 Thread Mark Murphy



 I use Java API System.setProperty() to set a system property.  After
 invoke System.setProperty(), API System.getProperty() can return
 the value just I set. However, when I use command adb shell getprop
 to verify, it shows that this property is not set at all.
 Do I wrongly understand API System.setProperty() ?

This method will only affect your running process, just as it does with
any other Java implementation.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---