[android-developers] Re: Samsung Moment (SPH-M900) - Application crashing

2009-11-21 Thread Pieter
My understanding is that almost all calls are made on the main
dispatch
thread, including the onCreate call. The only exceptions are calls
from specialized
threads like the OpenGL drawing thread.

This means calls are always sequential, and in particular onCreate and
onProgressChanged
will be called sequentially from the dispatch thread.

Is it possible that target gets reset to null at some other point in
your code?

On Nov 20, 7:53 pm, jotobjects jotobje...@gmail.com wrote:
 On Nov 20, 5:30 am, Don donal.morris...@gmail.com wrote:

  Anyway, i was able to tidy up the code and remove the bug. But still,
  there really should be no differences like this on various android
  devices (unless they are at diffenet firmware versions, of course).

 I don't know if you can count on onCreate completing before any other
 code in the activity executes.  Does the API guarantee that?

 Even minor differences in execution speed or linux multitasking on the
 device could account for this kind of bug showing up on one device and
 not on another.

-- 
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] How to run the email app background

2009-11-21 Thread manoj
Hi all,

I have some requirement as given below:

I have to write an email app that should send a mail to the particular
mail id.

I have written a code like this:

Intent i = new Intent(Intent.ACTION_SEND);
i.putExtras(Intent.EXTRA_MAIL,abc.gmail.com);
i.putExtras(Intent.EXTRA_SUBJECT,subject);
i.putExtras(Intent.EXTRA_MESSAGE,some message);
i..setType(message/rfc822);
 startActivity(Intent.createChooser(i, Title:));

It is working fine, I mean sending the mail to the reciever.

But it is launching another Email app (android default app I guess).
But I dont want it to be launched, I want directly send the mail to
reciepent.

My mail goal is that, the user should not know that the mail is
sending. The default Email app (android's) should not be visible to
the user. The mail sent process should be done in background.

Can any one please help me?

Thanks,
Manoj

-- 
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


Re: [android-developers] How to run the email app background

2009-11-21 Thread Rachel Blackman

On Nov 21, 2009, at 12:12 AM, manoj wrote:

 It is working fine, I mean sending the mail to the reciever.
 
 But it is launching another Email app (android default app I guess).
 But I dont want it to be launched, I want directly send the mail to
 reciepent.

Then you will need to write ESMTP client code and include that in your app, I 
expect.  Or find an available library and download it.  (ESMTP = the actual 
behind-the-scenes mail sending protocol.)  This will, admittedly, be a pain 
since you will need to figure out the appropriate server to send to, whether or 
not it needs authentication, etc.

I don't think there's any way to make the system e-mail client send the mail 
silently/without user intervention.

 My mail goal is that, the user should not know that the mail is
 sending. The default Email app (android's) should not be visible to
 the user. The mail sent process should be done in background.

Honestly, as a user, I prefer to know when my phone is sending e-mails on my 
behalf.  Being able to review and send the e-mail myself in the mail client 
thus seems, to me, to be the 'correct' behavior.  Especially since you, the 
developer, then get the benefit of not-needing-to-muck-about-with-ESMTP, as the 
e-mail client does all of the actual formatting/authentication/sending logic 
for 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: Is there any way to display 8000 * 8000 jpeg file without OutOfMemoryException

2009-11-21 Thread ko5tik
Extracting  just a single tile out of JPEG file  is a really big PITA
There are about 27 different variants of JPEG (though not all really
matter
and are widely used)

Usually you've got 8x8 tiles in row-order,  and because of entropy
encoding
you can not navigate just to  random tile - you'll have to scan from
the start
( maybe you can build index,  where single block-rows start - this
will make scanning easier )

In this case, there will be only 1000 rows,  with 1000 block in them
- performance may
be adequate.

On Nov 20, 11:32 pm, Robert Green rbgrn@gmail.com wrote:
 I'd solve this by writing a preprocessor that breaks that big file
 down into manageable chunks.  Think of having 10x10 array of 800x800
 images.  I would also mipmap a 4000x4000, 2000x2000, 1000x1000 and
 500x500 of the file.  Then, start the user on the correct zoom level,
 using only the tiles you need of your arrays.  OpenGL is actually
 really good for this sort of thing.  You could feasibly use 1024x1024
 pixel texture tiles with an orthographic projection and let it handle
 the scaling.

 In short, I don't believe there is any way to get 8000x8000x16bit =
 128MB of bitmap data into 16MB of RAM all at once, but you can
 definitely break it apart and work with pieces.  A 1000x1000 pixel
 piece consumes 2MB of RAM.  You could have 4 of those loaded at once
 and be OK on memory.  If you're viewing actual pixels, you only need a
 max of 4 loaded at a time to have seamless panning between them.

 On Nov 20, 2:38 pm, PJ pjbar...@gmail.com wrote:

  We might be able to come up with more creative solutions if you give
  us more information about where the 8000x8000 jpeg file is coming
  from, and whether you just want to display it in a WxH view or to do
  something else with it.

  Also, since you expressed interest in Google's server-side solution
  for Google Maps, are you considering developing a server-side
  component to your app as well?  If so, you could host this capability
  (convert 8000x8000 image to smaller image) on a server somewhere.

  If you try to do all processing on the device itself, it's probably
  going to be very slow.

  What does your app do?  Now you've got me all curious.  :D

  -- PJ

  On Nov 19, 7:06 pm, James Wang jameswangc...@gmail.com wrote:

 Step #2: Generate 10,000 tiles that are 80*80 instead (100 * 100 
 tiles).

 Step #3: Render tiles on-screen by drawing them on the Canvas, and
 support swipe gestures to move through the image by replacing tiles,
 much like Google Maps works.

   Hi Mark, AFAIK, the decoder of jpeg on android must support to read
   random part of jpeg file if I want do step#2 as you said.
   I checked out SDK reference and found out the default decoder of jpeg
   seems not support it. Am I right?
   Do I have to make another jpeg decoder?

   BTW, I think google map does the same thing on server side, not on
   mobile phone, does not 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] button.setheight not working ?

2009-11-21 Thread Jags
Hi all,

Can anybody please confirm, that button.setHeight and button.setWidth
is not changing the height and width of buttons at the run time ? I am
using android 1.5

regards
Jagat

-- 
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: button.setheight not working ?

2009-11-21 Thread Nithin
Hi,

I am using android 1.6. In that , its working fine, but setHeight()
and setWidth() are pretty straight forward, nothing complex in that.
You are creating button in code right ?.

Thanks


On Nov 21, 3:00 pm, Jags jag...@gmail.com wrote:
 Hi all,

 Can anybody please confirm, that button.setHeight and button.setWidth
 is not changing the height and width of buttons at the run time ? I am
 using android 1.5

 regards
 Jagat

-- 
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: button.setheight not working ?

2009-11-21 Thread Jags
thanks for replying,

i was wondering that too, i wrote a plain code, there it works. is my
linearlayout restricting it ?

i have my layout defined as below

LinearLayout android:id=@+id/LinearLayout01
android:layout_width=fill_parent
android:layout_height=wrap_content
android:layout_marginTop=40dip
Button android:id=@+id/Button01 android:layout_width=60px
android:layout_height=60px 
android:background=@drawable/btnattr
android:scaleType=fitXY 
android:layout_marginLeft=20dip
android:layout_marginTop=5dip 
android:layout_weight=1/Button
Button android:id=@+id/Button02 android:layout_width=60px
android:layout_height=60px 
android:background=@drawable/btnattr
android:scaleType=fitXY 
android:layout_marginLeft=20dip
android:layout_marginTop=5dip 
android:layout_weight=1/Button
Button android:id=@+id/Button03 android:layout_width=60px
android:layout_height=60px 
android:background=@drawable/btnattr
android:scaleType=fitXY 
android:layout_marginLeft=20dip
android:layout_marginTop=5dip 
android:layout_weight=1/Button
/LinearLayout

On Nov 21, 4:34 pm, Nithin nithin.war...@gmail.com wrote:
 Hi,

 I am using android 1.6. In that , its working fine, but setHeight()
 and setWidth() are pretty straight forward, nothing complex in that.
 You are creating button in code right ?.

 Thanks

 On Nov 21, 3:00 pm, Jags jag...@gmail.com wrote:

  Hi all,

  Can anybody please confirm, that button.setHeight and button.setWidth
  is not changing the height and width of buttons at the run time ? I am
  using android 1.5

  regards
  Jagat

-- 
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: Saving service killing without startForeground

2009-11-21 Thread Ash
Thanks for responding!!

Well!! I am working with emulator currently and the behaviour is same.
I have confirmed from the logs that the service is not crashing. All I
could observe from the logs that System is killing the service(and
hence the process) as its not a system service.

your service is not using a background thread
Well my service is a multi-threaded application but not sure what you
mean here. Its a Android application/process with only one service and
nothing more than it.Do you mean I should start a thread for running
the service? I thought of utilizing the process as its only one
service in the process.

Thanks in advance
Ash

On Nov 20, 1:52 pm, Ash ashutoshkagra...@gmail.com wrote:
 Hi!!,

 I am running a background Android Service as VoIP Framework which
 provides different VoIP services to different Android applications,
 (VoIP call, Video Call, etc). The service establishes a network
 connection with the Server(Service Provider) and does some initial
 handshake before it can start providing service to the Android
 applications, that’s why though of starting the service on
 BOOT_COMPLETED event.

 The problem is when the service gets started on BOOT_COMPLETED event,
 before even it finishes the initial network connection with server and
 handshaking, it gets killed by the system.

 I have tried using setForeground which improves the behavior a bit but
 still gets killed mid-way. I am working with old version 1.5 r3 of SDK
 and hence, cannot use startForeground.

 Is there a way out or another alternative available with SDK 1.5 r3?

 Thanks in advance,
 Ash

-- 
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: button.setheight not working ?

2009-11-21 Thread Jags
I guess as my linearlayout's width is wrap_content, it will expand
when my button expands. width might not expand, because of the weight
= 1 factor

On Nov 21, 4:38 pm, Jags jag...@gmail.com wrote:
 thanks for replying,

 i was wondering that too, i wrote a plain code, there it works. is my
 linearlayout restricting it ?

 i have my layout defined as below

         LinearLayout android:id=@+id/LinearLayout01
                 android:layout_width=fill_parent
 android:layout_height=wrap_content
                 android:layout_marginTop=40dip
                 Button android:id=@+id/Button01 android:layout_width=60px
                         android:layout_height=60px 
 android:background=@drawable/btnattr
                         android:scaleType=fitXY 
 android:layout_marginLeft=20dip
                         android:layout_marginTop=5dip 
 android:layout_weight=1/Button
                 Button android:id=@+id/Button02 android:layout_width=60px
                         android:layout_height=60px 
 android:background=@drawable/btnattr
                         android:scaleType=fitXY 
 android:layout_marginLeft=20dip
                         android:layout_marginTop=5dip 
 android:layout_weight=1/Button
                 Button android:id=@+id/Button03 android:layout_width=60px
                         android:layout_height=60px 
 android:background=@drawable/btnattr
                         android:scaleType=fitXY 
 android:layout_marginLeft=20dip
                         android:layout_marginTop=5dip 
 android:layout_weight=1/Button
         /LinearLayout

 On Nov 21, 4:34 pm, Nithin nithin.war...@gmail.com wrote:

  Hi,

  I am using android 1.6. In that , its working fine, but setHeight()
  and setWidth() are pretty straight forward, nothing complex in that.
  You are creating button in code right ?.

  Thanks

  On Nov 21, 3:00 pm, Jags jag...@gmail.com wrote:

   Hi all,

   Can anybody please confirm, that button.setHeight and button.setWidth
   is not changing the height and width of buttons at the run time ? I am
   using android 1.5

   regards
   Jagat

-- 
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 fetch Mobile Number

2009-11-21 Thread Nithin
Hi Nishant,

Just try getLine1Number() in the TelephonyManager. It may help

Thanks
Nithin



On Nov 21, 11:57 am, Nishant nish...@saltriver.com wrote:
 Hi,

 Is it possible to fetch Owner Mobile number.
 I have got the operator name but not able to fetch the Mobile Number.

 Which intent will be used?

 Regards,
 Nishant Shah

-- 
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


Re: [android-developers] Re: Saving service killing without startForeground

2009-11-21 Thread Mark Murphy
Ash wrote:
 your service is not using a background thread
 Well my service is a multi-threaded application but not sure what you
 mean here. 

Your service presumably implements some combination of onCreate(),
onStart(), onBind(), and onDestroy(). It might also implement some other
callbacks, objects on which Android will invoke certain methods at
certain times.

All of those will be called on the main application thread -- in an
activity, we'd call this the UI thread. You should not be doing
anything that takes much time on the UI thread. If you take too much
time, Android will assume your service is stuck and will kill it off
with the service equivalent of an Application Not Responding (ANR) error.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Consulting/App Development: http://commonsware.com/consulting

-- 
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: button.setheight not working ?

2009-11-21 Thread Jags
ok ! setting the buttons' height and width to wrap-content, worked !,
but it screwed something else in the application.

Is there a possibility that i have 5 linearlayouts in main.xml, and i
start displaying with 3 linearlayouts and ad one by one after some
time ? what woyld that code be ?

linearlayout.setvisibility=invisible is not the solution because ll is
invisible but it is aquiring screen space. i want that screen space
free, so that the buttons are arranged perfectly

regards
Jagat

On Nov 21, 4:43 pm, Jags jag...@gmail.com wrote:
 I guess as my linearlayout's width is wrap_content, it will expand
 when my button expands. width might not expand, because of the weight
 = 1 factor

 On Nov 21, 4:38 pm, Jags jag...@gmail.com wrote:

  thanks for replying,

  i was wondering that too, i wrote a plain code, there it works. is my
  linearlayout restricting it ?

  i have my layout defined as below

          LinearLayout android:id=@+id/LinearLayout01
                  android:layout_width=fill_parent
  android:layout_height=wrap_content
                  android:layout_marginTop=40dip
                  Button android:id=@+id/Button01 
  android:layout_width=60px
                          android:layout_height=60px 
  android:background=@drawable/btnattr
                          android:scaleType=fitXY 
  android:layout_marginLeft=20dip
                          android:layout_marginTop=5dip 
  android:layout_weight=1/Button
                  Button android:id=@+id/Button02 
  android:layout_width=60px
                          android:layout_height=60px 
  android:background=@drawable/btnattr
                          android:scaleType=fitXY 
  android:layout_marginLeft=20dip
                          android:layout_marginTop=5dip 
  android:layout_weight=1/Button
                  Button android:id=@+id/Button03 
  android:layout_width=60px
                          android:layout_height=60px 
  android:background=@drawable/btnattr
                          android:scaleType=fitXY 
  android:layout_marginLeft=20dip
                          android:layout_marginTop=5dip 
  android:layout_weight=1/Button
          /LinearLayout

  On Nov 21, 4:34 pm, Nithin nithin.war...@gmail.com wrote:

   Hi,

   I am using android 1.6. In that , its working fine, but setHeight()
   and setWidth() are pretty straight forward, nothing complex in that.
   You are creating button in code right ?.

   Thanks

   On Nov 21, 3:00 pm, Jags jag...@gmail.com wrote:

Hi all,

Can anybody please confirm, that button.setHeight and button.setWidth
is not changing the height and width of buttons at the run time ? I am
using android 1.5

regards
Jagat

-- 
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] possible to remove a linearlayout ?

2009-11-21 Thread Jags
i have put 6 linearlayouts in the main.xml file vertically arranged in
the main linearlayout. initially i want 1, 2, 3 and 6 ll to be
displayed, then after sometime, 1, 2, 3, 4, 6 and then after some time
1, 2, 3, 4, 5, 6

is it possible ?

regards
Jagat

-- 
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


Re: [android-developers] possible to remove a linearlayout ?

2009-11-21 Thread Mark Murphy
Jags wrote:
 i have put 6 linearlayouts in the main.xml file vertically arranged in
 the main linearlayout. initially i want 1, 2, 3 and 6 ll to be
 displayed, then after sometime, 1, 2, 3, 4, 6 and then after some time
 1, 2, 3, 4, 5, 6
 
 is it possible ?

Set the visibility of the ones you do not want to HIDE. Set the
visibility of the hidden ones you want to show to VISIBLE.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_Beginning Android_ from Apress Now Available!

-- 
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: methods not working (force closing), is there something wrong?

2009-11-21 Thread Breezy
Hmmm, I used that but I can't decipher what it's saying

11-21 06:04:48.388: WARN/dalvikvm(776): threadid=3: thread exiting
with uncaught exception (group=0x4000fe70)
11-21 06:04:48.396: ERROR/AndroidRuntime(776): Uncaught handler:
thread main exiting due to uncaught exception
11-21 06:04:48.487: ERROR/AndroidRuntime(776):
java.lang.RuntimeException: Unable to start activity ComponentInfo
{com.example.comparibook/com.example.comparibook.CompariBook}:
java.lang.NullPointerException
11-21 06:04:48.487: ERROR/AndroidRuntime(776): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2268)
11-21 06:04:48.487: ERROR/AndroidRuntime(776): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2284)
11-21 06:04:48.487: ERROR/AndroidRuntime(776): at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
11-21 06:04:48.487: ERROR/AndroidRuntime(776): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
11-21 06:04:48.487: ERROR/AndroidRuntime(776): at
android.os.Handler.dispatchMessage(Handler.java:99)
11-21 06:04:48.487: ERROR/AndroidRuntime(776): at
android.os.Looper.loop(Looper.java:123)
11-21 06:04:48.487: ERROR/AndroidRuntime(776): at
android.app.ActivityThread.main(ActivityThread.java:3948)
11-21 06:04:48.487: ERROR/AndroidRuntime(776): at
java.lang.reflect.Method.invokeNative(Native Method)
11-21 06:04:48.487: ERROR/AndroidRuntime(776): at
java.lang.reflect.Method.invoke(Method.java:521)
11-21 06:04:48.487: ERROR/AndroidRuntime(776): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
11-21 06:04:48.487: ERROR/AndroidRuntime(776): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
11-21 06:04:48.487: ERROR/AndroidRuntime(776): at
dalvik.system.NativeStart.main(Native Method)
11-21 06:04:48.487: ERROR/AndroidRuntime(776): Caused by:
java.lang.NullPointerException
11-21 06:04:48.487: ERROR/AndroidRuntime(776): at
com.example.comparibook.CompariBook.onCreate(CompariBook.java:65)
11-21 06:04:48.487: ERROR/AndroidRuntime(776): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1123)
11-21 06:04:48.487: ERROR/AndroidRuntime(776): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2231)
11-21 06:04:48.487: ERROR/AndroidRuntime(776): ... 11 more


On Nov 20, 9:08 pm, Arron arro...@gmail.com wrote:
 It is a lot easier to use ddms and find the exact exception and get
 the stack trace to figure out what's wrong.

 On Nov 20, 6:43 pm, Breezy mbre...@gmail.com wrote:

  I've a couple functions that basically parse XML but it's not XML it
  is parsing something similar.  I use them in PHP to break apart large
  strings so I converted them to Java for this, but when I use them they
  force close.
  I use this code to call them

                  String[] blah = dig_all (item, enditem, str);
                  String blah1 = dig_data(author,endauthor,blah[0]);

  That's the gist of it.  I know the string str is good, checked it,
  but if I run these lines I get a force close, if I comment them out I
  do not.  The methods are below.  See anything wrong?

      private String dig_data(String starter, String ender, String
  content)
      {
          String[] data = content.split(starter);
          String[] data1 = data[1].split(ender);
          return data1[0];
      }
      private String[] dig_all(String starter, String ender, String
  content)
      {
          String[] result = null, data, data1;
          String data2;
          boolean more = true;
          int i = 0;
          int limit = 0;

          do
          {
                  i++;
                  data = content.split(starter);
                  data1 = data[i].split(ender);
                  data2 = data1[0];
                  if ((data2==null) || (limit0  i==limit))
                          more = false;
                  else result[i] = data2;
          } while (more == true);
                  return result;
      }

-- 
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] restore factory settings

2009-11-21 Thread Nemat
Hi friends


I have to restore factory settings of phone programmatically..Is
that possible?if yes,How can we do tht?

Thanks in Advance
Nemat

-- 
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


Re: [android-developers] Re: methods not working (force closing), is there something wrong?

2009-11-21 Thread Mark Murphy
Breezy wrote:
 Hmmm, I used that but I can't decipher what it's saying

snip

 11-21 06:04:48.487: ERROR/AndroidRuntime(776): Caused by:
 java.lang.NullPointerException
 11-21 06:04:48.487: ERROR/AndroidRuntime(776): at
 com.example.comparibook.CompariBook.onCreate(CompariBook.java:65)

When examining a stack trace, look for the Caused by: portion, as most
of the time that will indicate where your error is. In this case, you
have a NullPointerException on line 65 of CompariBook.java.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 2.8
Available!

-- 
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: possible to remove a linearlayout ?

2009-11-21 Thread Jags
I was doing that but i was doing INVISIBLE and VISIBLE, so invisible
layout was still occupying layout space. So I used GONE and VISIBLE.
this worked. I am a moron :) it should have struck to my mind

anyways, hope it helps somebody else

thanks and regards
Jagat

On Nov 21, 6:07 pm, Mark Murphy mmur...@commonsware.com wrote:
 Jags wrote:
  i have put 6 linearlayouts in the main.xml file vertically arranged in
  the main linearlayout. initially i want 1, 2, 3 and 6 ll to be
  displayed, then after sometime, 1, 2, 3, 4, 6 and then after some time
  1, 2, 3, 4, 5, 6

  is it possible ?

 Set the visibility of the ones you do not want to HIDE. Set the
 visibility of the hidden ones you want to show to VISIBLE.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 _Beginning Android_ from Apress Now Available!

-- 
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] Got exception when using MediaRecorder.AudioSource.VOICE_CALL

2009-11-21 Thread manoj
Hi All,

I am trying to write a recorder app (android 1.6).

I have used the following code:

 recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
 recorder.setOutputFile(/sdcard/record.3gp);
 try {
recorder.prepare();


} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
 recorder.start();

I am getting the following exception.

Can any one please help to solve this?

E/AndroidRuntime( 1437): Uncaught handler: thread main exiting due to
uncaught exception
E/AndroidRuntime( 1437): java.lang.RuntimeException: start failed.
E/AndroidRuntime( 1437): at android.media.MediaRecorder.start
(Native Method)
E/AndroidRuntime( 1437): at
com.Recorder.MyRecorder.PrepareAudioRecorder(MyRecorder.java:241)
E/AndroidRuntime( 1437): at com.Recorder.MyRecorder.HandleEvent
(MyRecorder.java:288)
E/AndroidRuntime( 1437): at
com.Recorder.RecorderForMyApp.HandleAudioRecorderEvent
(RecorderForMyApp.java:327)
E/AndroidRuntime( 1437): at com.Recorder.RecorderForMyApp.access$1
(RecorderForMyApp.java:322)
E/AndroidRuntime( 1437): at com.Recorder.RecorderForMyApp$2.onClick
(RecorderForMyApp.java:170)
E/AndroidRuntime( 1437): at android.view.View.performClick
(View.java:2344)
E/AndroidRuntime( 1437): at android.view.View.onTouchEvent
(View.java:4133)
E/AndroidRuntime( 1437): at android.widget.TextView.onTouchEvent
(TextView.java:6504)
E/AndroidRuntime( 1437): at android.view.View.dispatchTouchEvent
(View.java:3672)
E/AndroidRuntime( 1437): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
E/AndroidRuntime( 1437): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
E/AndroidRuntime( 1437): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
E/AndroidRuntime( 1437): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
E/AndroidRuntime( 1437): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
E/AndroidRuntime( 1437): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882)
E/AndroidRuntime( 1437): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchTouchEvent(PhoneWindow.java:1712)
E/AndroidRuntime( 1437): at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent
(PhoneWindow.java:1202)
E/AndroidRuntime( 1437): at android.app.Activity.dispatchTouchEvent
(Activity.java:1987)
E/AndroidRuntime( 1437): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchTouchEvent(PhoneWindow.java:1696)
E/AndroidRuntime( 1437): at android.view.ViewRoot.handleMessage
(ViewRoot.java:1658)
E/AndroidRuntime( 1437): at android.os.Handler.dispatchMessage
(Handler.java:99)
E/AndroidRuntime( 1437): at android.os.Looper.loop(Looper.java:
123)
E/AndroidRuntime( 1437): at android.app.ActivityThread.main
(ActivityThread.java:4203)
E/AndroidRuntime( 1437): at java.lang.reflect.Method.invokeNative
(Native Method)
E/AndroidRuntime( 1437): at java.lang.reflect.Method.invoke
(Method.java:521)
E/AndroidRuntime( 1437): at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime( 1437): at com.android.internal.os.ZygoteInit.main
(ZygoteInit.java:549)
E/AndroidRuntime( 1437): at dalvik.system.NativeStart.main(Native
Method)

-- 
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] Custom Dialog example may be incorrect

2009-11-21 Thread Kevin S.
I spent quite a long time trying to get my first custom dialog box to
work, following the example in the Android Dev Guide.

Specifically:

http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog
---
Context mContext = getApplicationContext();
Dialog dialog = new Dialog(mContext);

dialog.setContentView(R.layout.custom_dialog);
dialog.setTitle(Custom Dialog);
---

  I kept getting a badtokenexception whenever I tried to show the
dialog.

  Eventually I found a forum posting which suggested changing it to:

new Dialog(this);

  Which made the problem go away.

  My question is if the example is incorrect, or was the code not
intended to be used in an Activity method?


-Kevin



-- 
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] Random phone restarts, anyone else experience this?

2009-11-21 Thread Mark Wyszomierski
Hi,

Not sure if anyone else is experiencing this. My G1 will randomly
restart itself up to two times a day. Found this in DDMS as the
possible cause. I'm wondering if my app has anything to do with it,
but I doubt it since my app is usually closed or will have been idle
for hours when this happens (and only uses at most 5mb of memory):


The tag for all these messages is AndroidRuntime:

11-21 09:06:49.811: ERROR/LockPatternKeyguardView(3813): Failed to
bind to GLS while checking for account
11-21 09:06:49.831: ERROR/dalvikvm-heap(3813): 614400-byte external
allocation too large for this process.
11-21 09:06:49.831: ERROR/(3813): VM won't let us allocate 614400
bytes
11-21 09:06:49.881: WARN/dalvikvm(3813): threadid=37: thread exiting
with uncaught exception (group=0x4000fe70)
11-21 09:06:49.881: ERROR/AndroidRuntime(3813): Uncaught handler:
thread WindowManagerPolicy exiting due to uncaught exception
11-21 09:06:49.881: ERROR/AndroidRuntime(3813): *** EXCEPTION IN
SYSTEM PROCESS.  System will crash.
11-21 09:06:50.081: ERROR/AndroidRuntime(3813):
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
11-21 09:06:50.081: ERROR/AndroidRuntime(3813): at
android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
11-21 09:06:50.081: ERROR/AndroidRuntime(3813): at
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:363)
11-21 09:06:50.081: ERROR/AndroidRuntime(3813): at
android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:212)
11-21 09:06:50.081: ERROR/AndroidRuntime(3813): at
android.graphics.drawable.Drawable.createFromResourceStream
(Drawable.java:663)
11-21 09:06:50.081: ERROR/AndroidRuntime(3813): at
android.content.res.Resources.loadDrawable(Resources.java:1637)
11-21 09:06:50.081: ERROR/AndroidRuntime(3813): at
android.content.res.Resources.getDrawable(Resources.java:535)
11-21 09:06:50.081: ERROR/AndroidRuntime(3813): at
android.app.ApplicationContext.getWallpaper(ApplicationContext.java:
505)
11-21 09:06:50.081: ERROR/AndroidRuntime(3813): at
com.android.internal.policy.impl.LockPatternKeyguardView.init
(LockPatternKeyguardView.java:265)
11-21 09:06:50.081: ERROR/AndroidRuntime(3813): at
com.android.internal.policy.impl.LockPatternKeyguardViewProperties.createKeyguardView
(LockPatternKeyguardViewProperties.java:48)
11-21 09:06:50.081: ERROR/AndroidRuntime(3813): at
com.android.internal.policy.impl.KeyguardViewManager.show
(KeyguardViewManager.java:123)
11-21 09:06:50.081: ERROR/AndroidRuntime(3813): at
com.android.internal.policy.impl.KeyguardViewMediator.handleShow
(KeyguardViewMediator.java:860)
11-21 09:06:50.081: ERROR/AndroidRuntime(3813): at
com.android.internal.policy.impl.KeyguardViewMediator.access$500
(KeyguardViewMediator.java:85)
11-21 09:06:50.081: ERROR/AndroidRuntime(3813): at
com.android.internal.policy.impl.KeyguardViewMediator$2.handleMessage
(KeyguardViewMediator.java:770)
11-21 09:06:50.081: ERROR/AndroidRuntime(3813): at
android.os.Handler.dispatchMessage(Handler.java:99)
11-21 09:06:50.081: ERROR/AndroidRuntime(3813): at
android.os.Looper.loop(Looper.java:123)
11-21 09:06:50.081: ERROR/AndroidRuntime(3813): at
com.android.server.WindowManagerService$PolicyThread.run
(WindowManagerService.java:474)

-- 
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: Reusing intents with notification/pending intents

2009-11-21 Thread jsdf
Does anyone have suggestions on this?
I appreciate the help!

On Nov 19, 5:38 pm, jsdf jasons...@gmail.com wrote:
 Hi all,
 A quick question (for those who know the answer, anyway):

 In my app, user starts a service and shows a notification from
 activity A.
 The notification creates a PendingIntent that will invoke activity A
 should the user tap on it.
 The problem with this behavior is that, if the user starts the service
 (which shows the notification), drags down the notification bar, then
 taps the notification, I now have two activity A's in the display
 stack, one on top of the other and both exactly the same.
 How can I re-use the original activity A in this situation so the user
 isn't duplicating activities?

 Thanks,
 jsdf

-- 
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 fetch Mobile Number

2009-11-21 Thread Nishant
Hi,

I have tried it in emulator. It should return 5554
But it gives me another number.

Thanks  Regards,
Nishant Shah

-- 
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: button.setheight not working ?

2009-11-21 Thread skink


On Nov 21, 12:28 pm, Jags jag...@gmail.com wrote:
 linearlayout.setvisibility=invisible is not the solution because ll is
 invisible but it is aquiring screen space. i want that screen space
 free, so that the buttons are arranged perfectly


so use GONE instead ov INVISIBLE

-- 
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: 2.0 AccountManager - Implementing a new account type with Google, Facebook and Exchange

2009-11-21 Thread Jerry Brady
Sukumar,

I see the exact same behavior in my code.  It's confusing.  Everything
seems to be setup properly, but the system never invokes by
implementation of AbstractAccountAuthenticator.

My assumption was that by defining the proper service and intent in
the manifest, the account settings manager would pick this up and call
my service from the Accounts  Sync menu when someone chooses to
manipulate an account of my type.

However, since my primary intention is to create an account for use
only by my application, if I can get addAccountExplicitly working,
I'll should be happy.  Nevertheless, I want to understand this part of
the system.

So if your AbstractAccountAuthenticator isn't being invoked, how can
you be calling addAccountExplicitly from within that class?

Cheers,
Jerry

On Nov 20, 2:16 am, sukumar bhashyam bhashyam.suku...@gmail.com
wrote:
 AddAccountExplicitly() would need Authenticator of same type.

 I created an Authenticator and called AddAccountExplicitly() for the same
 type which created an account ( Could verify it from
 AccountManager.getAccounts())

 One strange thing I observer is none of the  implementation class functions
 of AbstractAccountAuthenticator is being called. I followed the exact steps
 in documentation. Not even onCreate or onBind function is called. Anyone
 seen this problem?. Is your AbstractAccountAuthenticator implemetation class
 being invoked?.
 Thanks.

 On Thu, Nov 19, 2009 at 8:26 PM, Jerry Brady jerry.br...@gmail.com wrote:
  Dan,

  Thanks for all of this.  I just returned to the office and will be
  taking a look to see how much further I can get and I will certainly
  be interested in helping with your accounts project.

  I got as far as getting my account to show up in the list of accounts
  along with Google, Facebook and Exchange, but my service never gets
  called.  My addAccount() method doesn't return an intent, but rather
  KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE in it's bundle to let the
  account request succeed.

  My goal is to create an account that will only be used by my
  application and does not need to have any features to enable external
  authentication or account configuration.

  I've also tried AddAccountExplicitly() but I can't seem to get around
  its UID restrictions.  The calling activity and the authenticator
  service all belong to the same application so I'm not sure why the
  system still throws an error about the UID not being correct.

  Cheers,
  Jerry

  On Nov 13, 11:54 pm, Dan Dumont ddum...@gmail.com wrote:
   For anyone still interested.    I've made a bit of progress.   The google
   project below now creates and lists accounts of the type for the project!

   On Fri, Nov 13, 2009 at 9:39 PM, Dan Dumont ddum...@gmail.com wrote:
To facilitate the discussion around this topic, I've started up a
  project
over here:
   http://code.google.com/p/androidaccounts/

http://code.google.com/p/androidaccounts/If anyone is interested in
pitching in and writing some examples, let me know so I can add you.
The current state of the project is as far as I've gotten to
  understanding
what is available so far... and I'm stumped as to why new accounts
  don't
seem to persist after their creation ( as far as the AccountsTester app
  is
concerned ).

On Fri, Nov 13, 2009 at 7:40 PM, Dan Dumont ddum...@gmail.com wrote:

I've gotten a bit further than you.

The account manager seems to want to store AccountName+Type pairs, and
have an AccountAuthenticator handle the storage and dirty bits of the
  actual
authentication and credential storage.

You will need to create an AccountAuthenticator from the
AbstractAccountAuthenticator class.
You will also need to define a Service in your app.   See
   http://developer.android.com/reference/android/accounts/AbstractAccou.
  ..
This service must be set up in the Manifest like so:  (ripped from
  link
above)

 intent-filter
     action android:name=android.accounts.AccountAuthenticator /
   /intent-filter
   meta-data android:name=android.accounts.AccountAuthenticator
             android:resource=@xml/authenticator /

You can take a look at the link for what the resource must be...

After you end up hooking all that crap up, you can do this in your
service:
 public IBinder onBind(Intent intent) {
 IBinder ret = null;
 if

  (intent.getAction().equals(android.accounts.AccountManager.ACTION_AUTHENTIC
  ATOR_INTENT))
 ret = getAuthenticator().getIBinder();
 return ret;
 }

private AccountAuthenticator getSametimeAuthenticator() {
 if (_aa == null)
_aa = new AccountAuthenticator(this);
return _aa;
 }

So when you finally have all this set up.    You should see your
  account
type listed in the AccountTester application next to the Corporate
  type.
To get anything meaningful to happen when you click Add, you need to
  do
this in your 

[android-developers] Re: 2.0 AccountManager - Implementing a new account type with Google, Facebook and Exchange

2009-11-21 Thread Jerry Brady
Dan,

I didn't see this call in your current Google code project.  Is your
use of AddAccountExplicitly() in there?

Cheers,
Jerry

On Nov 20, 7:53 am, Dan Dumont ddum...@gmail.com wrote:
 Yes.   But I make the AddAccountExplicitly call in my Authenticator.    You
 use the AccountManager to create accounts.
 If you call AddAccountExplicitly from a non-authenticator class, I guess it
 will work...  But I think the security behind it will mean that only the
 class that created the account will be able to ever modify it or extract the
 password.

 This is why they have a framework for you to get an authtoken returned via
 the authenticator... the logic for authenticating should be buried within
 there, because it will be the only class allowed to peak at the password and
 send it wherever you are authenticating.

 On Fri, Nov 20, 2009 at 2:16 AM, sukumar bhashyam 

 bhashyam.suku...@gmail.com wrote:
  AddAccountExplicitly() would need Authenticator of same type.

  I created an Authenticator and called AddAccountExplicitly() for the same
  type which created an account ( Could verify it from
  AccountManager.getAccounts())

  One strange thing I observer is none of the  implementation class functions
  of AbstractAccountAuthenticator is being called. I followed the exact steps
  in documentation. Not even onCreate or onBind function is called. Anyone
  seen this problem?. Is your AbstractAccountAuthenticator implemetation class
  being invoked?.
  Thanks.

  On Thu, Nov 19, 2009 at 8:26 PM, Jerry Brady jerry.br...@gmail.comwrote:

  Dan,

  Thanks for all of this.  I just returned to the office and will be
  taking a look to see how much further I can get and I will certainly
  be interested in helping with your accounts project.

  I got as far as getting my account to show up in the list of accounts
  along with Google, Facebook and Exchange, but my service never gets
  called.  My addAccount() method doesn't return an intent, but rather
  KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE in it's bundle to let the
  account request succeed.

  My goal is to create an account that will only be used by my
  application and does not need to have any features to enable external
  authentication or account configuration.

  I've also tried AddAccountExplicitly() but I can't seem to get around
  its UID restrictions.  The calling activity and the authenticator
  service all belong to the same application so I'm not sure why the
  system still throws an error about the UID not being correct.

  Cheers,
  Jerry

  On Nov 13, 11:54 pm, Dan Dumont ddum...@gmail.com wrote:
   For anyone still interested.    I've made a bit of progress.   The
  google
   project below now creates and lists accounts of the type for the
  project!

   On Fri, Nov 13, 2009 at 9:39 PM, Dan Dumont ddum...@gmail.com wrote:
To facilitate the discussion around this topic, I've started up a
  project
over here:
   http://code.google.com/p/androidaccounts/

http://code.google.com/p/androidaccounts/If anyone is interested in
pitching in and writing some examples, let me know so I can add you.
The current state of the project is as far as I've gotten to
  understanding
what is available so far... and I'm stumped as to why new accounts
  don't
seem to persist after their creation ( as far as the AccountsTester
  app is
concerned ).

On Fri, Nov 13, 2009 at 7:40 PM, Dan Dumont ddum...@gmail.com
  wrote:

I've gotten a bit further than you.

The account manager seems to want to store AccountName+Type pairs,
  and
have an AccountAuthenticator handle the storage and dirty bits of the
  actual
authentication and credential storage.

You will need to create an AccountAuthenticator from the
AbstractAccountAuthenticator class.
You will also need to define a Service in your app.   See

 http://developer.android.com/reference/android/accounts/AbstractAccou...
This service must be set up in the Manifest like so:  (ripped from
  link
above)

 intent-filter
     action android:name=android.accounts.AccountAuthenticator /
   /intent-filter
   meta-data android:name=android.accounts.AccountAuthenticator
             android:resource=@xml/authenticator /

You can take a look at the link for what the resource must be...

After you end up hooking all that crap up, you can do this in your
service:
 public IBinder onBind(Intent intent) {
 IBinder ret = null;
 if

  (intent.getAction().equals(android.accounts.AccountManager.ACTION_AUTHENTIC
  ATOR_INTENT))
 ret = getAuthenticator().getIBinder();
 return ret;
 }

private AccountAuthenticator getSametimeAuthenticator() {
 if (_aa == null)
_aa = new AccountAuthenticator(this);
return _aa;
 }

So when you finally have all this set up.    You should see your
  account
type listed in the AccountTester application next to the Corporate
  type.
To get anything meaningful to happen 

[android-developers] getPressure and getSize in MotionEvent always return the same value?

2009-11-21 Thread davemac
This is for a touchscreen application. If I press a finger down and
drag it around, I would expect that getPressure and getSize would give
me a different value as I change how hard I press while dragging.
However, both of these methods always return the initial value from
the first MotionEvent that I get in my handler. In other words,
whatever value is returned from getPressure on the first MotionEvent
that has ACTION_DOWN, I get that same value for every subsequent
ACTION_MOVE event all the way through to the final ACTION_UP event.
The same is true for getSize. If I'm actually changing how hard I
press on the screen as I drag my finger around, I want to get changing
values from getPressure. Is this possible? Am I missing something?

This is on a Motorola Droid.

I tried using the Pointer Location application and it also shows the
same behavior, the initial value from getPressure is the value I get
for all subsequent values from getPressure while the finger remains
down. Thanks for your help.

- dave

-- 
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: 2.0 AccountManager - Implementing a new account type with Google, Facebook and Exchange

2009-11-21 Thread Jerry Brady
Dan,

Now I see what you are doing in your code and found the reference to
AddAccountExplicitly().   I want to skip returning an intent to fire
the an AccountAuthenticatorActivity and instead to return
KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE directly from my
AbstractAccountAuthenticator's addAccount method whereas your code
returns an intent that fires your authentication activity.

The main issue for me so far is that I don't see that my
AbstractAccountAuthenticator is ever being instantiated.

Cheers,
Jerry

On Nov 20, 7:53 am, Dan Dumont ddum...@gmail.com wrote:
 Yes.   But I make the AddAccountExplicitly call in my Authenticator.    You
 use the AccountManager to create accounts.
 If you call AddAccountExplicitly from a non-authenticator class, I guess it
 will work...  But I think the security behind it will mean that only the
 class that created the account will be able to ever modify it or extract the
 password.

 This is why they have a framework for you to get an authtoken returned via
 the authenticator... the logic for authenticating should be buried within
 there, because it will be the only class allowed to peak at the password and
 send it wherever you are authenticating.

 On Fri, Nov 20, 2009 at 2:16 AM, sukumar bhashyam 

 bhashyam.suku...@gmail.com wrote:
  AddAccountExplicitly() would need Authenticator of same type.

  I created an Authenticator and called AddAccountExplicitly() for the same
  type which created an account ( Could verify it from
  AccountManager.getAccounts())

  One strange thing I observer is none of the  implementation class functions
  of AbstractAccountAuthenticator is being called. I followed the exact steps
  in documentation. Not even onCreate or onBind function is called. Anyone
  seen this problem?. Is your AbstractAccountAuthenticator implemetation class
  being invoked?.
  Thanks.

  On Thu, Nov 19, 2009 at 8:26 PM, Jerry Brady jerry.br...@gmail.comwrote:

  Dan,

  Thanks for all of this.  I just returned to the office and will be
  taking a look to see how much further I can get and I will certainly
  be interested in helping with your accounts project.

  I got as far as getting my account to show up in the list of accounts
  along with Google, Facebook and Exchange, but my service never gets
  called.  My addAccount() method doesn't return an intent, but rather
  KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE in it's bundle to let the
  account request succeed.

  My goal is to create an account that will only be used by my
  application and does not need to have any features to enable external
  authentication or account configuration.

  I've also tried AddAccountExplicitly() but I can't seem to get around
  its UID restrictions.  The calling activity and the authenticator
  service all belong to the same application so I'm not sure why the
  system still throws an error about the UID not being correct.

  Cheers,
  Jerry

  On Nov 13, 11:54 pm, Dan Dumont ddum...@gmail.com wrote:
   For anyone still interested.    I've made a bit of progress.   The
  google
   project below now creates and lists accounts of the type for the
  project!

   On Fri, Nov 13, 2009 at 9:39 PM, Dan Dumont ddum...@gmail.com wrote:
To facilitate the discussion around this topic, I've started up a
  project
over here:
   http://code.google.com/p/androidaccounts/

http://code.google.com/p/androidaccounts/If anyone is interested in
pitching in and writing some examples, let me know so I can add you.
The current state of the project is as far as I've gotten to
  understanding
what is available so far... and I'm stumped as to why new accounts
  don't
seem to persist after their creation ( as far as the AccountsTester
  app is
concerned ).

On Fri, Nov 13, 2009 at 7:40 PM, Dan Dumont ddum...@gmail.com
  wrote:

I've gotten a bit further than you.

The account manager seems to want to store AccountName+Type pairs,
  and
have an AccountAuthenticator handle the storage and dirty bits of the
  actual
authentication and credential storage.

You will need to create an AccountAuthenticator from the
AbstractAccountAuthenticator class.
You will also need to define a Service in your app.   See

 http://developer.android.com/reference/android/accounts/AbstractAccou...
This service must be set up in the Manifest like so:  (ripped from
  link
above)

 intent-filter
     action android:name=android.accounts.AccountAuthenticator /
   /intent-filter
   meta-data android:name=android.accounts.AccountAuthenticator
             android:resource=@xml/authenticator /

You can take a look at the link for what the resource must be...

After you end up hooking all that crap up, you can do this in your
service:
 public IBinder onBind(Intent intent) {
 IBinder ret = null;
 if

  (intent.getAction().equals(android.accounts.AccountManager.ACTION_AUTHENTIC
  ATOR_INTENT))
 ret = 

[android-developers] Re: Is there any way to display 8000 * 8000 jpeg file without OutOfMemoryException

2009-11-21 Thread Streets Of Boston
Like some others suggested pre-process the large file, break it up in
smaller chunks, each chunk being a proper JPEG
Then put all the chunks in a RandomAccessFile or a database. Be sure
to be able to find the chunks by a row and column index.

Then put this RandomAccessFile or database on your phone and write
code to fetch each sub-jpg based on a row and colum index.


On Nov 20, 3:38 pm, PJ pjbar...@gmail.com wrote:
 We might be able to come up with more creative solutions if you give
 us more information about where the 8000x8000 jpeg file is coming
 from, and whether you just want to display it in a WxH view or to do
 something else with it.

 Also, since you expressed interest in Google's server-side solution
 for Google Maps, are you considering developing a server-side
 component to your app as well?  If so, you could host this capability
 (convert 8000x8000 image to smaller image) on a server somewhere.

 If you try to do all processing on the device itself, it's probably
 going to be very slow.

 What does your app do?  Now you've got me all curious.  :D

 -- PJ

 On Nov 19, 7:06 pm, James Wang jameswangc...@gmail.com wrote:



Step #2: Generate 10,000 tiles that are 80*80 instead (100 * 100 tiles).

Step #3: Render tiles on-screen by drawing them on the Canvas, and
support swipe gestures to move through the image by replacing tiles,
much like Google Maps works.

  Hi Mark, AFAIK, the decoder of jpeg on android must support to read
  random part of jpeg file if I want do step#2 as you said.
  I checked out SDK reference and found out the default decoder of jpeg
  seems not support it. Am I right?
  Do I have to make another jpeg decoder?

  BTW, I think google map does the same thing on server side, not on
  mobile phone, does not it?- Hide quoted text -

 - Show quoted text -

-- 
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: methods not working (force closing), is there something wrong?

2009-11-21 Thread Breezy
Okay, I see. So what would be a solution to an error like that?  I'm a
PHP programmer in which I can write some sloppy code...  I'm sort of
lost on that.



On Nov 21, 6:24 am, Mark Murphy mmur...@commonsware.com wrote:
 Breezy wrote:
  Hmmm, I used that but I can't decipher what it's saying

 snip

  11-21 06:04:48.487: ERROR/AndroidRuntime(776): Caused by:
  java.lang.NullPointerException
  11-21 06:04:48.487: ERROR/AndroidRuntime(776):     at
  com.example.comparibook.CompariBook.onCreate(CompariBook.java:65)

 When examining a stack trace, look for the Caused by: portion, as most
 of the time that will indicate where your error is. In this case, you
 have a NullPointerException on line 65 of CompariBook.java.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 _The Busy Coder's Guide to Android Development_ Version 2.8
 Available!

-- 
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] My app runs fine on ADP1, but crashes the Motorola Droid?

2009-11-21 Thread blindfold
Today I received user feedback from a Droid user that my app The
vOICe for Android (one can find it on the Market by searching for
seeingwithsound) causes the Motorola Droid to shut down (really?)
within half a minute.

I tested my app on ADP1 (Android 1.6), where I've just had it running
for over 15 minutes without any issues, and I have also tested it to
run OK on the emulator (set to Android 1.6 and 2.0), at various screen
sizes from QVGA to WVGA. In other words, I cannot reproduce the
problem. Buying all Android phones with all firmware versions and all
Android OS versions (1.6 and 2.0 for now) is not practical. How does
one deal with such situations? It looks like the Android OS is already
starting to fragment across devices. Any help is appreciated,
including crash data from Droid users.

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: Reusing intents with notification/pending intents

2009-11-21 Thread jotobjects
Can you show us the code you used to create the PendingIntent?

On Nov 21, 7:04 am, jsdf jasons...@gmail.com wrote:
 Does anyone have suggestions on this?
 I appreciate the help!

 On Nov 19, 5:38 pm, jsdf jasons...@gmail.com wrote:

  Hi all,
  A quick question (for those who know the answer, anyway):

  In my app, user starts a service and shows a notification from
  activity A.
  The notification creates a PendingIntent that will invoke activity A
  should the user tap on it.
  The problem with this behavior is that, if the user starts the service
  (which shows the notification), drags down the notification bar, then
  taps the notification, I now have two activity A's in the display
  stack, one on top of the other and both exactly the same.
  How can I re-use the original activity A in this situation so the user
  isn't duplicating activities?

  Thanks,
  jsdf

-- 
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


Re: [android-developers] Re: Saving service killing without startForeground

2009-11-21 Thread Dianne Hackborn
2009/11/20 Cédric Berger cedric.berge...@gmail.com

 But if your service process is killed due to low memory, won't the
 system try to restart it later ? (though of course if there are still
 too many services running there is still a problem)


Yes if the service was started with startService(), the system will continue
trying to restart it (using a back-off timeout to avoid thrashing too much)
until there is enough memory to run it again.  If there are just too many
services trying to run at the same time, you will end up cycling through the
services running each of them some of the time.

The only reason the service in this case would just be stopped and not
started again is if it has crashed a couple times, or has ANRed in the
background (in which case a dialog is not shown, but the system detects this
and kills the process).

Also note -- if you are using setForeground() it is EXTREMELY unlikely the
system is killing your service due to low memory, since this API basically
turns that off.  (Though note in 2.0 this API no longer does anything, and
you need to use the new APIs that tie this state to a notification; for
older releases, you are supposed to do this so the user can know what is
going on and stop the service, and this is now enforced in 2.0.)

If you find your service going away while it is in the foreground, you
should be looking for the service crashing or ANRing rather than thinking
the system is killing it for memory.

And I'll say again please please please avoid just running services
continually in the background.  We don't have enough memory in a lot of the
devices for more than a few applications to do this.  If you really need to,
please make it clear in your app that this is happening, with a UI for the
user to stop the service if they don't need it.  And you will just have to
deal with the fact that there will be situations where the system can't keep
your service running -- for example, if the user goes to a fairly
heavy-weight web site, this itself could consume enough memory that the
system needs to kill most if not all of the background services for that
time.

Finally, you can find some information about what the system is doing in the
log with adb logcat.  There is often some more useful details in the
low-level event log that you can see with adb logcat -b events.  If you
are going to ask for help with these kinds of questions, it would be
extremely useful to post the log output that is seen when the service
process goes away.

Also you can use adb shell dumpsys activity.services to see the state of
all services.  If your service has been started, even if its process is
killed and it is not running, you will see it in here, with a number of
useful things about its current state.

-- 
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

Re: [android-developers] Windows manager in Android frame work

2009-11-21 Thread Dianne Hackborn
Hi please post questions about the platform implementation in
android-porting, thanks.

On Fri, Nov 20, 2009 at 10:16 PM, android-newbie k...@itsaver.com wrote:

 I have read and learned that Windows manager creates surfaces for the
 application on Android, but not able to understand how this happens.
 Can someone please explain this to me?  Also, how does Windows manager
 start up in any applicatioin, for example like Camera Preview
 Application?

 Thank you very much for your help,
 an

 --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
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: Geo Fix Still Not Working in 1.6

2009-11-21 Thread android_dev
Hi,
i am also facing the same problem with android 1.6, i am sending
coordinate through telnet but LastKnownLocation is returning null, m
using android 1.6 eclipse window vista, am i doing anything wrong in
Java code, can please send me java code. is it require any changes in
menifest except permission. i have tried with all permissions.
Thanks

On Oct 24, 4:16 am, jotobjects jotobje...@gmail.com wrote:
 Cool.  It seems like the best thing is to do both.  Call
 getLastKnownLocation AND register a listener.  LastKnownLocation can
 be null as documented so you have to expect that. And it can be
 completely wrong if the the phone has been moved (you get off an
 airplane and turn on your phone).  But you might not get any value for
 a while from the listener (also as documented) so you have to expect
 that also.  Quote from docs -

 It may take a while to receive the most recent location. If an
 immediate location is required, applications may use the
 getLastKnownLocation(String) method.

 You are right about telnet.  I meant I'm runninggeofixON the
 emulator after invoking telnet and the emulator itself is running
 Linux - so that's wheregeofixruns in telnet (ALWAYS on Linux) even
 if the O/S is windows or whatever.

 On Oct 23, 3:50 pm, Brian Conrad brianjto...@gmail.com wrote:



  I solved the problem and have it working but not the way it originally
  worked.  Originally in one's code you code set up the location manager
  and then call from it getLastKnownLocation and get the coordinates.  
  These were what examples did when I first looked at GPS code.  That was
  what got broken and was apparently unintentional.  Instead I set up a
  location listener and nowgeofixworks and probably DDMS though I
  haven't tried that.  My thinking is that most people were writing
  applications where they would want updates while running.  Mine was just
  simple and needed the location at runtime or whenever the user wanted a
  recalculation.   So I'll instead set up the listener though we still
  only care when the application runs or is recalculated.  That  change is
  easy to implement.

  FYI, telnet also runs in the command line on Windows.  It's not unique
  to Linux.

  jotobjects wrote:
   I just used Google Maps to prove thatgeofixworked and resulted in
   the platform correctly knowing the location given bygeofix.  You
   might want to try that too to prove thatgeofixdoes or doesn't work
   in an application other than your own code.  That would be interesting
   confirmation for you and is easy to do.

   When I telnet into the emulator console and rungeofixas shown I am
   using Linux on the emulator of course.

   What problem has Android acknowledged regardinggeofix?  What is the
   bug number?

   On Oct 23, 12:44 pm, Brian Conrad brianjto...@gmail.com wrote:

   Are you running on Windows or Linux?  I'm running Ubuntu 8.04 and
   Eclipse.  Android acknowledgedgeofixwas broken in the 1.5 SDK.   I am
   usinggeofixto get the longitude and latitude only and not with Google
   Maps.  Everything is set in the manifest correctly too.   I have a 20%
   installed base which is about 600 users so I doubt if they would keep it
   around if it wasn't working.

   I don't know anything about a rounding bug as I round anyway for use
   down to degrees and minutes.  One would think that DDMS would work when
   I have the app recalculate after sending coordinates manually.

   jotobjects wrote:

  geofixworks for me with both DDMS and the emulator console.  Using
   console this works -

   telenet localhost 5554
  geofix-117.24 32.883

   This locates you in the University of California San Diego campus.  I
   tried this with DDMS manualgeofixand it works there also.  My test
   is using Google Maps My Location menu selection.  What is not
   working withgeofixfor you?

   Incidently I am now noticing that DDMS gives me the correct location.
   But thegeofixcommand in the console exhibits the rounding problem
   Auguste Lunang pointed to that is a couple of hundred feet off (which
   is a problem for testing that depends on more accuracy).  Do you know
   if there is a bug filed for the rounding problem?

   On Oct 22, 5:06 pm, Brian Conrad brianjto...@gmail.com wrote:

   There is a bug filed forgeofix(not by me but by people who found it
   earlier).   I haven't filed one for DDMS until I'm sure I grok how it
   works as information still is very sketchy about this stuff and docs
   rather terse.

   My app calls getLastKnownLocation when it runs once.  It will call it
   again if the user selects Recalc.  Now under 1.1 when first run the
   emulator it would return what was set withgeofixor a default which I
   believe was Google's coordinates.   The DDMS method seems is something
   one would use to emulate location updates.  With 1.5 and 1.6  when my
   app runs it gets a null back from getLastKnownLocation on the
   emulator.   So then I have DDMS send the coordinates to the emulator 
   (as
   instructed via 

[android-developers] Re: Geo Fix Still Not Working in 1.6

2009-11-21 Thread jotobjects
Null is a valid return value from this method.  The documentation says
If the provider is currently disabled, null is returned. Possibly
there other situations when there is no known last location.

http://developer.android.com/reference/android/location/LocationManager.html#getLastKnownLocation%28java.lang.String%29

Also you can use Google Maps app on this device/emulator with
myLocation to see if Google Maps has the same problem or not.

On Nov 21, 11:58 am, android_dev pankaj.i...@gmail.com wrote:
 Hi,
 i am also facing the same problem with android 1.6, i am sending
 coordinate through telnet but LastKnownLocation is returning null, m
 using android 1.6 eclipse window vista, am i doing anything wrong in
 Java code, can please send me java code. is it require any changes in
 menifest except permission. i have tried with all permissions.
 Thanks

 On Oct 24, 4:16 am, jotobjects jotobje...@gmail.com wrote:

  Cool.  It seems like the best thing is to do both.  Call
  getLastKnownLocation AND register a listener.  LastKnownLocation can
  be null as documented so you have to expect that. And it can be
  completely wrong if the the phone has been moved (you get off an
  airplane and turn on your phone).  But you might not get any value for
  a while from the listener (also as documented) so you have to expect
  that also.  Quote from docs -

  It may take a while to receive the most recent location. If an
  immediate location is required, applications may use the
  getLastKnownLocation(String) method.

  You are right about telnet.  I meant I'm runninggeofixON the
  emulator after invoking telnet and the emulator itself is running
  Linux - so that's wheregeofixruns in telnet (ALWAYS on Linux) even
  if the O/S is windows or whatever.

  On Oct 23, 3:50 pm, Brian Conrad brianjto...@gmail.com wrote:

   I solved the problem and have it working but not the way it originally
   worked.  Originally in one's code you code set up the location manager
   and then call from it getLastKnownLocation and get the coordinates.  
   These were what examples did when I first looked at GPS code.  That was
   what got broken and was apparently unintentional.  Instead I set up a
   location listener and nowgeofixworks and probably DDMS though I
   haven't tried that.  My thinking is that most people were writing
   applications where they would want updates while running.  Mine was just
   simple and needed the location at runtime or whenever the user wanted a
   recalculation.   So I'll instead set up the listener though we still
   only care when the application runs or is recalculated.  That  change is
   easy to implement.

   FYI, telnet also runs in the command line on Windows.  It's not unique
   to Linux.

   jotobjects wrote:
I just used Google Maps to prove thatgeofixworked and resulted in
the platform correctly knowing the location given bygeofix.  You
might want to try that too to prove thatgeofixdoes or doesn't work
in an application other than your own code.  That would be interesting
confirmation for you and is easy to do.

When I telnet into the emulator console and rungeofixas shown I am
using Linux on the emulator of course.

What problem has Android acknowledged regardinggeofix?  What is the
bug number?

On Oct 23, 12:44 pm, Brian Conrad brianjto...@gmail.com wrote:

Are you running on Windows or Linux?  I'm running Ubuntu 8.04 and
Eclipse.  Android acknowledgedgeofixwas broken in the 1.5 SDK.   I am
usinggeofixto get the longitude and latitude only and not with Google
Maps.  Everything is set in the manifest correctly too.   I have a 20%
installed base which is about 600 users so I doubt if they would keep 
it
around if it wasn't working.

I don't know anything about a rounding bug as I round anyway for use
down to degrees and minutes.  One would think that DDMS would work when
I have the app recalculate after sending coordinates manually.

jotobjects wrote:

   geofixworks for me with both DDMS and the emulator console.  Using
console this works -

telenet localhost 5554
   geofix-117.24 32.883

This locates you in the University of California San Diego campus.  I
tried this with DDMS manualgeofixand it works there also.  My test
is using Google Maps My Location menu selection.  What is not
working withgeofixfor you?

Incidently I am now noticing that DDMS gives me the correct location.
But thegeofixcommand in the console exhibits the rounding problem
Auguste Lunang pointed to that is a couple of hundred feet off (which
is a problem for testing that depends on more accuracy).  Do you know
if there is a bug filed for the rounding problem?

On Oct 22, 5:06 pm, Brian Conrad brianjto...@gmail.com wrote:

There is a bug filed forgeofix(not by me but by people who found it
earlier).   I haven't filed one for DDMS until I'm sure I grok how it
works as information still 

[android-developers] Re: Geo Fix Still Not Working in 1.6

2009-11-21 Thread android_dev
Thanks,
its working now, i was making mistake in Java side. its working
through telnet and DDMS both in windows.
thanks a lot

On Nov 22, 1:25 am, jotobjects jotobje...@gmail.com wrote:
 Null is a valid return value from this method.  The documentation says
 If the provider is currently disabled, null is returned. Possibly
 there other situations when there is no known last location.

 http://developer.android.com/reference/android/location/LocationManag...

 Also you can use Google Maps app on this device/emulator with
 myLocation to see if Google Maps has the same problem or not.

 On Nov 21, 11:58 am, android_dev pankaj.i...@gmail.com wrote:



  Hi,
  i am also facing the same problem with android 1.6, i am sending
  coordinate through telnet but LastKnownLocation is returning null, m
  using android 1.6 eclipse window vista, am i doing anything wrong in
  Java code, can please send me java code. is it require any changes in
  menifest except permission. i have tried with all permissions.
  Thanks

  On Oct 24, 4:16 am, jotobjects jotobje...@gmail.com wrote:

   Cool.  It seems like the best thing is to do both.  Call
   getLastKnownLocation AND register a listener.  LastKnownLocation can
   be null as documented so you have to expect that. And it can be
   completely wrong if the the phone has been moved (you get off an
   airplane and turn on your phone).  But you might not get any value for
   a while from the listener (also as documented) so you have to expect
   that also.  Quote from docs -

   It may take a while to receive the most recent location. If an
   immediate location is required, applications may use the
   getLastKnownLocation(String) method.

   You are right about telnet.  I meant I'm runninggeofixON the
   emulator after invoking telnet and the emulator itself is running
   Linux - so that's wheregeofixruns in telnet (ALWAYS on Linux) even
   if the O/S is windows or whatever.

   On Oct 23, 3:50 pm, Brian Conrad brianjto...@gmail.com wrote:

I solved the problem and have it working but not the way it originally
worked.  Originally in one's code you code set up the location manager
and then call from it getLastKnownLocation and get the coordinates.  
These were what examples did when I first looked at GPS code.  That was
what got broken and was apparently unintentional.  Instead I set up a
location listener and nowgeofixworks and probably DDMS though I
haven't tried that.  My thinking is that most people were writing
applications where they would want updates while running.  Mine was just
simple and needed the location at runtime or whenever the user wanted a
recalculation.   So I'll instead set up the listener though we still
only care when the application runs or is recalculated.  That  change is
easy to implement.

FYI, telnet also runs in the command line on Windows.  It's not unique
to Linux.

jotobjects wrote:
 I just used Google Maps to prove thatgeofixworked and resulted in
 the platform correctly knowing the location given bygeofix.  You
 might want to try that too to prove thatgeofixdoes or doesn't work
 in an application other than your own code.  That would be interesting
 confirmation for you and is easy to do.

 When I telnet into the emulator console and rungeofixas shown I am
 using Linux on the emulator of course.

 What problem has Android acknowledged regardinggeofix?  What is the
 bug number?

 On Oct 23, 12:44 pm, Brian Conrad brianjto...@gmail.com wrote:

 Are you running on Windows or Linux?  I'm running Ubuntu 8.04 and
 Eclipse.  Android acknowledgedgeofixwas broken in the 1.5 SDK.   I am
 usinggeofixto get the longitude and latitude only and not with Google
 Maps.  Everything is set in the manifest correctly too.   I have a 
 20%
 installed base which is about 600 users so I doubt if they would 
 keep it
 around if it wasn't working.

 I don't know anything about a rounding bug as I round anyway for use
 down to degrees and minutes.  One would think that DDMS would work 
 when
 I have the app recalculate after sending coordinates manually.

 jotobjects wrote:

geofixworks for me with both DDMS and the emulator console.  Using
 console this works -

 telenet localhost 5554
geofix-117.24 32.883

 This locates you in the University of California San Diego campus.  
 I
 tried this with DDMS manualgeofixand it works there also.  My test
 is using Google Maps My Location menu selection.  What is not
 working withgeofixfor you?

 Incidently I am now noticing that DDMS gives me the correct 
 location.
 But thegeofixcommand in the console exhibits the rounding problem
 Auguste Lunang pointed to that is a couple of hundred feet off 
 (which
 is a problem for testing that depends on more accuracy).  Do you 
 know
 if there is a bug filed for the 

Re: [android-developers] Abridged summary of android-developers@googlegroups.com - 27 Messages in 11 Topics

2009-11-21 Thread Marc Holder


android-developers@googlegroups.com wrote:

=
Today's Topic Summary
=

Group: android-developers@googlegroups.com
Url: http://groups.google.com/group/android-developers/topics

  - surfaceCreated() and CreateSurface() in camera preview application [1 
 Update]
http://groups.google.com/group/android-developers/t/ba1bb7ebc6c5af6
  - How to Load PDF to Browser? [1 Update]
http://groups.google.com/group/android-developers/t/a0361621bfaf12c6
  - HTC Hero, missing applications from Market after firmware update [10 
 Updates]
http://groups.google.com/group/android-developers/t/fd299f64638391e1
  - android.R.drawable.ic_menu_home - can not use [4 Updates]
http://groups.google.com/group/android-developers/t/dabbe62aa1b54c13
  - methods not working (force closing), is there something wrong? [2 Updates]
http://groups.google.com/group/android-developers/t/f9f55c4036afeb32
  - need some help with GUI [1 Update]
http://groups.google.com/group/android-developers/t/4240b1617998e22d
  - Read status bar notifications programmatically? [3 Updates]
http://groups.google.com/group/android-developers/t/4b25cd207b611645
  - Android in China - What is going on? [1 Update]
http://groups.google.com/group/android-developers/t/853a2e38009262fe
  - mapview service interruption or my imagination? [1 Update]
http://groups.google.com/group/android-developers/t/c388d2eebe1e039d
  - map view not responding today? [1 Update]
http://groups.google.com/group/android-developers/t/471563bc4d0e214
  - ListActivity addHeader??? [2 Updates]
http://groups.google.com/group/android-developers/t/75fe0650a267e6e1


=
Topic: surfaceCreated() and CreateSurface() in camera preview application
Url: http://groups.google.com/group/android-developers/t/ba1bb7ebc6c5af6
=

-- 1 of 1 --
From: android-newbie k...@itsaver.com
Date: Nov 20 09:56PM -0800
Url: http://groups.google.com/group/android-developers/msg/2a3ecff85fbe2f15

I have some questions regarding the code below for camera preview
applicaiton.  I am hoping someone can help me out.  Thanks in advance.



=
Topic: How to Load PDF to Browser?
Url: http://groups.google.com/group/android-developers/t/a0361621bfaf12c6
=

-- 1 of 1 --
From: Moon Technolabs moonsoftwaret...@gmail.com
Date: Nov 21 10:37AM +0530
Url: http://groups.google.com/group/android-developers/msg/cd97ea2585b53a2f

Before installing the project http://code.google.com/p/apdfviewer/
I was unable to open PDF url like www.janeg.ca/JQREF.pdf n it was giving me
File Type not supported error...



=
Topic: HTC Hero, missing applications from Market after firmware update
Url: http://groups.google.com/group/android-developers/t/fd299f64638391e1
=

-- 1 of 10 --
From: eric e...@snoggdoggler.com
Date: Nov 20 05:04PM -0800
Url: http://groups.google.com/group/android-developers/msg/4feb499ea62c22d0



-- 2 of 10 --
From: SoftwareForMe.com SoftwareForMe.com softwareforme@gmail.com
Date: Nov 20 05:40PM -0800
Url: http://groups.google.com/group/android-developers/msg/b330d154ffa1cfed

Great information.

I believe the Eris's problem is in fact the copy protection. I also know the
Hero had this problem when launched in the UK.


-- 3 of 10 --
From: Greg Donald gdon...@gmail.com
Date: Nov 20 07:46PM -0600
Url: http://groups.google.com/group/android-developers/msg/85cf590bab7965cd



-- 4 of 10 --
From: Justin Giles jtgi...@gmail.com
Date: Nov 20 08:00PM -0600
Url: http://groups.google.com/group/android-developers/msg/d56ff4953eaa2a1a

That is an unacceptable solution.  I don't understand why the Market would
need to act like that.  If the phone is on a network, it should be able to


-- 5 of 10 --
From: eric e...@snoggdoggler.com
Date: Nov 20 06:10PM -0800
Url: http://groups.google.com/group/android-developers/msg/d92e07e88d8efd3

I don't know if this will make you feel better or worse but my app is
copy-protected and is *easily* findable on filesharing sites.

I'm gonna flip off the copy-protection (after some testing).


-- 6 of 10 --
From: Greg Donald gdon...@gmail.com
Date: Nov 20 08:35PM -0600
Url: http://groups.google.com/group/android-developers/msg/b62353fd331acae7



-- 7 of 10 --
From: eric e...@snoggdoggler.com
Date: Nov 20 06:46PM -0800
Url: 

[android-developers] dumpsys arguments

2009-11-21 Thread jotobjects
Does anyone know where the various arguments to shell dumpsys are
listed?

Four variations I have found are:

dumpsys
dumpsys activity
dumpsys activity service
dumpsys activity.services

The last two are similar but not identical.  I suppose there are other
valid arguments

-- 
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


Re: [android-developers] Re: namespace in styles.xml

2009-11-21 Thread Bahadır Yağan
Thanks for the responses.
So basically
name=my_attr
and
name=com.example.android:my_attr
works. But not the xmlns approach used in  widget styling.

And thank you Edward for bringing this up. I almost forgot I had this issue
standing.


On Mon, Nov 16, 2009 at 7:57 PM, Dianne Hackborn hack...@android.comwrote:

 You write them the same as resource references -- that is
 package_name:attribute_name


 On Mon, Nov 16, 2009 at 9:33 AM, Edward Falk ed.f...@gmail.com wrote:

 I found one approach that works:  drop the qualifier trskb

   item name=my_attrsome_value/item

 It solved the problem for me.  I don't know how the system would
 handle a namespace collision though.

 --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




 --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Bahadır Yağan

-- 
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: 2.0 AccountManager - Implementing a new account type with Google, Facebook and Exchange

2009-11-21 Thread NitroDesk
Any of you folks tried this on a Droid?
Simply installing the project that contains an Authenticator in the
manfest and the other related items seems to cause the Add Account
option in the account list on te droid to simply reoot the phone with
an exception.
Anyone else seen this or find a way to avoid this ?
-g

On Nov 21, 9:04 am, Jerry Brady jerry.br...@gmail.com wrote:
 Dan,

 Now I see what you are doing in your code and found the reference to
 AddAccountExplicitly().   I want to skip returning an intent to fire
 the an AccountAuthenticatorActivity and instead to return
 KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE directly from my
 AbstractAccountAuthenticator's addAccount method whereas your code
 returns an intent that fires your authentication activity.

 The main issue for me so far is that I don't see that my
 AbstractAccountAuthenticator is ever being instantiated.

 Cheers,
 Jerry

 On Nov 20, 7:53 am, Dan Dumont ddum...@gmail.com wrote:



  Yes.   But I make the AddAccountExplicitly call in my Authenticator.    You
  use the AccountManager to create accounts.
  If you call AddAccountExplicitly from a non-authenticator class, I guess it
  will work...  But I think the security behind it will mean that only the
  class that created the account will be able to ever modify it or extract the
  password.

  This is why they have a framework for you to get an authtoken returned via
  the authenticator... the logic for authenticating should be buried within
  there, because it will be the only class allowed to peak at the password and
  send it wherever you are authenticating.

  On Fri, Nov 20, 2009 at 2:16 AM, sukumar bhashyam 

  bhashyam.suku...@gmail.com wrote:
   AddAccountExplicitly() would need Authenticator of same type.

   I created an Authenticator and called AddAccountExplicitly() for the same
   type which created an account ( Could verify it from
   AccountManager.getAccounts())

   One strange thing I observer is none of the  implementation class 
   functions
   of AbstractAccountAuthenticator is being called. I followed the exact 
   steps
   in documentation. Not even onCreate or onBind function is called. Anyone
   seen this problem?. Is your AbstractAccountAuthenticator implemetation 
   class
   being invoked?.
   Thanks.

   On Thu, Nov 19, 2009 at 8:26 PM, Jerry Brady jerry.br...@gmail.comwrote:

   Dan,

   Thanks for all of this.  I just returned to the office and will be
   taking a look to see how much further I can get and I will certainly
   be interested in helping with your accounts project.

   I got as far as getting my account to show up in the list of accounts
   along with Google, Facebook and Exchange, but my service never gets
   called.  My addAccount() method doesn't return an intent, but rather
   KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE in it's bundle to let the
   account request succeed.

   My goal is to create an account that will only be used by my
   application and does not need to have any features to enable external
   authentication or account configuration.

   I've also tried AddAccountExplicitly() but I can't seem to get around
   its UID restrictions.  The calling activity and the authenticator
   service all belong to the same application so I'm not sure why the
   system still throws an error about the UID not being correct.

   Cheers,
   Jerry

   On Nov 13, 11:54 pm, Dan Dumont ddum...@gmail.com wrote:
For anyone still interested.    I've made a bit of progress.   The
   google
project below now creates and lists accounts of the type for the
   project!

On Fri, Nov 13, 2009 at 9:39 PM, Dan Dumont ddum...@gmail.com wrote:
 To facilitate the discussion around this topic, I've started up a
   project
 over here:
http://code.google.com/p/androidaccounts/

 http://code.google.com/p/androidaccounts/If anyone is interested in
 pitching in and writing some examples, let me know so I can add you.
 The current state of the project is as far as I've gotten to
   understanding
 what is available so far... and I'm stumped as to why new accounts
   don't
 seem to persist after their creation ( as far as the AccountsTester
   app is
 concerned ).

 On Fri, Nov 13, 2009 at 7:40 PM, Dan Dumont ddum...@gmail.com
   wrote:

 I've gotten a bit further than you.

 The account manager seems to want to store AccountName+Type pairs,
   and
 have anAccountAuthenticatorhandle the storage and dirty bits of the
   actual
 authentication and credential storage.

 You will need to create anAccountAuthenticatorfrom the
 AbstractAccountAuthenticator class.
 You will also need to define a Service in your app.   See

  http://developer.android.com/reference/android/accounts/AbstractAccou...
 This service must be set up in the Manifest like so:  (ripped from
   link
 above)

  intent-filter
      action android:name=android.accounts.AccountAuthenticator /
    /intent-filter
    

[android-developers] screen compatibility not quite right

2009-11-21 Thread rukiman
Ok I have put this in my manifest

supports-screens android:anyDensity=false
android:largeScreens=false android:normalScreens=true
android:smallScreens=false android:resizeable=false/supports-
screens

first of all what is the resizeable attribute? It does not seem to be
documented.

This is working almost 90% for my game except when testing in WVGA
screen resolution, all my images are scaled incorrectly, it is longer
vertically than horizontally. I was expecting the screen compatibility
to maintain aspect ratios as that of HVGA.

Also in my layout I have a scrollview and it is designed in such a way
that in HVGA when it is not scrolled down, the items are hidden away,
however now in WVGA those things are shown. If the aspect ratio of
HVGA is maintained I won't have this issue.

How can I make sure the aspect ratio is maintained?

Also in my layout I am positioning some items using pixel positions.
Should I convert these to dpi? How do I calculate what dpi they should
be?

-- 
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


Re: [android-developers] screen compatibility not quite right

2009-11-21 Thread Mark Murphy
rukiman wrote:
 This is working almost 90% for my game except when testing in WVGA
 screen resolution, all my images are scaled incorrectly, it is longer
 vertically than horizontally. I was expecting the screen compatibility
 to maintain aspect ratios as that of HVGA.

No.

DROID has been optimized to display wide-screen multimedia (movie)
content at its native aspect ratio of 16/9. This is different from the
HVGA aspect ratio of 3/2, which is the traditional computer screen
format. What this means is that when content is scaled up to full
screen, the horizontal (X*1.5) and vertical (Y*1.77) scaling factors
are different. As a result, when displaying the same bitmap as a full
screen background, round circles can appear as ovals, and squares are
elongated to rectangles.

http://developer.motorola.com/docstools/library/Support_for_Multiple_Screen_Resolutions/

I have no reason to believe this is DROID-specific, but rather is how
Android scales things in WVGA800/WVGA854, when you do not supply your
own pre-scaled resources.

 Also in my layout I have a scrollview and it is designed in such a way
 that in HVGA when it is not scrolled down, the items are hidden away,
 however now in WVGA those things are shown. If the aspect ratio of
 HVGA is maintained I won't have this issue.
 
 How can I make sure the aspect ratio is maintained?

You cannot control the aspect ratio, as that is dictated by the physical
parameters of the screen. AFAIK, there is no Android equivalent of
letterbox that would put black bars on either side of your app and
give you a smaller virtual screen with 3/2 aspect ratio.

 Also in my layout I am positioning some items using pixel positions.
 Should I convert these to dpi?

If you mean dip (density-independent pixels), perhaps. It depends on
what the pixels represent. There is no hard-and-fast rule.

 How do I calculate what dpi they should be?

1px = 1dip at 160dpi (i.e., traditional normal screen density).

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_Android Programming Tutorials_ Version 1.0 Available!

-- 
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] Using FLAG_ACTIVITY_CLEAR_TOP, but don't restart target activity?

2009-11-21 Thread Mark Wyszomierski
Hi,

I'd like to use FLAG_ACTIVITY_CLEAR_TOP to launch an activity in my
app. It has one feature I don't want though - it restarts the target
intent, instead of just resuming it. Example history stack, with
activity D making the call to B with that flag:

 A  B  C  D

 new stack

 A  B

but 'B' gets relaunched, its onCreate() method is called. Since B is
already in the history stack, is there a way I can use this flag, but
have it *not* recreate B, just onResume() it again? The reordering
flags are kind of what I need too, but they won't pop C and D, just
reshuffle the stack so B comes to the top, but I want C and D to go
away,

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


Re: [android-developers] Using FLAG_ACTIVITY_CLEAR_TOP, but don't restart target activity?

2009-11-21 Thread Mark Murphy
Mark Wyszomierski wrote:
 Hi,
 
 I'd like to use FLAG_ACTIVITY_CLEAR_TOP to launch an activity in my
 app. It has one feature I don't want though - it restarts the target
 intent, instead of just resuming it. Example history stack, with
 activity D making the call to B with that flag:
 
  A  B  C  D
 
  new stack
 
  A  B
 
 but 'B' gets relaunched, its onCreate() method is called. Since B is
 already in the history stack, is there a way I can use this flag, but
 have it *not* recreate B, just onResume() it again? The reordering
 flags are kind of what I need too, but they won't pop C and D, just
 reshuffle the stack so B comes to the top, but I want C and D to go
 away,

Per the documentation:

The currently running instance of activity B in the above example will
either receive the new intent you are starting here in its onNewIntent()
method, or be itself finished and restarted with the new intent. If it
has declared its launch mode to be multiple (the default) and you have
not set FLAG_ACTIVITY_SINGLE_TOP in the same intent, then it will be
finished and re-created; for all other launch modes or if
FLAG_ACTIVITY_SINGLE_TOP is set then this Intent will be delivered to
the current instance's onNewIntent(). 

http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_CLEAR_TOP

So, try OR'ing FLAG_ACTIVITY_SINGLE_TOP in your Intent that you're using
with FLAG_ACTIVITY_CLEAR_TOP, and see if that does the trick.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Consulting/App Development: http://commonsware.com/consulting

-- 
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: Using FLAG_ACTIVITY_CLEAR_TOP, but don't restart target activity?

2009-11-21 Thread Mark Wyszomierski
Hi Mark,

Here's the call:

   intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP |
Intent.FLAG_ACTIVITY_CLEAR_TOP);

same behavior though, 'B' gets its onCreate() method called. I added
an override for onNewIntent() just to see if it would be called, but
it isn't either, I must be missing something simple!

Thanks


On Nov 21, 8:07 pm, Mark Murphy mmur...@commonsware.com wrote:
 Mark Wyszomierski wrote:
  Hi,

  I'd like to use FLAG_ACTIVITY_CLEAR_TOP to launch an activity in my
  app. It has one feature I don't want though - it restarts the target
  intent, instead of just resuming it. Example history stack, with
  activity D making the call to B with that flag:

   A  B  C  D

   new stack

   A  B

  but 'B' gets relaunched, its onCreate() method is called. Since B is
  already in the history stack, is there a way I can use this flag, but
  have it *not* recreate B, just onResume() it again? The reordering
  flags are kind of what I need too, but they won't pop C and D, just
  reshuffle the stack so B comes to the top, but I want C and D to go
  away,

 Per the documentation:

 The currently running instance of activity B in the above example will
 either receive the new intent you are starting here in its onNewIntent()
 method, or be itself finished and restarted with the new intent. If it
 has declared its launch mode to be multiple (the default) and you have
 not set FLAG_ACTIVITY_SINGLE_TOP in the same intent, then it will be
 finished and re-created; for all other launch modes or if
 FLAG_ACTIVITY_SINGLE_TOP is set then this Intent will be delivered to
 the current instance's onNewIntent(). 

 http://developer.android.com/reference/android/content/Intent.html#FL...

 So, try OR'ing FLAG_ACTIVITY_SINGLE_TOP in your Intent that you're using
 with FLAG_ACTIVITY_CLEAR_TOP, and see if that does the trick.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 Android Consulting/App Development:http://commonsware.com/consulting

-- 
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: screen compatibility not quite right

2009-11-21 Thread rukiman
I thought I'd create my own specialized LinearLayout so that I can
calculate the aspect ratio and center vertically. My game is only
designed to be played in portrait mode. However this code doesn't seem
to work. Spot what I am doing wrong?

import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.LinearLayout;

public class SpecialLinearLayout extends LinearLayout {

private final Context context;

public SpecialLinearLayout(Context context, AttributeSet attrs) {
super(context, attrs);
this.context = context;
}

protected void onLayout(boolean changed, int l, int t, int r, int
b) {
int width = r - l;
int height = b - t;
float aspect = 480.0f / 320.0f;
int newheight = (int) Math.floor((float) width * (float)
aspect);
if(newheight != height) {
// create top margins to center vertically
ViewGroup.MarginLayoutParams margin = new
ViewGroup.MarginLayoutParams(this.getLayoutParams());
margin.setMargins(0, 40, 0, 50);
this.setLayoutParams(new LinearLayout.LayoutParams
(margin));
}
}
}


On Nov 22, 11:26 am, Mark Murphy mmur...@commonsware.com wrote:
 rukiman wrote:
  This is working almost 90% for my game except when testing in WVGA
  screen resolution, all my images are scaled incorrectly, it is longer
  vertically than horizontally. I was expecting the screen compatibility
  to maintain aspect ratios as that of HVGA.

 No.

 DROID has been optimized to display wide-screen multimedia (movie)
 content at its native aspect ratio of 16/9. This is different from the
 HVGA aspect ratio of 3/2, which is the traditional computer screen
 format. What this means is that when content is scaled up to full
 screen, the horizontal (X*1.5) and vertical (Y*1.77) scaling factors
 are different. As a result, when displaying the same bitmap as a full
 screen background, round circles can appear as ovals, and squares are
 elongated to rectangles.

 http://developer.motorola.com/docstools/library/Support_for_Multiple_...

 I have no reason to believe this is DROID-specific, but rather is how
 Android scales things in WVGA800/WVGA854, when you do not supply your
 own pre-scaled resources.

  Also in my layout I have a scrollview and it is designed in such a way
  that in HVGA when it is not scrolled down, the items are hidden away,
  however now in WVGA those things are shown. If the aspect ratio of
  HVGA is maintained I won't have this issue.

  How can I make sure the aspect ratio is maintained?

 You cannot control the aspect ratio, as that is dictated by the physical
 parameters of the screen. AFAIK, there is no Android equivalent of
 letterbox that would put black bars on either side of your app and
 give you a smaller virtual screen with 3/2 aspect ratio.

  Also in my layout I am positioning some items using pixel positions.
  Should I convert these to dpi?

 If you mean dip (density-independent pixels), perhaps. It depends on
 what the pixels represent. There is no hard-and-fast rule.

  How do I calculate what dpi they should be?

 1px = 1dip at 160dpi (i.e., traditional normal screen density).

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 _Android Programming Tutorials_ Version 1.0 Available!

-- 
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: screen compatibility not quite right

2009-11-21 Thread rukiman
I just put harcoded fake values for time being, instead of centering.
I was expecting everything embedded with the linearlayout which is my
main layout to be shrunk by the top and bottom margins I specified.

On Nov 22, 1:25 pm, rukiman ruksh...@optushome.com.au wrote:
 I thought I'd create my own specialized LinearLayout so that I can
 calculate the aspect ratio and center vertically. My game is only
 designed to be played in portrait mode. However this code doesn't seem
 to work. Spot what I am doing wrong?

 import android.content.Context;
 import android.util.AttributeSet;
 import android.view.ViewGroup;
 import android.widget.LinearLayout;

 public class SpecialLinearLayout extends LinearLayout {

     private final Context context;

     public SpecialLinearLayout(Context context, AttributeSet attrs) {
         super(context, attrs);
         this.context = context;
     }

     protected void onLayout(boolean changed, int l, int t, int r, int
 b) {
         int width = r - l;
         int height = b - t;
         float aspect = 480.0f / 320.0f;
         int newheight = (int) Math.floor((float) width * (float)
 aspect);
         if(newheight != height) {
             // create top margins to center vertically
             ViewGroup.MarginLayoutParams margin = new
 ViewGroup.MarginLayoutParams(this.getLayoutParams());
             margin.setMargins(0, 40, 0, 50);
             this.setLayoutParams(new LinearLayout.LayoutParams
 (margin));
         }
     }

 }

 On Nov 22, 11:26 am, Mark Murphy mmur...@commonsware.com wrote:

  rukiman wrote:
   This is working almost 90% for my game except when testing in WVGA
   screen resolution, all my images are scaled incorrectly, it is longer
   vertically than horizontally. I was expecting the screen compatibility
   to maintain aspect ratios as that of HVGA.

  No.

  DROID has been optimized to display wide-screen multimedia (movie)
  content at its native aspect ratio of 16/9. This is different from the
  HVGA aspect ratio of 3/2, which is the traditional computer screen
  format. What this means is that when content is scaled up to full
  screen, the horizontal (X*1.5) and vertical (Y*1.77) scaling factors
  are different. As a result, when displaying the same bitmap as a full
  screen background, round circles can appear as ovals, and squares are
  elongated to rectangles.

 http://developer.motorola.com/docstools/library/Support_for_Multiple_...

  I have no reason to believe this is DROID-specific, but rather is how
  Android scales things in WVGA800/WVGA854, when you do not supply your
  own pre-scaled resources.

   Also in my layout I have a scrollview and it is designed in such a way
   that in HVGA when it is not scrolled down, the items are hidden away,
   however now in WVGA those things are shown. If the aspect ratio of
   HVGA is maintained I won't have this issue.

   How can I make sure the aspect ratio is maintained?

  You cannot control the aspect ratio, as that is dictated by the physical
  parameters of the screen. AFAIK, there is no Android equivalent of
  letterbox that would put black bars on either side of your app and
  give you a smaller virtual screen with 3/2 aspect ratio.

   Also in my layout I am positioning some items using pixel positions.
   Should I convert these to dpi?

  If you mean dip (density-independent pixels), perhaps. It depends on
  what the pixels represent. There is no hard-and-fast rule.

   How do I calculate what dpi they should be?

  1px = 1dip at 160dpi (i.e., traditional normal screen density).

  --
  Mark Murphy (a Commons 
  Guy)http://commonsware.com|http://twitter.com/commonsguy

  _Android Programming Tutorials_ Version 1.0 Available!

-- 
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: Using FLAG_ACTIVITY_CLEAR_TOP, but don't restart target activity?

2009-11-21 Thread Mark Wyszomierski
Ok this does work if you add the following to your activity definition
in the manifest file:

   android:launchMode=singleTop

Thanks

On Nov 21, 8:15 pm, Mark Wyszomierski mar...@gmail.com wrote:
 Hi Mark,

 Here's the call:

    intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP |
 Intent.FLAG_ACTIVITY_CLEAR_TOP);

 same behavior though, 'B' gets its onCreate() method called. I added
 an override for onNewIntent() just to see if it would be called, but
 it isn't either, I must be missing something simple!

 Thanks

 On Nov 21, 8:07 pm, Mark Murphy mmur...@commonsware.com wrote:



  Mark Wyszomierski wrote:
   Hi,

   I'd like to use FLAG_ACTIVITY_CLEAR_TOP to launch an activity in my
   app. It has one feature I don't want though - it restarts the target
   intent, instead of just resuming it. Example history stack, with
   activity D making the call to B with that flag:

    A  B  C  D

    new stack

    A  B

   but 'B' gets relaunched, its onCreate() method is called. Since B is
   already in the history stack, is there a way I can use this flag, but
   have it *not* recreate B, just onResume() it again? The reordering
   flags are kind of what I need too, but they won't pop C and D, just
   reshuffle the stack so B comes to the top, but I want C and D to go
   away,

  Per the documentation:

  The currently running instance of activity B in the above example will
  either receive the new intent you are starting here in its onNewIntent()
  method, or be itself finished and restarted with the new intent. If it
  has declared its launch mode to be multiple (the default) and you have
  not set FLAG_ACTIVITY_SINGLE_TOP in the same intent, then it will be
  finished and re-created; for all other launch modes or if
  FLAG_ACTIVITY_SINGLE_TOP is set then this Intent will be delivered to
  the current instance's onNewIntent(). 

 http://developer.android.com/reference/android/content/Intent.html#FL...

  So, try OR'ing FLAG_ACTIVITY_SINGLE_TOP in your Intent that you're using
  with FLAG_ACTIVITY_CLEAR_TOP, and see if that does the trick.

  --
  Mark Murphy (a Commons 
  Guy)http://commonsware.com|http://twitter.com/commonsguy

  Android Consulting/App Development:http://commonsware.com/consulting

-- 
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] Crashed Service not restarting

2009-11-21 Thread shahzad ahmad
Hi,
I'm just investing how crashed services are restarted. I've developed a
simple service and use a taskkiller from market place to kill the
application. Following are the logs after application is killed

Uninstalling the process test.sys
Force removing process ProcessRecord{432d6ad0 252:test.sys/10041}
(test.sys/10041)
Scheduling restart of crashed service test.sys/.testservice in 5000ms
Sending signal. PID: 252 SIG: 9

But the service is never started. Can anybody tell why service is not
starting? Do i need to put any flag in manifest file for service restart to
work?

Regards,
shaz

-- 
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] storing imageview reference in database, need help retrieving

2009-11-21 Thread JasonMP
Hi,

I'm having trouble retrieving image references from my database and
then setting them to an ImageView.  When I pass R.drawable.icon into
my database its compiled and stored as an Integer.  how would I then
pull this Integer out and use ImageView.setImageDrawable(); ???

-- 
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: storing imageview reference in database, need help retrieving

2009-11-21 Thread JasonMP
Nevermind, got it.

On Nov 21, 9:56 pm, JasonMP hyperje...@gmail.com wrote:
 Hi,

 I'm having trouble retrieving image references from my database and
 then setting them to an ImageView.  When I pass R.drawable.icon into
 my database its compiled and stored as an Integer.  how would I then
 pull this Integer out and use ImageView.setImageDrawable(); ???

-- 
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: Crashed Service not restarting

2009-11-21 Thread shahzad ahmad
I've put some debug prints in onCreate method but they are also not printed
which means service is never restarted. Any help ?

On Sun, Nov 22, 2009 at 1:53 PM, shahzad ahmad shahzad.s.ah...@gmail.comwrote:

 Hi,
 I'm just investing how crashed services are restarted. I've developed a
 simple service and use a taskkiller from market place to kill the
 application. Following are the logs after application is killed

 Uninstalling the process test.sys
 Force removing process ProcessRecord{432d6ad0 252:test.sys/10041}
 (test.sys/10041)
 Scheduling restart of crashed service test.sys/.testservice in 5000ms
 Sending signal. PID: 252 SIG: 9

 But the service is never started. Can anybody tell why service is not
 starting? Do i need to put any flag in manifest file for service restart to
 work?

 Regards,
 shaz


-- 
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

Re: [android-developers] Re: 2.0 AccountManager - Implementing a new account type with Google, Facebook and Exchange

2009-11-21 Thread Dan Dumont
Your authenticator is launched when the Service returns the binder for your
authenticator class.

Look at what the service in the project is doing.

On Sat, Nov 21, 2009 at 7:07 PM, NitroDesk gsuku...@gmail.com wrote:

 Any of you folks tried this on a Droid?
 Simply installing the project that contains an Authenticator in the
 manfest and the other related items seems to cause the Add Account
 option in the account list on te droid to simply reoot the phone with
 an exception.
 Anyone else seen this or find a way to avoid this ?
 -g

 On Nov 21, 9:04 am, Jerry Brady jerry.br...@gmail.com wrote:
  Dan,
 
  Now I see what you are doing in your code and found the reference to
  AddAccountExplicitly().   I want to skip returning an intent to fire
  the an AccountAuthenticatorActivity and instead to return
  KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE directly from my
  AbstractAccountAuthenticator's addAccount method whereas your code
  returns an intent that fires your authentication activity.
 
  The main issue for me so far is that I don't see that my
  AbstractAccountAuthenticator is ever being instantiated.
 
  Cheers,
  Jerry
 
  On Nov 20, 7:53 am, Dan Dumont ddum...@gmail.com wrote:
 
 
 
   Yes.   But I make the AddAccountExplicitly call in my Authenticator.
  You
   use the AccountManager to create accounts.
   If you call AddAccountExplicitly from a non-authenticator class, I
 guess it
   will work...  But I think the security behind it will mean that only
 the
   class that created the account will be able to ever modify it or
 extract the
   password.
 
   This is why they have a framework for you to get an authtoken returned
 via
   the authenticator... the logic for authenticating should be buried
 within
   there, because it will be the only class allowed to peak at the
 password and
   send it wherever you are authenticating.
 
   On Fri, Nov 20, 2009 at 2:16 AM, sukumar bhashyam 
 
   bhashyam.suku...@gmail.com wrote:
AddAccountExplicitly() would need Authenticator of same type.
 
I created an Authenticator and called AddAccountExplicitly() for the
 same
type which created an account ( Could verify it from
AccountManager.getAccounts())
 
One strange thing I observer is none of the  implementation class
 functions
of AbstractAccountAuthenticator is being called. I followed the exact
 steps
in documentation. Not even onCreate or onBind function is called.
 Anyone
seen this problem?. Is your AbstractAccountAuthenticator
 implemetation class
being invoked?.
Thanks.
 
On Thu, Nov 19, 2009 at 8:26 PM, Jerry Brady jerry.br...@gmail.com
 wrote:
 
Dan,
 
Thanks for all of this.  I just returned to the office and will be
taking a look to see how much further I can get and I will certainly
be interested in helping with your accounts project.
 
I got as far as getting my account to show up in the list of
 accounts
along with Google, Facebook and Exchange, but my service never gets
called.  My addAccount() method doesn't return an intent, but rather
KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE in it's bundle to let the
account request succeed.
 
My goal is to create an account that will only be used by my
application and does not need to have any features to enable
 external
authentication or account configuration.
 
I've also tried AddAccountExplicitly() but I can't seem to get
 around
its UID restrictions.  The calling activity and the authenticator
service all belong to the same application so I'm not sure why the
system still throws an error about the UID not being correct.
 
Cheers,
Jerry
 
On Nov 13, 11:54 pm, Dan Dumont ddum...@gmail.com wrote:
 For anyone still interested.I've made a bit of progress.   The
google
 project below now creates and lists accounts of the type for the
project!
 
 On Fri, Nov 13, 2009 at 9:39 PM, Dan Dumont ddum...@gmail.com
 wrote:
  To facilitate the discussion around this topic, I've started up
 a
project
  over here:
 http://code.google.com/p/androidaccounts/
 
  http://code.google.com/p/androidaccounts/If anyone is
 interested in
  pitching in and writing some examples, let me know so I can add
 you.
  The current state of the project is as far as I've gotten to
understanding
  what is available so far... and I'm stumped as to why new
 accounts
don't
  seem to persist after their creation ( as far as the
 AccountsTester
app is
  concerned ).
 
  On Fri, Nov 13, 2009 at 7:40 PM, Dan Dumont ddum...@gmail.com
wrote:
 
  I've gotten a bit further than you.
 
  The account manager seems to want to store AccountName+Type
 pairs,
and
  have anAccountAuthenticatorhandle the storage and dirty bits of
 the
actual
  authentication and credential storage.
 
  You will need to create anAccountAuthenticatorfrom the
  AbstractAccountAuthenticator class.
  

Re: [android-developers] Re: 2.0 AccountManager - Implementing a new account type with Google, Facebook and Exchange

2009-11-21 Thread Dan Dumont
I get that exception in the emulator ( doesn't reboot though )

I thought it was due to missing pieces of the emulator...

 does logcat output anything?

On Sat, Nov 21, 2009 at 7:07 PM, NitroDesk gsuku...@gmail.com wrote:

 Any of you folks tried this on a Droid?
 Simply installing the project that contains an Authenticator in the
 manfest and the other related items seems to cause the Add Account
 option in the account list on te droid to simply reoot the phone with
 an exception.
 Anyone else seen this or find a way to avoid this ?
 -g

 On Nov 21, 9:04 am, Jerry Brady jerry.br...@gmail.com wrote:
  Dan,
 
  Now I see what you are doing in your code and found the reference to
  AddAccountExplicitly().   I want to skip returning an intent to fire
  the an AccountAuthenticatorActivity and instead to return
  KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE directly from my
  AbstractAccountAuthenticator's addAccount method whereas your code
  returns an intent that fires your authentication activity.
 
  The main issue for me so far is that I don't see that my
  AbstractAccountAuthenticator is ever being instantiated.
 
  Cheers,
  Jerry
 
  On Nov 20, 7:53 am, Dan Dumont ddum...@gmail.com wrote:
 
 
 
   Yes.   But I make the AddAccountExplicitly call in my Authenticator.
  You
   use the AccountManager to create accounts.
   If you call AddAccountExplicitly from a non-authenticator class, I
 guess it
   will work...  But I think the security behind it will mean that only
 the
   class that created the account will be able to ever modify it or
 extract the
   password.
 
   This is why they have a framework for you to get an authtoken returned
 via
   the authenticator... the logic for authenticating should be buried
 within
   there, because it will be the only class allowed to peak at the
 password and
   send it wherever you are authenticating.
 
   On Fri, Nov 20, 2009 at 2:16 AM, sukumar bhashyam 
 
   bhashyam.suku...@gmail.com wrote:
AddAccountExplicitly() would need Authenticator of same type.
 
I created an Authenticator and called AddAccountExplicitly() for the
 same
type which created an account ( Could verify it from
AccountManager.getAccounts())
 
One strange thing I observer is none of the  implementation class
 functions
of AbstractAccountAuthenticator is being called. I followed the exact
 steps
in documentation. Not even onCreate or onBind function is called.
 Anyone
seen this problem?. Is your AbstractAccountAuthenticator
 implemetation class
being invoked?.
Thanks.
 
On Thu, Nov 19, 2009 at 8:26 PM, Jerry Brady jerry.br...@gmail.com
 wrote:
 
Dan,
 
Thanks for all of this.  I just returned to the office and will be
taking a look to see how much further I can get and I will certainly
be interested in helping with your accounts project.
 
I got as far as getting my account to show up in the list of
 accounts
along with Google, Facebook and Exchange, but my service never gets
called.  My addAccount() method doesn't return an intent, but rather
KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE in it's bundle to let the
account request succeed.
 
My goal is to create an account that will only be used by my
application and does not need to have any features to enable
 external
authentication or account configuration.
 
I've also tried AddAccountExplicitly() but I can't seem to get
 around
its UID restrictions.  The calling activity and the authenticator
service all belong to the same application so I'm not sure why the
system still throws an error about the UID not being correct.
 
Cheers,
Jerry
 
On Nov 13, 11:54 pm, Dan Dumont ddum...@gmail.com wrote:
 For anyone still interested.I've made a bit of progress.   The
google
 project below now creates and lists accounts of the type for the
project!
 
 On Fri, Nov 13, 2009 at 9:39 PM, Dan Dumont ddum...@gmail.com
 wrote:
  To facilitate the discussion around this topic, I've started up
 a
project
  over here:
 http://code.google.com/p/androidaccounts/
 
  http://code.google.com/p/androidaccounts/If anyone is
 interested in
  pitching in and writing some examples, let me know so I can add
 you.
  The current state of the project is as far as I've gotten to
understanding
  what is available so far... and I'm stumped as to why new
 accounts
don't
  seem to persist after their creation ( as far as the
 AccountsTester
app is
  concerned ).
 
  On Fri, Nov 13, 2009 at 7:40 PM, Dan Dumont ddum...@gmail.com
wrote:
 
  I've gotten a bit further than you.
 
  The account manager seems to want to store AccountName+Type
 pairs,
and
  have anAccountAuthenticatorhandle the storage and dirty bits of
 the
actual
  authentication and credential storage.
 
  You will need to create anAccountAuthenticatorfrom the
  AbstractAccountAuthenticator class.
   

[android-developers] Re: storing imageview reference in database, need help retrieving

2009-11-21 Thread JasonMP
Its ImageView.setImageResource();

On Nov 21, 10:01 pm, JasonMP hyperje...@gmail.com wrote:
 Nevermind, got it.

 On Nov 21, 9:56 pm, JasonMP hyperje...@gmail.com wrote:



  Hi,

  I'm having trouble retrieving image references from my database and
  then setting them to an ImageView.  When I pass R.drawable.icon into
  my database its compiled and stored as an Integer.  how would I then
  pull this Integer out and use ImageView.setImageDrawable(); ???

-- 
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: Crashed Service not restarting

2009-11-21 Thread shahzad ahmad
just wanted to tell that the service is started with alarmmanager using
setrepeating method. is this the reason for service not restarting ?

On Sun, Nov 22, 2009 at 2:03 PM, shahzad ahmad shahzad.s.ah...@gmail.comwrote:

 I've put some debug prints in onCreate method but they are also not printed
 which means service is never restarted. Any help ?


 On Sun, Nov 22, 2009 at 1:53 PM, shahzad ahmad 
 shahzad.s.ah...@gmail.comwrote:

 Hi,
 I'm just investing how crashed services are restarted. I've developed
 a simple service and use a taskkiller from market place to kill the
 application. Following are the logs after application is killed

 Uninstalling the process test.sys
 Force removing process ProcessRecord{432d6ad0 252:test.sys/10041}
 (test.sys/10041)
 Scheduling restart of crashed service test.sys/.testservice in 5000ms
 Sending signal. PID: 252 SIG: 9

 But the service is never started. Can anybody tell why service is not
 starting? Do i need to put any flag in manifest file for service restart to
 work?

 Regards,
 shaz




-- 
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: Crashed Service not restarting

2009-11-21 Thread shahzad ahmad
just tested it with startService but still service is not restarting even
though system is displaying scheduling restart of crahsed service

On Sun, Nov 22, 2009 at 2:25 PM, shahzad ahmad shahzad.s.ah...@gmail.comwrote:

 just wanted to tell that the service is started with alarmmanager using
 setrepeating method. is this the reason for service not restarting ?


 On Sun, Nov 22, 2009 at 2:03 PM, shahzad ahmad 
 shahzad.s.ah...@gmail.comwrote:

 I've put some debug prints in onCreate method but they are also not
 printed which means service is never restarted. Any help ?


 On Sun, Nov 22, 2009 at 1:53 PM, shahzad ahmad shahzad.s.ah...@gmail.com
  wrote:

 Hi,
 I'm just investing how crashed services are restarted. I've developed
 a simple service and use a taskkiller from market place to kill the
 application. Following are the logs after application is killed

 Uninstalling the process test.sys
 Force removing process ProcessRecord{432d6ad0 252:test.sys/10041}
 (test.sys/10041)
 Scheduling restart of crashed service test.sys/.testservice in 5000ms
 Sending signal. PID: 252 SIG: 9

 But the service is never started. Can anybody tell why service is not
 starting? Do i need to put any flag in manifest file for service restart to
 work?

 Regards,
 shaz





-- 
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

Re: [android-developers] Re: Android in China - What is going on?

2009-11-21 Thread Evan JIANG
I was at Shenzhen last week. It is strange that the google sync
doesn't work in Shenzhen, but it works perfectly in Beijing. I hadn't
modified any settings. And in Beijing, both CNC network and CMCC APN
work fine.

Best regards,
On Sat, Nov 21, 2009 at 9:26 AM, shimsim shim@gmail.com wrote:
 Hi westmeadboy, i just tried accessing the google sync page from the
 link you posted and it works fine on my G1 both on WiFi and using
 China Mobile APN, so maybe its a regional issue too. I'm located in
 GZ.

 Don't get me wrong, I am happy to use this topic for everyone to post
 their current experiencing with the issues with Android in China, I
 just want to keep pushing for some official answers too. More posts
 please, lets keep the momentum here!

 Ironically the day after starting this post everything has been
 working fine but as Hong mentioned, its probably just because
 President Obama is in town, so things may go back to being blocked
 soon.

 Any comment Google?




 On Nov 20, 4:13 pm, westmeadboy westmead...@yahoo.co.uk wrote:
 Well, I cannot access:http://www.google.com/mobile/products/sync.html.
 Can you (without a VPN)?

 I know you just want answers, but I think it would help to clarify the
 problem/symptoms too. How is that some people (you) can log on but
 others (me) can't?

 You might also want to try:

 http://www.google.com/support/forum/p/Android+Market/label?lid=7dc8a5...

 On Nov 20, 2:23 pm, shimsim shim@gmail.com wrote:



  It has been working for me almost perfectly the last 3 days, but
  twitter and facebook are still blocked, so maybe they are just working
  wherever President Obama is, either way I have a a PPTP VPN setup but
  thats not the point here ...

  Getting back to the original question ..  can someone from GOOGLE
  or ANDROID speak up and let us know whats going on . PLEASE! some
  official reason why and whats going to happen in the long term. It's
  kind of important, this isnt social networking we are talking about,
  its mail and market and its potentially making Android useless in
  China.

  If this is the wrong place to be posting this question then feel free
  to suggest a more appropriate place, but at least respond.

  thanks!

  On Nov 20, 12:54 pm, westmeadboy westmead...@yahoo.co.uk wrote:

   On Nov 19, 4:53 pm, Gmail addictor tsang.a...@gmail.com wrote:

The sync works again! Market also became accessible! WoooW~~ YEAH!

   Still not working for me - I can't get past the Set up your Google
   account wizard.

   I've tried clearing caches of numerous google/htc apps, but still no
   joy...

   Can anyone else confirm its working in mainland china?

 --
 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

-- 
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: Using FLAG_ACTIVITY_CLEAR_TOP, but don't restart target activity?

2009-11-21 Thread Matt Kanninen
I had never seen so much use required of OR until I started doing
Android application development.

On Nov 21, 5:07 pm, Mark Murphy mmur...@commonsware.com wrote:
 Mark Wyszomierski wrote:
  Hi,

  I'd like to use FLAG_ACTIVITY_CLEAR_TOP to launch an activity in my
  app. It has one feature I don't want though - it restarts the target
  intent, instead of just resuming it. Example history stack, with
  activity D making the call to B with that flag:

   A  B  C  D

   new stack

   A  B

  but 'B' gets relaunched, its onCreate() method is called. Since B is
  already in the history stack, is there a way I can use this flag, but
  have it *not* recreate B, just onResume() it again? The reordering
  flags are kind of what I need too, but they won't pop C and D, just
  reshuffle the stack so B comes to the top, but I want C and D to go
  away,

 Per the documentation:

 The currently running instance of activity B in the above example will
 either receive the new intent you are starting here in its onNewIntent()
 method, or be itself finished and restarted with the new intent. If it
 has declared its launch mode to be multiple (the default) and you have
 not set FLAG_ACTIVITY_SINGLE_TOP in the same intent, then it will be
 finished and re-created; for all other launch modes or if
 FLAG_ACTIVITY_SINGLE_TOP is set then this Intent will be delivered to
 the current instance's onNewIntent(). 

 http://developer.android.com/reference/android/content/Intent.html#FL...

 So, try OR'ing FLAG_ACTIVITY_SINGLE_TOP in your Intent that you're using
 with FLAG_ACTIVITY_CLEAR_TOP, and see if that does the trick.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 Android Consulting/App Development:http://commonsware.com/consulting

-- 
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: Random phone restarts, anyone else experience this?

2009-11-21 Thread Matt Kanninen
My Droid restarts about once a day.  This discussion probably belongs
another board, perhaps Android discuss, or as a bug report.

On Nov 21, 6:38 am, Mark Wyszomierski mar...@gmail.com wrote:
 Hi,

 Not sure if anyone else is experiencing this. My G1 will randomly
 restart itself up to two times a day. Found this in DDMS as the
 possible cause. I'm wondering if my app has anything to do with it,
 but I doubt it since my app is usually closed or will have been idle
 for hours when this happens (and only uses at most 5mb of memory):

 The tag for all these messages is AndroidRuntime:

 11-21 09:06:49.811: ERROR/LockPatternKeyguardView(3813): Failed to
 bind to GLS while checking for account
 11-21 09:06:49.831: ERROR/dalvikvm-heap(3813): 614400-byte external
 allocation too large for this process.
 11-21 09:06:49.831: ERROR/(3813): VM won't let us allocate 614400
 bytes
 11-21 09:06:49.881: WARN/dalvikvm(3813): threadid=37: thread exiting
 with uncaught exception (group=0x4000fe70)
 11-21 09:06:49.881: ERROR/AndroidRuntime(3813): Uncaught handler:
 thread WindowManagerPolicy exiting due to uncaught exception
 11-21 09:06:49.881: ERROR/AndroidRuntime(3813): *** EXCEPTION IN
 SYSTEM PROCESS.  System will crash.
 11-21 09:06:50.081: ERROR/AndroidRuntime(3813):
 java.lang.OutOfMemoryError: bitmap size exceeds VM budget
 11-21 09:06:50.081: ERROR/AndroidRuntime(3813):     at
 android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
 11-21 09:06:50.081: ERROR/AndroidRuntime(3813):     at
 android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:363)
 11-21 09:06:50.081: ERROR/AndroidRuntime(3813):     at
 android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:212)
 11-21 09:06:50.081: ERROR/AndroidRuntime(3813):     at
 android.graphics.drawable.Drawable.createFromResourceStream
 (Drawable.java:663)
 11-21 09:06:50.081: ERROR/AndroidRuntime(3813):     at
 android.content.res.Resources.loadDrawable(Resources.java:1637)
 11-21 09:06:50.081: ERROR/AndroidRuntime(3813):     at
 android.content.res.Resources.getDrawable(Resources.java:535)
 11-21 09:06:50.081: ERROR/AndroidRuntime(3813):     at
 android.app.ApplicationContext.getWallpaper(ApplicationContext.java:
 505)
 11-21 09:06:50.081: ERROR/AndroidRuntime(3813):     at
 com.android.internal.policy.impl.LockPatternKeyguardView.init
 (LockPatternKeyguardView.java:265)
 11-21 09:06:50.081: ERROR/AndroidRuntime(3813):     at
 com.android.internal.policy.impl.LockPatternKeyguardViewProperties.createKe 
 yguardView
 (LockPatternKeyguardViewProperties.java:48)
 11-21 09:06:50.081: ERROR/AndroidRuntime(3813):     at
 com.android.internal.policy.impl.KeyguardViewManager.show
 (KeyguardViewManager.java:123)
 11-21 09:06:50.081: ERROR/AndroidRuntime(3813):     at
 com.android.internal.policy.impl.KeyguardViewMediator.handleShow
 (KeyguardViewMediator.java:860)
 11-21 09:06:50.081: ERROR/AndroidRuntime(3813):     at
 com.android.internal.policy.impl.KeyguardViewMediator.access$500
 (KeyguardViewMediator.java:85)
 11-21 09:06:50.081: ERROR/AndroidRuntime(3813):     at
 com.android.internal.policy.impl.KeyguardViewMediator$2.handleMessage
 (KeyguardViewMediator.java:770)
 11-21 09:06:50.081: ERROR/AndroidRuntime(3813):     at
 android.os.Handler.dispatchMessage(Handler.java:99)
 11-21 09:06:50.081: ERROR/AndroidRuntime(3813):     at
 android.os.Looper.loop(Looper.java:123)
 11-21 09:06:50.081: ERROR/AndroidRuntime(3813):     at
 com.android.server.WindowManagerService$PolicyThread.run
 (WindowManagerService.java:474)

-- 
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] Bitmap memory errorsn, static strings becoming null, MediaRecorder.release hangs

2009-11-21 Thread Matt Kanninen
If my app runs for more then half an hour on the G1 it will fail on
inflating views from xml, giving an error about insufficient memory
creating a bitmap.  Another issue, which may be a side effect is that
global static strings that are assigned at startup become null.

I have worked around that by throwing up setters around those statics
that also store them as a private preference, and thrown up getters
that read the preference in case of null.

The root cause of all of my issues may be that when I call release on
my MediaRecorder it sometimes hangs.  No crash it just never returns,
stalling the thread.  I have worked around that by calling release in
a thread that only does that.

Is anyone else seeing and working around issues like these? I could
use some advice.

-- 
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] Bug in GLSurfaceView.RENDERMODE_WHEN_DIRTY (and work-around)

2009-11-21 Thread tomei.ninge...@gmail.com
My OpenGL app animates only every now and then, so I decided to use
RENDERMODE_WHEN_DIRTY to save some battery life. However, I found that
when I go to Home Screen and return to my app, I often get a black
screen, and I see this in logcat:

E/SurfaceComposerClient( 6055): using an invalid surface id=1,
identity=735 should be 738

This seems to be caused by this code in GLSurfaceView (1.6 here, but
2.0 has same problem):


synchronized (this) {

if (mPaused) {
mEglHelper.finish();
needStart = true;
}
while (needToWait()) {
wait();
}
...
}
if (needStart) {
mEglHelper.start();
..

If I use RENDERMODE_WHEN_DIRTY, I will be stuck inside the wait()
call. When my app is paused/resumed,  GLSurfaceView.{onPause,onResume}
will be called, by the change in mPaused will be lost. So when wait()
finally finishes, the mEglHelper.finish() and mEglHelper.start() lines
are not executed, and I end up drawing into the wrong surface.

The work around is simple but a bit ugly:

public MyView() {
super();
setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
}

public void onResume() {
super.onResume();
setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
requestRender();
}

public void onPause() {
setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);
android.os.SystemClock.sleep(60);
super.onPause();
}

The trick is to temporarily get the GLSurfaceView to run in
RENDERMODE_CONTINUOUSLY. I found the sleep(60) to be necessary to
avoid race conditions that somehow left me hanging inside the wait()
 but I am not sure if this is 100% scientific.

Anyway, cheers, and save a few battery bars!

P.S., I found this to be somewhat disconcerting ... as the longevity
of this bug shows not too many people are trying to use OpenGL to make
their UI faster -- and battery efficient. This probably means that
iPhone apps will continue to look-and-feel better than Android for
quite some time :-(


-- 
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] Android 2.0 bluetooth

2009-11-21 Thread george
Hi

i want to pair with a device using android 2.0

how can i do that

there is no method does this ..

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