[android-developers] Re: Activity Lifecycle Cause Memory Leaking

2009-08-20 Thread brian.schimmel

I experienced similar problems. Depending on how you navigate back to
your Activity, Android does not know that it should reuse the existing
instance and creates a new one. You can fix this easily with the
activities launch mode, which you set in the AndroidManifest.xml.
Setting it to singleInstance will ensure that there is only ever one
instance. Depending on your app this might have other disadvantages,
so you should check this part of the documentation:
http://developer.android.com/guide/topics/fundamentals.html#acttask

On 7 Aug., 07:23, efan e...@efansoftware.com wrote:
 Tested on both 1.5-R2 and R3, same result.

 On Aug 6, 10:22 pm, efan e...@efansoftware.com wrote:

 http://developer.android.com/reference/android/app/Activity.html

  The Activity Lifecycle could have implementation and or design bug:
  One case is to initialize a big image in onCreate(), try to reuse the
  image during the whole lifecycle, and then recycle the image in
  onDestroy().
  Test showed that onCreate() is called every time one navigate away
  from the activity and back again, but onDestroy() is not called at
  all. This behavour causes memory leaking for the big image (size
  960*1920). After 6+ times away and back to activity, the system runs
  out of memory and has tokillthe process.

  One workaround is to initialize the big image in onResume() and
  recycle in onPause(), but that's not so good reuse.

  Could it be better to change the process (as shown in the diagram) a
  little bit such as:
  Call onDestroy() first when a process is killed?


--~--~-~--~~~---~--~~
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: Close Application

2009-08-20 Thread brian.schimmel

I think this will just work fine:

android.os.Process.killProcess(android.os.Process.myPid());

As far as I know, it kills the current DalvikVM right on the spot, so
be careful.

On 10 Aug., 20:49, jhoffman keshis...@gmail.com wrote:
 It really depends on the structure of your app, but one trick you
 might employ is to launch your various activities with
 startActivityForResult(intent, ID);
 and then override onActivityResult to watch for a return value from
 the activity you launched. You can then make decisions about whether
 you should call finish() in the original activity, or whether the user
 just wanted to go back to that original activity without closing the
 entire app.

 Again, without knowing the structure of your app or more details, I
 can't be sure that this is actually going to be helpful to you. If it
 isn't though, feel free to post some specifics! :)

 On Aug 10, 2:36 am, Blackmarket pascal.se...@gmail.com wrote:

  Hi,

  i want to add anexitbutton to the menu, but didn't see an easy way
  to close anapplicationor acces all activities of anapplicationand
  finish them. Is there an easy approach avaible?

  Regards, Pascal


--~--~-~--~~~---~--~~
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: Associate app to open email attachments

2009-08-20 Thread brian.schimmel

As kevin.gaudin pointed out in reply to my bug report, it worked for
me because VCard is in the list of allowed Mime Types because it fits
text/*. So there is still no solution for application/*.

On 20 Aug., 17:42, brian.schimmel brian.schim...@googlemail.com
wrote:
 This is very stange... I experienced the same problems that you for
 some days, and now after comlaining and submitting a bug, it suddently
 works without any changes to my code. In my case, I setup a
 IntentFilter for some Mime Types, and opened an attached VCF-File in
 the Email App with the Open Button. It starts my activity in this
 way:

 Starting activity: Intent { action=android.intent.action.VIEW
 data=content://com.android.email.attachmentprovider/f70bd905-0a85-4355-
 a56f-a41ef6e20100.db/222/RAW flags=0x1 comp={com.companyname/
 com.companyname.ActivityName} }

 So everything is fine with the Email app. Even the Mime type is
 somehow getting through (that is, I think so, because how else would
 Android know to delegate this Intent to my app?)

 But I still experience the same problems with the Gmail App. It
 supplies a Preview button and a click starts a download but yields
 The attachment could not ne fetched because this type of file cannot
 be displayed on the phone. Maybe I need to adjust my IntentFilter to
 handle the file:// protocol, I'll try that and report about it.

 On 20 Aug., 17:28, brian.schimmel brian.schim...@googlemail.com
 wrote:

  This is very annoying, so I just submitted a bug/issue 
  athttp://code.google.com/p/android/issues/detail?id=3611

  You can go there and star the issue to get notified on updates.

  I also looked into the source of theEmailapp. It's completely
  incredible how many layers of indirection are involved after clicking
  on the download button (which will not even be visible if the media
  type is not supported) or the preview button. It finally ends up in
  com.android.email.activity.MessageView.Listener.loadAttachmentFinished
  (Account, Message, Part, Object) and if this is NOT a download, then
  this code will be executed (at least I think so, I currently can't
  debug it):

                      Uri uri = AttachmentProvider.getAttachmentUri(
                              mAccount,
                              attachment.part.getAttachmentId());
                      Intent intent = new Intent(Intent.ACTION_VIEW);
                      intent.setData(uri);
                      intent.addFlags
  (Intent.FLAG_GRANT_READ_URI_PERMISSION);
                      startActivity(intent);

  As you can see, there is no intent.setType(), so any IntentFilter that
  filters by type will not receive this intent.

  On 16 Aug., 08:20, Nivek kevin.gau...@gmail.com wrote:

   Any idea about how to get the real name of the attached file ?

   Nivek

   On 10 juil, 19:13, Alexey Krasnoriadtsev ale...@agilefusion.com
   wrote:

You are correct that you should use contentResolver.openInputStream
(uri), to get the data fromgmailattachments.

DefaultEmailapp, is very dumb and is hardcoded to only open audio
and imageattachments.
(disclaimer, that was the case 6 month ago, the last time i looked at
it).

On Jul 8, 10:16 am, Mirko Nasato mirko.nas...@gmail.com wrote:

 Hi all,

 I've written an app that can handle the VIEW action for a given
 mimeType, say application/foo. By adding the following to
 AndroidManifest.xml the Browser automatically uses my app to open
 downloads of that type:

   intent-filter
      action android:name=android.intent.action.VIEW/
      category android:name=android.intent.category.DEFAULT/
      data android:mimeType=application/foo/
   /intent-filter

 TheGMailapp also tries to use my app to Previewattachmentsof that
 type, but it's passing a URI with scheme gmail-ls:// rather than a
 file:// URI. I guess I need to use a ContentProvider to get the
 attachment data, I haven't looked into that yet.

 But the real mystery is theEmailapp... there just doesn't seem any
 way to make it open theattachments.

 Any pointers? Openingattachmentsis a very common requirement of
 course, and I would expect the Android platform to encourage
 developers to write apps to handle more mime types. Instead I couldn't
 find any answers:

  http://groups.google.com/group/android-developers/browse_thread/threa...
  http://groups.google.com/group/android-developers/browse_thread/threa...

 Thanks

 Mirko


--~--~-~--~~~---~--~~
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: Associate app to open email attachments

2009-08-20 Thread brian.schimmel

This is very annoying, so I just submitted a bug/issue at
http://code.google.com/p/android/issues/detail?id=3611

You can go there and star the issue to get notified on updates.

I also looked into the source of the Email app. It's completely
incredible how many layers of indirection are involved after clicking
on the download button (which will not even be visible if the media
type is not supported) or the preview button. It finally ends up in
com.android.email.activity.MessageView.Listener.loadAttachmentFinished
(Account, Message, Part, Object) and if this is NOT a download, then
this code will be executed (at least I think so, I currently can't
debug it):

Uri uri = AttachmentProvider.getAttachmentUri(
mAccount,
attachment.part.getAttachmentId());
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(uri);
intent.addFlags
(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(intent);

As you can see, there is no intent.setType(), so any IntentFilter that
filters by type will not receive this intent.



On 16 Aug., 08:20, Nivek kevin.gau...@gmail.com wrote:
 Any idea about how to get the real name of the attached file ?

 Nivek

 On 10 juil, 19:13, Alexey Krasnoriadtsev ale...@agilefusion.com
 wrote:

  You are correct that you should use contentResolver.openInputStream
  (uri), to get the data fromgmailattachments.

  DefaultEmailapp, is very dumb and is hardcoded to only open audio
  and imageattachments.
  (disclaimer, that was the case 6 month ago, the last time i looked at
  it).

  On Jul 8, 10:16 am, Mirko Nasato mirko.nas...@gmail.com wrote:

   Hi all,

   I've written an app that can handle the VIEW action for a given
   mimeType, say application/foo. By adding the following to
   AndroidManifest.xml the Browser automatically uses my app to open
   downloads of that type:

     intent-filter
        action android:name=android.intent.action.VIEW/
        category android:name=android.intent.category.DEFAULT/
        data android:mimeType=application/foo/
     /intent-filter

   TheGMailapp also tries to use my app to Previewattachmentsof that
   type, but it's passing a URI with scheme gmail-ls:// rather than a
   file:// URI. I guess I need to use a ContentProvider to get the
   attachment data, I haven't looked into that yet.

   But the real mystery is theEmailapp... there just doesn't seem any
   way to make it open theattachments.

   Any pointers? Openingattachmentsis a very common requirement of
   course, and I would expect the Android platform to encourage
   developers to write apps to handle more mime types. Instead I couldn't
   find any answers:

    http://groups.google.com/group/android-developers/browse_thread/threa...
    http://groups.google.com/group/android-developers/browse_thread/threa...

   Thanks

   Mirko


--~--~-~--~~~---~--~~
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: Associate app to open email attachments

2009-08-20 Thread brian.schimmel

This is very stange... I experienced the same problems that you for
some days, and now after comlaining and submitting a bug, it suddently
works without any changes to my code. In my case, I setup a
IntentFilter for some Mime Types, and opened an attached VCF-File in
the Email App with the Open Button. It starts my activity in this
way:

Starting activity: Intent { action=android.intent.action.VIEW
data=content://com.android.email.attachmentprovider/f70bd905-0a85-4355-
a56f-a41ef6e20100.db/222/RAW flags=0x1 comp={com.companyname/
com.companyname.ActivityName} }

So everything is fine with the Email app. Even the Mime type is
somehow getting through (that is, I think so, because how else would
Android know to delegate this Intent to my app?)

But I still experience the same problems with the Gmail App. It
supplies a Preview button and a click starts a download but yields
The attachment could not ne fetched because this type of file cannot
be displayed on the phone. Maybe I need to adjust my IntentFilter to
handle the file:// protocol, I'll try that and report about it.


On 20 Aug., 17:28, brian.schimmel brian.schim...@googlemail.com
wrote:
 This is very annoying, so I just submitted a bug/issue 
 athttp://code.google.com/p/android/issues/detail?id=3611

 You can go there and star the issue to get notified on updates.

 I also looked into the source of theEmailapp. It's completely
 incredible how many layers of indirection are involved after clicking
 on the download button (which will not even be visible if the media
 type is not supported) or the preview button. It finally ends up in
 com.android.email.activity.MessageView.Listener.loadAttachmentFinished
 (Account, Message, Part, Object) and if this is NOT a download, then
 this code will be executed (at least I think so, I currently can't
 debug it):

                     Uri uri = AttachmentProvider.getAttachmentUri(
                             mAccount,
                             attachment.part.getAttachmentId());
                     Intent intent = new Intent(Intent.ACTION_VIEW);
                     intent.setData(uri);
                     intent.addFlags
 (Intent.FLAG_GRANT_READ_URI_PERMISSION);
                     startActivity(intent);

 As you can see, there is no intent.setType(), so any IntentFilter that
 filters by type will not receive this intent.

 On 16 Aug., 08:20, Nivek kevin.gau...@gmail.com wrote:

  Any idea about how to get the real name of the attached file ?

  Nivek

  On 10 juil, 19:13, Alexey Krasnoriadtsev ale...@agilefusion.com
  wrote:

   You are correct that you should use contentResolver.openInputStream
   (uri), to get the data fromgmailattachments.

   DefaultEmailapp, is very dumb and is hardcoded to only open audio
   and imageattachments.
   (disclaimer, that was the case 6 month ago, the last time i looked at
   it).

   On Jul 8, 10:16 am, Mirko Nasato mirko.nas...@gmail.com wrote:

Hi all,

I've written an app that can handle the VIEW action for a given
mimeType, say application/foo. By adding the following to
AndroidManifest.xml the Browser automatically uses my app to open
downloads of that type:

  intent-filter
     action android:name=android.intent.action.VIEW/
     category android:name=android.intent.category.DEFAULT/
     data android:mimeType=application/foo/
  /intent-filter

TheGMailapp also tries to use my app to Previewattachmentsof that
type, but it's passing a URI with scheme gmail-ls:// rather than a
file:// URI. I guess I need to use a ContentProvider to get the
attachment data, I haven't looked into that yet.

But the real mystery is theEmailapp... there just doesn't seem any
way to make it open theattachments.

Any pointers? Openingattachmentsis a very common requirement of
course, and I would expect the Android platform to encourage
developers to write apps to handle more mime types. Instead I couldn't
find any answers:

 http://groups.google.com/group/android-developers/browse_thread/threa...
 http://groups.google.com/group/android-developers/browse_thread/threa...

Thanks

Mirko


--~--~-~--~~~---~--~~
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: can execute my app automatilly when android is up?

2009-08-06 Thread brian.schimmel

I think home is not the first application that is started, but it is
the first visible one. So you have two options:

1. Your application can replace the home screen, but then it should do
everything that a home screen does. You have to declare an
IntentFilter with the Home category, see
http://developer.android.com/reference/android/content/Intent.html#CATEGORY_HOME

2. You can register your app to be executed on startup, additional to
home. There is a matching broadcast action decribed here:
http://developer.android.com/reference/android/content/Intent.html#ACTION_BOOT_COMPLETED

On 6 Aug., 08:43, tstanly tsai.sta...@gmail.com wrote:
 hi all,

 I want to change the start point of my machine,
 that is,when start on Android,
 it can run my app instead of home firstly,

 if it possiable?

 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: maps api and 1.5

2009-07-30 Thread brian.schimmel

Well, in the end I couldn't get Google Maps to run on 1.5 no matter
how hard I tried. Now I'm happily using OpenStreetMap, which was up
and running in 15 minutes, but needed one or two days of tweeking
until it met my needs. See 
http://www.anddev.org/openstreetmap_mapview_for_android-t2967.html

Anyway, that's nothing compared to the many days I spend trying to get
Google Maps working along with a Widget. The thread
http://groups.google.com/group/android-developers/browse_thread/thread/7ce1902505bba25a/f915dcb6d1ee6f19?lnk=gstq=maps+widget#f915dcb6d1ee6f19
states that this is currently impossible anyway.

Anyway, some of you might acutally need to use Google Maps, and I hope
that there will be some clarification for everyone who still
experiences difficulties and a bugfix in the next SDK version.

On 30 Jul., 08:50, jagtap.jj jagtap...@gmail.com wrote:
 Refer this
  http://www.anddev.org/viewtopic.php?p=24902#24902

 On Jul 21, 10:12 pm, Spiral jmri...@gmail.com wrote:

  Same here.

  On Jul 6, 8:45 pm, Georgy georgearna...@gmail.com wrote:

   Hello Brian,

   I am having your same issue. Were you able to solve it?

   thanks

   On May 25, 8:48 am, brian.schimmel brian.schim...@googlemail.com
   wrote:

Hi everybody,

I'm getting the same problems. Of course I have read this thread and
tried everything that was suggested (and some more), but it does not
work. Here are the facts:
 * Using SDK 1.5_r1
 * Project target in Eclipse is Google APIs 1.5
 * AndroidManifest.xml contains uses-sdk android:minSdkVersion=3 /
inside the manifest element
 * AndroidManifest.xml contains uses-library
android:name=com.google.android.maps / inside the application
element
 * maps.jar is NOT added manually to the buildpath, but is shown under
Project - Google APIs - maps.jar
 * The maps key is setup properly (that is, worked before switching to
1.5)
 * code works when compiled againt the 1.1 API, but I need to compile
for 1.5 because I want to provide a Widget.

On the emulator (Firmware 1.5, google_sdk_eng 1.5 CUPCAKE 147336 test-
keys, the one that comes with DSK 1.5_r1) I get this:

05-25 12:33:40.554: INFO/ActivityManager(568): Starting 
activity:Intent{ comp={com.webxells.ourapp/.OurMapview} }
05-25 12:33:40.564: DEBUG/AndroidRuntime(819): Shutting down VM
05-25 12:33:40.564: WARN/dalvikvm(819): threadid=3: thread exiting
with uncaught exception (group=0x4000fe70)
05-25 12:33:40.564: ERROR/AndroidRuntime(819): Uncaught handler:
thread main exiting due to uncaught exception
05-25 12:33:40.584: ERROR/AndroidRuntime(819):
android.content.ActivityNotFoundException:Unableto find explicit
activity class {com.webxells.ourapp/.OurMapview}; have you declared
this activity in your AndroidManifest.xml?
05-25 12:33:40.584: ERROR/AndroidRuntime(819):     at
android.app.Instrumentation.checkStartActivityResult
(Instrumentation.java:1480)
05-25 12:33:40.584: ERROR/AndroidRuntime(819):     at
android.app.Instrumentation.execStartActivity(Instrumentation.java:
1454)
05-25 12:33:40.584: ERROR/AndroidRuntime(819):     at
android.app.Activity.startActivityForResult(Activity.java:2656)
05-25 12:33:40.584: ERROR/AndroidRuntime(819):     at
android.app.Activity.startActivity(Activity.java:2700)
05-25 12:33:40.584: ERROR/AndroidRuntime(819):     at
com.webxells.ourapp.CommonUi.onOptionsItemSelected(CommonUi.java:64)
05-25 12:33:40.584: ERROR/AndroidRuntime(819):     at
com.webxells.ourapp.OurAppStart.onOptionsItemSelected(OurAppStart.java:
22)
05-25 12:33:40.584: ERROR/AndroidRuntime(819):     at
android.app.Activity.onMenuItemSelected(Activity.java:2085)
... some more...

Of course, the activity is declared in the AndroidManifest.xml, and
this declaration worked when compiling against the 1.1 API.

And on a real device (HTC Dev Phone 1, Firmware 1.5, dream_devphone-
userdebug 1.5 CRB21 147201 test-keys) I get another error, instead of
the one above:

05-25 12:17:34.764: WARN/dalvikvm(691):Unabletoresolvesuperclass
of Lcom/webxells/ourapp/OurMapview; (100)
05-25 12:17:34.764: WARN/dalvikvm(691): Link of class 'Lcom/webxells/
ourapp/OurMapview;' failed
05-25 12:17:34.764: ERROR/dalvikvm(691): Could not find class
'com.webxells.ourapp.OurMapview', referenced from method
com.webxells.ourapp.CommonUi.onOptionsItemSelected
05-25 12:17:34.764: WARN/dalvikvm(691): VFY:unabletoresolveconst-
class 114 (Lcom/webxells/ourapp/OurMapview;) in Lcom/webxells/ourapp/
CommonUi;
05-25 12:17:34.764: WARN/dalvikvm(691): VFY:  rejecting opcode 0x1c at
0x0045
05-25 12:17:34.764: WARN/dalvikvm(691): VFY:  rejected Lcom/webxells/
ourapp/CommonUi;.onOptionsItemSelected (Landroid/view/
MenuItem;Landroid/app/Activity;)Z
05-25 12:17:34.764: WARN/dalvikvm(691): Verifier rejected class Lcom

[android-developers] Re: ListView: invisible dividers still take up space. Is it a bug or a feature?

2009-07-30 Thread brian.schimmel

Hi Romain,

I think you just got me wrong. If I wanted to have no dividers at all,
I would set dividerHeight to 0, of course.

Indeed, I want to have dividers between enabled items, but no dividers
next to disabled ones. The code in ListView.dispatchDraw() already has
code for this:
if (bottom  listBottom 
(areAllItemsSelectable ||
(adapter.isEnabled(first + i)  (i ==
count - 1 ||
adapter.isEnabled(first + i +
1) {
bounds.top = bottom;
bounds.bottom = bottom + dividerHeight;
drawDivider(canvas, bounds, i);
}

but the code related to the layout of the children seems to ignore the
presence of disabled items. It's reserving space for dividers that
will not be drawn by dispatchDraw.

Maybe this is intended as well. But anyway, I wish it was intended
(and implemented) the other way ;)

I think I can't help that with dividerHeight, because it is a global
property that affects all dividers at once.

with best regards,
Brian Schimmel

On 30 Jul., 17:57, Romain Guy romain...@google.com wrote:
  I'm rather sure this is a Bug, but maybe it's the intended behaviour.

 This is not a bug. Just set the dividerHeight to 0.

 --
 Romain Guy
 Android framework engineer
 romain...@android.com

 Note: please don't send private questions to me, as I don't have time
 to provide private support.  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: Soft references freed too early

2009-07-24 Thread brian.schimmel

Hi fadden,

thanks for your answer and for looking things up in the dalvik source.
Sounds very much like you are right.

I didn't know of dalvik.system.VMRuntime.setMinimumHeapSize() but now
tried it. Invoking that with 4 MB or 5MB has no visible effect. But
invoking it with 8MB solves my problem.

So while my needs are fullfilled now, at least until Android 1.6 or
2.0 comes out and dropps support for setMinimumHeapSize, I had some
insights I want to share:

Interestingly, while doing some benchmarking it turned out that the
real heap size and heap usage is not increased by this. I called
setMinimumHeapSize jsut before the caching/prebuffering starts. I've
compiled my app with different values and used the eclipse DDMS view
to query the heap usage at three important times in my application
life cycle:

Step 1: Start the application and wait for the caching to be done,
then GC
Step 2: Open up another activity that displays a visual list, showing
the first 9 objects, then GC
Step 3: Scroll several times up and down through the list, until
scrolling is smooth, then GC

Without using setMinimumHeapSize:
Step 1: 3,258 used: 2,473
Step 2: 3,445 used: 2,571
Step 3: 3,508 used: 2,639

runtime.setMinimumHeapSize(400);
runtime.setTargetHeapUtilization(0.9f);
Step 1: 3,195 used: 2,485
Step 2: 3,508 used: 2,580
Step 3: 3,508 used: 2,583

runtime.setMinimumHeapSize(500);
Step 1: 3,250 used: 2,386
Step 2: 3,258 used: 2,517
Step 3: 3,383 used: 2,595

runtime.setMinimumHeapSize(800);
Step 1: 3,320 used: 2,480
Step 2: 3,320 used: 2,519
Step 3: 3,320 used: 2,531

As you can see, there is now big difference in those values. Anyway,
only when setting the heap to 8MB, none of my weakly referenced
objects where thrown away, and in Step 3 I instantly get a smooth
scrolling list.

The usage is always around 76%. I noticed there is a method
setTargetHeapUtilization and tried it once, supplying 0.9f as
parameter. As you can see in the above numbers, doing it results in
the same actual usage around 76%.

with best regards,
Brian schimmel

On 23 Jul., 22:16, fadden fad...@android.com wrote:
 On Jul 23, 5:50 am, brian.schim...@googlemail.com

 brian.schim...@googlemail.com wrote:
  Actually, something like that happens:
  Object 1 is cached
  Object 2 is cached
  Object 3 is cached
  Object 4 is cached
  Object 5 is cached
  Objects 1 to 4 are cleared by the GC
  Object 6 is cached
  Object 7 is cached
  Object 8 is cached
  Object 9 is cached
  Objects 5 to 8 are cleared by the GC
  and so on.

 I don't believe this is the desired behavior.  Looking at tryMalloc()
 in dalvik/vm/alloc/Heap.c, it initially calls gcForMalloc(false),
 which should not be attempting to collect soft references.  Only
 later, when confronted with the possibility of throwing OOM, does it
 call gcForMalloc(true).

 Hmm.  In dvmHeapSizeChanged() there's a SOFT_REFERENCE_GROWTH_SLACK
 value that appears to be trying to strike a balance between expanding
 without limit and collecting objects.  If there's no cap we might fill
 16MB with softly-reachable objects before we discard any of them,
 which isn't desirable on a device that has multiple applications
 resident in memory.  It appears the function wants the GC to collect
 some of the soft references, which sounds good, but it looks like
 SR_COLLECT_SOME doesn't receive special treatment during the mark 
 sweep.  In the current implementation, it's all or nothing.

 So my guess is you've got more than 128KB of softly-reachable objects
 (i.e. the things that are softly referenced, and the things that are
 only reachable through them).  When the GC has to choose between
 expanding the current heap size and chucking the soft references, it's
 choosing to discard some, which in the current implementation means
 all.

 The observed behavior changes after you have a bunch of other stuff
 allocated, because the soft limit is higher, and the GC doesn't have
 to choose between expanding the heap and collecting the soft
 references.

 You might be able to work around this behavior by calling
 dalvik.system.VMRuntime.setMinimumHeapSize() (which really shouldn't
 be exposed in the API, but there it is).  If you start it out at 4MB
 that might prevent you from thrashing like this right after the app
 starts up.  I think the issue will come back if you manage to get
 close to the soft limit again, but I don't think that's avoidable
 without a change to the GC behavior.  (There are some kluges you could
 employ to suppress the behavior, like periodically grabbing hard
 references to all cached items, allocating something large, discarding
 it, and un-refing the cache entries, but that's ugly and might not
 work anyway.)

 I'll file a bug against the GC.
--~--~-~--~~~---~--~~
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, 

[android-developers] Re: How to style my own styleable with a style? (Custom view class with custom attribute)

2009-07-08 Thread brian.schimmel

Thank you very much, Dianne! It's alway amazing how quick and correct
your answers are ;)

This solves the problems I mentioned above, and some others I was not
even aware of.

I've seen that TypedArray-stuff in the plattform source before, e.g.
in the constructor of TextView.java, but did not quite get its meaning
and forgot about it. Your example above makes it much clearer.

I was working along the instructions on
http://developer.android.com/guide/topics/ui/custom-components.html to
create my component. Maybe the part that sais Note that you also
might introduce your own attributes and parameters into the XML that
can be pulled out and used by your constructor. should elaborate some
more, or should be linked to the API demo you provided above.

On 8 Jul., 17:50, Dianne Hackborn hack...@android.com wrote:
 If you are using attrs.getAttributeResourceValue(), then you are not using
 the style/theming system at all.  That is, there was no purpose to defining
 a declare-styleable an attr at all, that function is just retrieving a
 raw value from a resource for a given name.  (This is also why the 
 http://some.weird.url.com/seems/not/to/matter; URI doesn't matter -- you
 have declared it as a namespace in your XML, and you have retrieved the
 attribute in that namespace in your Java code, and that is all that is
 happening.  You just made up a namespace and used it.)

 You can find a complete example if declaring styleables and themes in API
 demos.  Basically you declare a styleable like this (there is no id field
 that is used):

 declare-styleable name=LabelView
   attr name=text format=string/
   attr name=textColor format=color/
   attr name=textSize format=dimension/
   /declare-styleable
 /resources

 Then use it in a layout like this:

 LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;

         
 xmlns:app=http://schemas.android.com/apk/res/com.example.android.apis;

         android:orientation=vertical
         android:layout_width=fill_parent

         android:layout_height=wrap_content

     com.example.android.apis.view.LabelView

             android:background=@drawable/green
             android:layout_width=fill_parent

             android:layout_height=wrap_content
             app:text=Green app:textColor=# /

 /LinearLayout

 Note that the URI of xmlns:app is very important, this is the namespace for
 android resources (the first part) in your package (the second part).

 Finally to retrieve the resources, you do this:

     public LabelView(Context context, AttributeSet attrs) {
         super(context, attrs);
         initLabelView();

         TypedArray a = context.obtainStyledAttributes(attrs,

                 R.styleable.LabelView);

         CharSequence s = a.getString(R.styleable.LabelView_text);
         if (s != null) {
             setText(s.toString());
         }

         // Retrieve the color(s) to be used for this view and apply them.

         // Note, if you only care about supporting a single color, that you
         // can instead call a.getColor() and pass that to setTextColor().
         setTextColor(a.getColor(R.styleable.LabelView_textColor, 0xFF00));

         int textSize =
 a.getDimensionPixelOffset(R.styleable.LabelView_textSize, 0);
         if (textSize  0) {
             setTextSize(textSize);
         }

         a.recycle();
     }

 The use of obtainedStyledAttributes() is very important, as that is the key
 function that extracts the attributes you have declared in your styleable,
 filling them in from the current AttributeSet or style or theme as
 appropriate.

 With all of that together, you can now define your theme, assigning values
 to your own custom attributes that will be seen in your custom view.

 On Wed, Jul 8, 2009 at 8:02 AM, brian.schim...@googlemail.com 



 brian.schim...@googlemail.com wrote:

  Hi,

  I'm creating my own View class, and defining custom xml attributes
  with a attrs.xml. As long as I provide each attribute manually, there
  is no problem, but

  ?xml version=1.0 encoding=utf-8?
  resources
         declare-styleable id=my.package.CustomizedButtonView
  name=CustomizedButtonView
                 attr name=borderDrawable format=reference|color/
         /declare-styleable
  /resources

  To be honest, I don't understand the proper use of the attributes id
  and name in the above code, but somehow it works. I can now
  reference the borderDrawable-Attribute from a layout xml file:

  ?xml version=1.0 encoding=utf-8?
  LinearLayout
         xmlns:android=http://schemas.android.com/apk/res/android;
         xmlns:mypack=http://some.weird.url.com/seems/not/to/matter;

         my.package.CustomizedButtonView
                                 android:text=This is my text

   mypack:borderDrawable=@drawable/border243/
  /LinearLayout

  My class CustomizedButtonView now reads the attribute like this:
         public CustomizedButtonView(Context context, AttributeSet attrs) {
                

[android-developers] Re: SlidingDrawer issue #1?

2009-07-03 Thread brian.schimmel

The same with me. Just filed a bug report at
http://code.google.com/p/android/issues/detail?id=3162
You can go there and star the issue to get notified on changes.

wbr,
Brian

On 19 Mai, 14:47, brindy bri...@brindy.org.uk wrote:
 Yep, exactly the same here. =)

 Cheers,
 Brindy

 On May 7, 11:27 am, cannehal tomasz.l...@gmail.com wrote:

  As I said before I have the same issue as Sheepz. It works fine in
  runtime, but in layout editor in eclipse there is Exception. For me it
  looks like a bug in plugin.
  And for forthcoming questions: I am using latest SDK (1.5) and proper
  eclipse plugin.

  On May 6, 1:34 am, Sheepz eladk...@gmail.com wrote:

   if you mean 1.5, yes i am, i have also updated the editors for eclipse
   as described in the upgrade sdk page.

   On May 5, 7:06 pm, dan raaka danra...@gmail.com wrote:

are you using the latest version of SDK ?

On Tue, May 5, 2009 at 4:04 PM, Sheepz eladk...@gmail.com wrote:

 I took a look at the api
http://developer.android.com/reference/android/widget/SlidingDrawer.html
 and copied their example to a clean sandbox project
 this is the code:
 [beginquote]

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

  SlidingDrawer
     android:id=@+id/drawer
     android:layout_width=fill_parent
     android:layout_height=fill_parent

     android:handle=@+id/handle
     android:content=@+id/content

     ImageView
         android:id=@id/handle
         android:layout_width=88dip
         android:layout_height=44dip
         android:src=@drawable/icon /

     GridView
         android:id=@id/content
         android:layout_width=fill_parent
         android:layout_height=fill_parent 
         /GridView

  /SlidingDrawer

 /LinearLayout

 [endquote]

 this gives out the exception in eclipse, but it does run well...
 does anybody know why this is happening? can anyone else confirm this
 is happening on their environment?
 Thanks,
 Sh

 On May 1, 11:29 pm, Sheepz eladk...@gmail.com wrote:
  anyone found a solution?

  On May 1, 10:03 am, cannehal tomasz.l...@gmail.com wrote:

   I tkink I have the same issue. For handle I have ImageView and for
   content I am using LinearLayout with some views inside of it.
   There is probably problem with eclipse plugin because in runtime 
   it
   works fine.

   On May 1, 7:01 am, Sheepz eladk...@gmail.com wrote:

anyone else found something here?

On Apr 30, 5:43 pm, Sheepz eladk...@gmail.com wrote:

 okay, that didnt work :(
 SlidingDrawerandroid:id=@+id/SlidingDrawer01
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:handle=@+id/ImageView01
 android:content=@+id/ImageView02
 ImageView android:id=@id/ImageView01
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:src=@drawable/back2/
 ImageView
 ImageView android:id=@id/ImageView02
 android:layout_width=wrap_content
 android:layout_height=wrap_content 
 android:src=@drawable/ahh/
 ImageView
 /SlidingDrawer

 still getting the same message in the ADT only now when 
 launching
 the
 app, it simply stalls half drawn instead of giving an error 
 message
 saying the application threw an exception...

 On Apr 30, 5:40 pm, Romain Guy romain...@google.com wrote:

  You must use different views, it doesn't make sense to have 
  the
 same
  view, it's going to confuseSlidingDrawer:)

  On Thu, Apr 30, 2009 at 2:38 PM, Sheepz eladk...@gmail.com
 wrote:

   yeah, i figured that might be it, but even after this fix:
   SlidingDrawerandroid:id=@+id/SlidingDrawer01
   android:layout_width=wrap_content
   android:layout_height=wrap_content
 android:handle=@+id/ImageView01
   android:content=@+id/ImageView01
   ImageView android:id=@id/ImageView01
   android:layout_width=wrap_content
   android:layout_height=wrap_content
 android:src=@drawable/ahh/
   ImageView
   /SlidingDrawer
   i still get the same error - i'm gonna try using diffrent 
   views
 for
   the content and the handle
   brb :)

   On Apr 30, 5:32 pm, Romain Guy romain...@google.com 
   wrote:
   There is a bug indeed, the exception message says the 
   handle
 is
   missing, but the content is missing. Check out the 
   javadoc.
 I'll fix
   the exception message.

   On Thu, Apr 30, 2009 at 2:26 

[android-developers] Re: List items not clickable when using ListAdapter, but clickable with SimpleAdapter

2009-06-15 Thread brian.schimmel

Hi,

my problem is now solved and I just want to report the solution, in
case someone else is finding the same problem.

My implementation of ListAdapter.isEnabled was returning false, which
of course should have returned true. Shame on me, very stupid mistake.

with best regards, Brian

On 25 Mai, 19:14, brian.schimmel brian.schim...@googlemail.com
wrote:
 Just a small update, just in case some else has the same problem...

 I finally found the source code 
 athttp://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
 (no idea why I did not find it before), and there is nothing inside
 that should have an impact on the click behaviour.

 So there muste be something wrong in my code.

 On 13 Mai, 20:24, brian.schim...@googlemail.com

 brian.schim...@googlemail.com wrote:
  Hi,

  I was populating a list with a SimpleAdapter like this:

  final ListMapString, String data = someObject.getData();
  SimpleAdapter dataAdapter = new SimpleAdapter
                          (this, data, R.layout.listline, from, to);
  listView.setAdapter(dataAdapter);
  listView.setOnItemClickListener(...);

  The listView gets this from the layout.xml:
  android:choiceMode=singleChoice android:clickable=true

  R.layout.listline defines a layout for each line, having 4 TextViews
  and some more widgets. Everything works fine so far.

  But now I need to use a ListAdapter to populate my list. It was easy
  to write a class that implements all those methods required by that
  interface, and the resulting List looks exactly the same now. It
  performs well on scrolling, changing data, etc. but the lines are not
  clickable any more. My onItemClickListener.onClick is never called,
  not matter where I tap on my list line (e.g. on one of the TextViews
  or on the background of that line). In my implementation, I use
  View.inflate to inflate excactly the same xml as the SimpleAdapter
  did.

  Shouldn't the click behaviour of a list be independant of where data
  comes from?

  I guess SimpleAdapter does some internal magic that I'd need to
  perform in my own implementation as well, to make the line clickable.
  Can somebody point out what I'm missing? I'd also like to look at the
  source code of SimpleAdapter, but I coudn't find it anywhere 
  onhttp://android.git.kernel.org/-maybe I'm just to dumb to look in the
  right place. Can somebody point me to that code? (possibly without
  forcing me to install git and download the whole code base)

  thanks,
  Brian


--~--~-~--~~~---~--~~
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: Getting the manifest.xml of applications from the market?

2009-05-25 Thread brian.schimmel

Thank you for your answers! Based on the assumption that I already
have the apk-file, your answers are very helpful, because I was not
aware of the issue with the binary file format. I've tested the aapt
command and it did what you said, which is ok.

But my question should have asked how I can programatically download
apks from the market, or if there is a way to just download the
manifest.xml. From what I have read elsewhere, I think the Google
Market does not allow other clients than the official one to access
it. And even if it did, it could only server the whole apk and not
just the AndroidManifest.xml, because the market does not even have
this file in XML syntax.

So I'm going to try out my idea with another, non-official market like
andappstore.com, where I can directly download apks from the device as
well as from a host side. And as soon as I have something working, I
might come back and ask how to integrate it with google market.

--
thanks, Brian

On 22 Mai, 00:38, Dianne Hackborn hack...@android.com wrote:
 If you are running on a device, you can use the Java APIs to get and read
 the package and compiled XML files out of it.

 If you are running on the host side, aapt dump xmltree path to apk path
 to file inside apk will print out a not-at-all-XML-but-human-readable
 version of the binary XML file.



 On Thu, May 21, 2009 at 2:51 PM, rollbak roll...@gmail.com wrote:

  That is not so simple, because manifest inside APK is converted to a
  binary file which format is unknown.

  On May 21, 2:52 am, Raphael r...@android.com wrote:
   APKs are simply zip files. If you have anAPK, you can read its manifest.
   R/

   On Wed, May 20, 2009 at 1:49 AM, brian.schim...@googlemail.com

   brian.schim...@googlemail.com wrote:

Hi there,

is there some way to retrieve the manifest.xmlof an application from
the market, without installing the application? I think the official
Market Application somehow get this file (or at least parts of it) to
show needed permissions, etc. before installing. I'd be interested in
seeing the IntentFilters defined by applications and their activities
and processing this information in my application.

thanks,
Brian

 --
 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: maps api and 1.5

2009-05-25 Thread brian.schimmel

Hi everybody,

I'm getting the same problems. Of course I have read this thread and
tried everything that was suggested (and some more), but it does not
work. Here are the facts:
 * Using SDK 1.5_r1
 * Project target in Eclipse is Google APIs 1.5
 * AndroidManifest.xml contains uses-sdk android:minSdkVersion=3 /
inside the manifest element
 * AndroidManifest.xml contains uses-library
android:name=com.google.android.maps / inside the application
element
 * maps.jar is NOT added manually to the buildpath, but is shown under
Project - Google APIs - maps.jar
 * The maps key is setup properly (that is, worked before switching to
1.5)
 * code works when compiled againt the 1.1 API, but I need to compile
for 1.5 because I want to provide a Widget.

On the emulator (Firmware 1.5, google_sdk_eng 1.5 CUPCAKE 147336 test-
keys, the one that comes with DSK 1.5_r1) I get this:

05-25 12:33:40.554: INFO/ActivityManager(568): Starting activity:
Intent { comp={com.webxells.ourapp/.OurMapview} }
05-25 12:33:40.564: DEBUG/AndroidRuntime(819): Shutting down VM
05-25 12:33:40.564: WARN/dalvikvm(819): threadid=3: thread exiting
with uncaught exception (group=0x4000fe70)
05-25 12:33:40.564: ERROR/AndroidRuntime(819): Uncaught handler:
thread main exiting due to uncaught exception
05-25 12:33:40.584: ERROR/AndroidRuntime(819):
android.content.ActivityNotFoundException: Unable to find explicit
activity class {com.webxells.ourapp/.OurMapview}; have you declared
this activity in your AndroidManifest.xml?
05-25 12:33:40.584: ERROR/AndroidRuntime(819): at
android.app.Instrumentation.checkStartActivityResult
(Instrumentation.java:1480)
05-25 12:33:40.584: ERROR/AndroidRuntime(819): at
android.app.Instrumentation.execStartActivity(Instrumentation.java:
1454)
05-25 12:33:40.584: ERROR/AndroidRuntime(819): at
android.app.Activity.startActivityForResult(Activity.java:2656)
05-25 12:33:40.584: ERROR/AndroidRuntime(819): at
android.app.Activity.startActivity(Activity.java:2700)
05-25 12:33:40.584: ERROR/AndroidRuntime(819): at
com.webxells.ourapp.CommonUi.onOptionsItemSelected(CommonUi.java:64)
05-25 12:33:40.584: ERROR/AndroidRuntime(819): at
com.webxells.ourapp.OurAppStart.onOptionsItemSelected(OurAppStart.java:
22)
05-25 12:33:40.584: ERROR/AndroidRuntime(819): at
android.app.Activity.onMenuItemSelected(Activity.java:2085)
... some more...

Of course, the activity is declared in the AndroidManifest.xml, and
this declaration worked when compiling against the 1.1 API.

And on a real device (HTC Dev Phone 1, Firmware 1.5, dream_devphone-
userdebug 1.5 CRB21 147201 test-keys) I get another error, instead of
the one above:

05-25 12:17:34.764: WARN/dalvikvm(691): Unable to resolve superclass
of Lcom/webxells/ourapp/OurMapview; (100)
05-25 12:17:34.764: WARN/dalvikvm(691): Link of class 'Lcom/webxells/
ourapp/OurMapview;' failed
05-25 12:17:34.764: ERROR/dalvikvm(691): Could not find class
'com.webxells.ourapp.OurMapview', referenced from method
com.webxells.ourapp.CommonUi.onOptionsItemSelected
05-25 12:17:34.764: WARN/dalvikvm(691): VFY: unable to resolve const-
class 114 (Lcom/webxells/ourapp/OurMapview;) in Lcom/webxells/ourapp/
CommonUi;
05-25 12:17:34.764: WARN/dalvikvm(691): VFY:  rejecting opcode 0x1c at
0x0045
05-25 12:17:34.764: WARN/dalvikvm(691): VFY:  rejected Lcom/webxells/
ourapp/CommonUi;.onOptionsItemSelected (Landroid/view/
MenuItem;Landroid/app/Activity;)Z
05-25 12:17:34.764: WARN/dalvikvm(691): Verifier rejected class Lcom/
webxells/ourapp/CommonUi;
05-25 12:17:34.764: DEBUG/AndroidRuntime(691): Shutting down VM
05-25 12:17:34.764: WARN/dalvikvm(691): threadid=3: thread exiting
with uncaught exception (group=0x4000fe70)
05-25 12:17:34.764: ERROR/AndroidRuntime(691): Uncaught handler:
thread main exiting due to uncaught exception
05-25 12:17:34.784: ERROR/AndroidRuntime(691): java.lang.VerifyError:
com.webxells.ourapp.CommonUi
05-25 12:17:34.784: ERROR/AndroidRuntime(691): at
com.webxells.ourapp.ourappMain.onOptionsItemSelected(ourappMain.java:
36)
05-25 12:17:34.784: ERROR/AndroidRuntime(691): at
android.app.Activity.onMenuItemSelected(Activity.java:2085)
... some more ...

of course, the unknown superclass of OurMapview is
com.google.android.maps.MapActivity. Don't get confused by the name
OurMapview, it's an activity, not a view.

While trying different targets and small changes in the manifest, I
somehow managed to get it working on the emulator, but it never worked
on the device. When I compiled for 1.1, it worked on the emulator and
the device, though they were already running the 1.5 firmware. Any
idea what else could be wrong?

thanks,
Brian

On 21 Apr., 19:29, André Charles Legendre andre.legen...@gmail.com
wrote:
 Hi

 Finally, my error was to leftmaps.jar in the classpath

 Now, this very simple Map app with 1.5 SDK launch good

 Thank for all the responses. It helps a lot.

 Andre
--~--~-~--~~~---~--~~
You received this message because you are 

[android-developers] Re: List items not clickable when using ListAdapter, but clickable with SimpleAdapter

2009-05-25 Thread brian.schimmel

Just a small update, just in case some else has the same problem...

I finally found the source code at
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/widget/SimpleAdapter.java;hb=HEAD
(no idea why I did not find it before), and there is nothing inside
that should have an impact on the click behaviour.

So there muste be something wrong in my code.

On 13 Mai, 20:24, brian.schim...@googlemail.com
brian.schim...@googlemail.com wrote:
 Hi,

 I was populating a list with a SimpleAdapter like this:

 final ListMapString, String data = someObject.getData();
 SimpleAdapter dataAdapter = new SimpleAdapter
                         (this, data, R.layout.listline, from, to);
 listView.setAdapter(dataAdapter);
 listView.setOnItemClickListener(...);

 The listView gets this from the layout.xml:
 android:choiceMode=singleChoice android:clickable=true

 R.layout.listline defines a layout for each line, having 4 TextViews
 and some more widgets. Everything works fine so far.

 But now I need to use a ListAdapter to populate my list. It was easy
 to write a class that implements all those methods required by that
 interface, and the resulting List looks exactly the same now. It
 performs well on scrolling, changing data, etc. but the lines are not
 clickable any more. My onItemClickListener.onClick is never called,
 not matter where I tap on my list line (e.g. on one of the TextViews
 or on the background of that line). In my implementation, I use
 View.inflate to inflate excactly the same xml as the SimpleAdapter
 did.

 Shouldn't the click behaviour of a list be independant of where data
 comes from?

 I guess SimpleAdapter does some internal magic that I'd need to
 perform in my own implementation as well, to make the line clickable.
 Can somebody point out what I'm missing? I'd also like to look at the
 source code of SimpleAdapter, but I coudn't find it anywhere 
 onhttp://android.git.kernel.org/- maybe I'm just to dumb to look in the
 right place. Can somebody point me to that code? (possibly without
 forcing me to install git and download the whole code base)

 thanks,
 Brian
--~--~-~--~~~---~--~~
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: already set uses-sdk but market won't accept

2009-05-20 Thread brian.schimmel

I had similar issues, read all that stuff about positioning it
correctly in the XML, and did not work either. Then I upgraded to the
newest SDK 1.5_r1 and everything worked.

On 7 Mai, 06:05, anuraguni...@yahoo.com anuraguni...@yahoo.com
wrote:
 ok i will try putting right under manifest
 but that is non-sense, why should order of nodes matter in manifest
 and official doc doesn't say anything abt it?
 Any one from android-dev listening??

 On May 7, 2:36 am, Mariano Kamp mariano.k...@gmail.com wrote:

  You need to put it in the right place.
  More info here:http://lmgtfy.com/?q=minSdkVersion

  On Wed, May 6, 2009 at 2:31 PM, anuraguni...@yahoo.com 

  anuraguni...@yahoo.com wrote:

   i have already set minSdkVersion in mymanifest xml.
   here is the appt dump
   E: manifest (line=2)
      A: android:versionCode(0x0101021b)=(type 0x10)0x2
      A: android:versionName(0x0101021c)=1.1.0 (Raw: 1.1.0)
      A: package=com.askagent.webcritic (Raw:
   com.askagent.webcritic)
      E: application (line=4)
        A: android:label(0x01010001)=...@0x7f040001
        A: android:icon(0x01010002)=...@0x7f020001
        E: activity (line=5)
          A: android:label(0x01010001)=...@0x7f040001
          A: android:name(0x01010003)=.WebCritic (Raw: .WebCritic)
          E: intent-filter (line=7)
            E: action (line=8)
              A: android:name(0x01010003)
   =android.intent.action.MAIN (Raw: android.intent.action.MAIN)
            E: category (line=9)
              A: android:name(0x01010003)
   =android.intent.category.LAUNCHER (Raw:
   android.intent.category.LAUNCHER)
      E: uses-permission (line=14)
        A: android:name(0x01010003)=android.permission.INTERNET (Raw:
   android.permission.INTERNET)
      E: uses-sdk (line=15)
        A: android:minSdkVersion(0x0101020c)=(type 0x10)0x1

   so whymarketsays
   Marketrequires the minSdkVersion to be set in AndroidManifest.xml.
   The server could not process your apk. Try again.


--~--~-~--~~~---~--~~
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: youtube on android

2009-05-20 Thread brian.schimmel

Hi Ebin,
my reply is a bit late, but maybe it helps you.

While Youtube uses a flash player on the web to play its videos, the
video itself is encoded with some codec. To play it back in an
application, you would not need full flash support (with all that SWF-
Vectorgraphics-Actionscript stuff) but you would need to get the raw
video data, and then some code that plays back this video. Flash would
not be involed in any way then.

There are Firefoxplugins and other desktop software which allow to
save/download videos from youtube. Not sure if this is allowed by law
and by the youtube agreements, but it shows that access to the raw
video is possible. Maybe you can do some research in this direction...

- Brian

On 8 Mai, 06:55, ebin jose ebinjose...@gmail.com wrote:
 Hi Brian,

 Thanks for the reply.
 But I think I didn't make myself clear.

 We are developing a portable media player using android.
 we wanted to add youtube playback capability also.
 So i thought of adding new application which can access and playback youtube
 content.
 I couldn't see any application available in androd market.
 I heard about flash player port news (from adobe). I guess that code is not
 released yet.

 I was checking if there is an alternative way to playbackyoutubevideo's on
 android ?
 Is there an application that supports flash content playback on

  android already (though I couldn't find any on android market or
  related sites) or any development work is underway ?

 Thanks,
 Ebin.

 On Thu, May 7, 2009 at 6:28 PM, brian.schimmel 

 brian.schim...@googlemail.com wrote:

  Hi Ebin,

  this is actually very easy. Real phones (developer and user phones)
  come with a preinstalled youtube application that performs very well.
  On the emulator, it is not present as far as I remember.

  If you want to lauch youtube from within your application, maybe this
  thread helps you:
 http://groups.google.com/group/android-developers/browse_thread/threa...

  On 4 Mai, 06:51, ebinjose...@gmail.com ebinjose...@gmail.com
  wrote:
   Hi All,

   I want to playbackyoutubevideos on android. I came to know (from the
   below mentioned link) that adobe demostrated flash player for android,
   but they haven't released the code yet.

  http://www.androidauthority.com/index.php/2008/11/17/flash-player-on-...

   Is there an alternative way to playbackyoutubevideo's on android ?
   Is there an application that supports flash content playback on
   android already (though I couldn't find any on android market or
   related sites) or any development work is underway ?

   Thanks in advance,

   Ebin.


--~--~-~--~~~---~--~~
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: youtube on android

2009-05-07 Thread brian.schimmel

Hi Ebin,

this is actually very easy. Real phones (developer and user phones)
come with a preinstalled youtube application that performs very well.
On the emulator, it is not present as far as I remember.

If you want to lauch youtube from within your application, maybe this
thread helps you: 
http://groups.google.com/group/android-developers/browse_thread/thread/27f9cc80512a52cd/29a524182b4f3c8d

On 4 Mai, 06:51, ebinjose...@gmail.com ebinjose...@gmail.com
wrote:
 Hi All,

 I want to playbackyoutubevideos on android. I came to know (from the
 below mentioned link) that adobe demostrated flash player for android,
 but they haven't released the code yet.

 http://www.androidauthority.com/index.php/2008/11/17/flash-player-on-...

 Is there an alternative way to playbackyoutubevideo's on android ?
 Is there an application that supports flash content playback on
 android already (though I couldn't find any on android market or
 related sites) or any development work is underway ?

 Thanks in advance,

 Ebin.
--~--~-~--~~~---~--~~
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: API to delete SIM contacts Messages AND erasing the SD card contents

2009-04-29 Thread brian.schimmel

Hi Surendra,

as far as I know, access to the SIM data is restricted to applications
which are signed by the same entity that signed the system image. That
is, you either have to be Google/the Open Handset Alliance, or you
have to build a custom system image. Then users of your sofware would
have to flash their firmware with yours. If you plan to publish your
app to end-users, that's not an option, because they cannot flash
their firmware with yours.

If you application definitely needs access to the SIM, you could join
the community and provide some effort so that the SIM-API will be
opend in one of the upcoming Versions (like 1.6) of android. I got the
same advice when I asked for the same feature, but sadly I and my
company currently have no spare resources to do that.

The data on the SD-card is secured by the file system permissions, and
your app will never have the permissions to delete the files that
other apps created. For card formatting, there might be some API, but
I guess the same restrictions as for SIM access apply here. But while
accessing the SIM is a rather common need, which might show up in a
public API in future (at least I hope so, I don't have any information
on that), I guess this will never happen for SD-Card-formating.

best regards,
Brian Schimmel

On 20 Apr., 07:22, tsreddy surendraredd...@gmail.com wrote:
 Hi Android Engineers/framework Engineers, please answer my questions.
 It is very important for me to finisg my application.
 Your help will be higly appriciated.

 Regards
 Surendra

 On Apr 16, 5:02 pm, Surendra Reddy T surendraredd...@gmail.com
 wrote:

  Hi,

  Is there any API which can delete thecontactsand messages on the SIM card?
  And the API to format (erase all) the SD card ?

  IF not, please suggest me a way to delete all on SIM and SD card. Any help
  will be appriciated.
  Is there anyway to access lower level (driver lever) APIs exposed in C/C++?

  Regards
  Surendra


--~--~-~--~~~---~--~~
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 browse deeper into /data/data/package/app_somename/somedir

2009-04-23 Thread brian.schimmel

Hi,

I think I found two answers to my own question:

1. The files and directories I wanted to see start with a dot (.)
which are hidden by default on linux. Using adb shell, I can use ls -
a to see them. Anyway, I can not see them in DDMS and I cannot find a
setting to change that. I think I will file a bug report for that.
2. I've managed to write a simple directory browser activity in 67
lines of code. Only this way I found out that the files started with a
dot. I anyone's interested, I can post that code, too.

On 17 Apr., 20:29, Dianne Hackborn hack...@android.com wrote:
 Unfortunately you can only do this if running as root or the uid of the app
 that owns the data.  On a production G1 you can not do this from adb.

 On Fri, Apr 17, 2009 at 10:18 AM, brian.schimmel 



 brian.schim...@googlemail.com wrote:

  I have to make some additions to what I said before:

  1. There are some typos in the folder names in my post. They are only
  in that post and are definitely not the cause of my problems.

  2. Though there is a small chance that my folder /data/data/package/
  app_mycustomname/mysubdirectory was indeed empty, but I cannot look
  into any of the application folders. I think this is a permission
  related problem, but I thought the usage of MODE_WORLD_WRITEABLE would
  solve this. I have no good understanding of what linux permissions
  mean, but drwxrwxrwx seems to me as if every user has every possible
  permission on that dir. Because I cannot see the files and
  subdirectories there in, I cannot tell if they are present and if they
  have the right permissions.

  If there is really a permission problem, I think I could get arround
  it if I rooted my phone. Do you think this would help? All the how-
  to's that I found so far were written for consumer devices, do they
  work an a ADP1 too?

  On Apr 17, 3:33 pm, brian.schim...@googlemail.com
  brian.schim...@googlemail.com wrote:
   Hi,

   my app is creating a directory by using

   File thisDir = getDir(mycustomname, Context.MODE_WORLD_WRITEABLE);

   It is stored at
   /data/data/package/app_mycustomname/

   I can browse that directory with DDMS or with 'adb shell', of course,
   it is empty. My App then creates some subdirectories there, and those
   have subdirectories too, and so on, and creates files in several of
   those. My app can read all those dirs and files, too.

   Sometimes I have to take a look at this directory tree, but I cannot
   browse deep into that tree, neither using DDMS (both inside Eclipse
   and standalone) nor using the shell. I can see that there is a
   directory called /data/data/package/app_mycustomname/mysubdirectory
   and I can even 'cd' into this directory. But when I do a 'ls' there,
   the directory is reported to be empty, though I'm sure there must be
   something inside.

   app_mycoustomname has the permissions drwxrwx-wx
   app_mycoustomname/mysubdirectory has the permissions drwxrwxrwx

   I have the same issue on the emulator and on the ADP1, both running a
   1.1 firmware.

 --
 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: Flash Buttons

2009-04-17 Thread brian.schimmel

Currently this is not possible.

Even when flash will be supported in the future, I think you can use
flash in websites and maybe as standalone-applications. I don't think
you will ever be able to use flash buttons inside an android app. I
don't see why you would want to do this, neither.

On Apr 17, 12:21 pm, Suman ipeg.stud...@gmail.com wrote:
 Hello all

                        Thanks for the greate replies once again. Now
 can  any one tell me like can i use flash buttons in android
 application? I mean swf format. If the answer yes kindly tell me how.
 Asbecause i have tried this normaly. But it was not working. So please
 response me. Thanks in advance.

 Suman .
--~--~-~--~~~---~--~~
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 browse deeper into /data/data/package/app_somename/somedir

2009-04-17 Thread brian.schimmel

I have to make some additions to what I said before:

1. There are some typos in the folder names in my post. They are only
in that post and are definitely not the cause of my problems.

2. Though there is a small chance that my folder /data/data/package/
app_mycustomname/mysubdirectory was indeed empty, but I cannot look
into any of the application folders. I think this is a permission
related problem, but I thought the usage of MODE_WORLD_WRITEABLE would
solve this. I have no good understanding of what linux permissions
mean, but drwxrwxrwx seems to me as if every user has every possible
permission on that dir. Because I cannot see the files and
subdirectories there in, I cannot tell if they are present and if they
have the right permissions.

If there is really a permission problem, I think I could get arround
it if I rooted my phone. Do you think this would help? All the how-
to's that I found so far were written for consumer devices, do they
work an a ADP1 too?

On Apr 17, 3:33 pm, brian.schim...@googlemail.com
brian.schim...@googlemail.com wrote:
 Hi,

 my app is creating a directory by using

 File thisDir = getDir(mycustomname, Context.MODE_WORLD_WRITEABLE);

 It is stored at
 /data/data/package/app_mycustomname/

 I can browse that directory with DDMS or with 'adb shell', of course,
 it is empty. My App then creates some subdirectories there, and those
 have subdirectories too, and so on, and creates files in several of
 those. My app can read all those dirs and files, too.

 Sometimes I have to take a look at this directory tree, but I cannot
 browse deep into that tree, neither using DDMS (both inside Eclipse
 and standalone) nor using the shell. I can see that there is a
 directory called /data/data/package/app_mycustomname/mysubdirectory
 and I can even 'cd' into this directory. But when I do a 'ls' there,
 the directory is reported to be empty, though I'm sure there must be
 something inside.

 app_mycoustomname has the permissions drwxrwx-wx
 app_mycoustomname/mysubdirectory has the permissions drwxrwxrwx

 I have the same issue on the emulator and on the ADP1, both running a
 1.1 firmware.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---