[android-developers] need help on "--core-library"

2009-03-17 Thread DaRolla

hello,

I need to build a java.beans.PropertyChangeListener which is part of
JDK (rt.jar) but not part of Dalvik.

Trying to copy the sources to my Application I get this:

Attempt to include a core VM class in something other than a core
library.
It is likely that you have attempted to include the core library from
a desktop
virtual machine into an application, which will most assuredly not
work. If
you really intend to build a core library -- which is only appropriate
as
part of creating a full virtual machine binary, as opposed to
compiling an
application -- then use the "--core-library" option to suppress this
error
message. If you go ahead and use "--core-library" but are in fact
building
an application, then please be aware that your build will still fail
at some
point; you will simply be denied the pleasure of reading this helpful
error
message.

My solution:
1) build a core library with consisting out of
java.beans.PropertyChangeListener
2) integrate that library (jar?) into my application.

My question:
- how can I build a core library using eclipse?

greetings,
darolla
--~--~-~--~~~---~--~~
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: Hosting APKs files on site works for emulator, but not device?

2009-03-17 Thread Jean-Baptiste Queru

It'd be great if you could leave a note about your findings at
http://code.google.com/p/android/issues/detail?id=1085

Thanks,
JBQ

On Tue, Mar 17, 2009 at 8:13 AM, EboMike  wrote:
>
> I tried it again this morning and it works now. I guess T-Mobile keeps
> a cached file for 24 hours or so.
>
> At this point, I'm positive that the problem lies with T-Mobile: a) it
> works from within the emulator, b) I don't see a hit in the accesslog
> when I try to download it, c) it works after 24 hours.
>
> One thing I didn't try when the file was busted was to simply rename
> it or to add something like ?x=y at the end of the URL when
> downloading it. That should have solved it too.
>
> -Mike
>
>
> On Mar 17, 5:49 am, Jean-Baptiste Queru  wrote:
>> There is a transparent proxy on T-Mobile's port 80, which works at the
>> IP level (so it doesn't need to be explicitly configured at the HTTP
>> level, but also can't be bypassed).
>>
>> Does your apk download over wifi? Can you try serving it from a port
>> other than 80?
>>
>> There's an open 
>> issuehttp://code.google.com/p/android/issues/detail?id=1085about
>> situations where small apks (less than 64kB) sometimes cause problems,
>> though we've never been able to quite get to the bottom of it.
>>
>> JBQ
>>
>>
>>
>> On Tue, Mar 17, 2009 at 1:36 AM, Al Sutton  wrote:
>>
>> > If you want to send me a link off list I'll see what I can find.
>>
>> > Al.
>>
>> > Michael Krehan wrote:
>>
>> >> Al, thanks for the reply. It's on my own server (a Linux-based Apache
>> >> server), and it's a simple A HREF that goes straight to the file in
>> >> the same directory. No redirection or anything.
>>
>> >> I tried it on an ADP1 and a G1, both on the T-Mobile network, and it
>> >> didn't work. The emulator worked fine. The symptoms point to a proxy.
>>
>> >> On Mar 17, 2009 12:42 AM, "Al Sutton" > >> > wrote:
>>
>> >> Does the URL you're downloading from use a redirect or something
>> >> similar
>> >> to get to the apk?
>>
>> >> Many free file hosting or website hosting packages use a loading page
>> >> and some type of redirect (a Meta refresh tag being one example), and
>> >> there have been problems with those on the device (see
>> >>
>> >> http://groups.google.com/group/android-developers/browse_thread/threa...
>> >> for one example).
>>
>> >> Al.
>>
>> >> EboMike wrote: > I'm currently hosting an app on my own server so
>> >> my beta testers can > test it. I'...
>>
>> >> --
>>
>> >> * Written an Android App? - List it athttp://andappstore.com/*
>>
>> >> ==
>> >> Funky Android Limited is registered in England & Wales with the
>> >> company number  6741909. The registered head office is Kemp House,
>> >> 152-160 City Road, London,  EC1V 2NX, UK.
>>
>> >> The views expressed in this email are those of the author and not
>> >> necessarily those of Funky Android Limited, it's associates, or it's
>> >> subsidiaries.
>>
>> > --
>>
>> > * Written an Android App? - List it athttp://andappstore.com/*
>>
>> > ==
>> > Funky Android Limited is registered in England & Wales with the
>> > company number  6741909. The registered head office is Kemp House,
>> > 152-160 City Road, London,  EC1V 2NX, UK.
>>
>> > The views expressed in this email are those of the author and not
>> > necessarily those of Funky Android Limited, it's associates, or it's
>> > subsidiaries.
>>
>> --
>> Jean-Baptiste M. "JBQ" Queru
>> Android Engineer, Google.
>>
>> Questions sent directly to me that have no reason for being private
>> will likely get ignored or forwarded to a public forum with no further
>> warning.
> >
>



-- 
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

--~--~-~--~~~---~--~~
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: Hosting APKs files on site works for emulator, but not device?

2009-03-17 Thread EboMike

I tried it again this morning and it works now. I guess T-Mobile keeps
a cached file for 24 hours or so.

At this point, I'm positive that the problem lies with T-Mobile: a) it
works from within the emulator, b) I don't see a hit in the accesslog
when I try to download it, c) it works after 24 hours.

One thing I didn't try when the file was busted was to simply rename
it or to add something like ?x=y at the end of the URL when
downloading it. That should have solved it too.

-Mike


On Mar 17, 5:49 am, Jean-Baptiste Queru  wrote:
> There is a transparent proxy on T-Mobile's port 80, which works at the
> IP level (so it doesn't need to be explicitly configured at the HTTP
> level, but also can't be bypassed).
>
> Does your apk download over wifi? Can you try serving it from a port
> other than 80?
>
> There's an open 
> issuehttp://code.google.com/p/android/issues/detail?id=1085about
> situations where small apks (less than 64kB) sometimes cause problems,
> though we've never been able to quite get to the bottom of it.
>
> JBQ
>
>
>
> On Tue, Mar 17, 2009 at 1:36 AM, Al Sutton  wrote:
>
> > If you want to send me a link off list I'll see what I can find.
>
> > Al.
>
> > Michael Krehan wrote:
>
> >> Al, thanks for the reply. It's on my own server (a Linux-based Apache
> >> server), and it's a simple A HREF that goes straight to the file in
> >> the same directory. No redirection or anything.
>
> >> I tried it on an ADP1 and a G1, both on the T-Mobile network, and it
> >> didn't work. The emulator worked fine. The symptoms point to a proxy.
>
> >>     On Mar 17, 2009 12:42 AM, "Al Sutton"  >>     > wrote:
>
> >>     Does the URL you're downloading from use a redirect or something
> >>     similar
> >>     to get to the apk?
>
> >>     Many free file hosting or website hosting packages use a loading page
> >>     and some type of redirect (a Meta refresh tag being one example), and
> >>     there have been problems with those on the device (see
> >>    http://groups.google.com/group/android-developers/browse_thread/threa...
> >>     for one example).
>
> >>     Al.
>
> >>     EboMike wrote: > I'm currently hosting an app on my own server so
> >>     my beta testers can > test it. I'...
>
> >>     --
>
> >>     * Written an Android App? - List it athttp://andappstore.com/*
>
> >>     ==
> >>     Funky Android Limited is registered in England & Wales with the
> >>     company number  6741909. The registered head office is Kemp House,
> >>     152-160 City Road, London,  EC1V 2NX, UK.
>
> >>     The views expressed in this email are those of the author and not
> >>     necessarily those of Funky Android Limited, it's associates, or it's
> >>     subsidiaries.
>
> > --
>
> > * Written an Android App? - List it athttp://andappstore.com/*
>
> > ==
> > Funky Android Limited is registered in England & Wales with the
> > company number  6741909. The registered head office is Kemp House,
> > 152-160 City Road, London,  EC1V 2NX, UK.
>
> > The views expressed in this email are those of the author and not
> > necessarily those of Funky Android Limited, it's associates, or it's
> > subsidiaries.
>
> --
> Jean-Baptiste M. "JBQ" Queru
> Android Engineer, Google.
>
> Questions sent directly to me that have no reason for being private
> will likely get ignored or forwarded to a public forum with no further
> warning.
--~--~-~--~~~---~--~~
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: Paid applications and market feedback/rating

2009-03-17 Thread StefanK

There is probably a possibility to still keep the ratings if you leave
the app free, let it expire (or go to a limited functionality after a
several days or so). If users want to get it back to full features -
they have to buy an unlock key. The unlock key is nothing more than a
paid application that has no functionality. Your free application will
just have to check if the paid is installed and unlock itself.

This approach (if possible) has lots of advantages:

1. You can keep the ratings from the free app
2. You support only one app (not free and paid).
3. You can give your users potentially longer trial than the 24 hours
Google allows.
4. No need to port settings from the free to the paid one.
5. You potentially avoid issues with crashes caused by copy protection
as you will copy protect only the paid app that has not real
functionality,

This is a bit unconventional approach, but it may work.


On Mar 16, 7:44 pm, Keith Wiley  wrote:
> I don't *think* that's possible.  Assuming the signature/package is
> tied to the market app, there is no way to convert a previously free
> app to a paid app.  A brand new app must be installed instead, if I've
> understood thing so far.  I think a new app must have a new package
> and an old app can't be changed from free to paid.
>
> Can anyone clarify or straighten this out for us?
>
> On Mar 16, 4:26 pm, sm1  wrote:
>
> > I'm not 100% sure but if my understanding of how Android Market works
> > is correct, what you may want to do is keep the same package (aka.
> > signature) for your paid app as the package that you had before, with
> > the comments and ratings, and make a *new* package for the free app.,
> > and the new free app will start at zero comments and zero ratings, but
> > you could write about that in it's description, i.e., "previous
> > version had a rating of x stars."
>
> > and you could verify it by posting on this forum:
>
> >http://www.google.com/support/forum/p/Android+Market
>
> > Let us know what you find.
> > cheers,
> > good luck with your app.
>
> > On Mar 16, 11:02 am, Keith Wiley  wrote:
>
> > > I have had a free version of my app available for several months.
> > > With the new features I am about to release in the latest version, and
> > > with paid apps now possible, I intend to split the app into a free
> > > lite/trial version and a paid full version.  I am aware that I must
> > > create a new app with a new signature for the full version b/c I can't
> > > change the current free app to a paid one.  I don't mind this, but, is
> > > there any way I can transfer the thousands of feedback and ratings I
> > > have accumulated so far to the paid version even though it will have a
> > > totally new signature?
>
> > > If there is no way to do this then, permit me to say, I am a little
> > > miffed.  :-/
>
> > > ...but I'm holding out hope that I missed this somewhere, that's it's
> > > possible.  Am I right?  I'm sorry if I missed the explanation for how
> > > to do this.
>
> > > Thank you very much.
>
> > > Cheers!
>
>
--~--~-~--~~~---~--~~
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 add SMS to inbox in android programmatically?

2009-03-17 Thread Kenny

Thanks for your update. So you exactly have done two things:
1. Call SmsManager::sendTextMessage( )
2. Put the sent SMS to its database via ContentResolver::insert( )

Kenny

On Mar 17, 6:42 am, Seer  wrote:
> i have been trying to do the same thing and just worked it out.  you
> want to do something similar to this.
> 
>
>    public static final String ADDRESS = "address";
>    public static final String PERSON = "person";
>         public static final String DATE = "date";
>         public static final String READ = "read";
>         public static final String STATUS = "status";
>         public static final String TYPE = "type";
>     public static final String BODY = "body";
>     public static final int MESSAGE_TYPE_INBOX = 1;
>     public static final int MESSAGE_TYPE_SENT = 2;
>
> ContentValues values = new ContentValues();
>            values.put(SMSHelper.ADDRESS, "+61408219690");
>            values.put(SMSHelper.DATE, "1237080365055");
>            values.put(SMSHelper.READ, 1);
>            values.put(SMSHelper.STATUS, -1);
>            values.put(SMSHelper.TYPE, 2);
>            values.put(SMSHelper.BODY, "SMS inserting test");
>                 Uri inserted = 
> getContentResolver().insert(Uri.parse("content://
> sms"), values);
>
> That is from a few different classes but i am sure you can work out
> how it fits.
>
> On Mar 13, 8:09 pm, senthil  wrote:
>
>
>
> > HI,
> > Iam sending the sms by using the below code,
> > SmsManager smsManager = SmsManager.getDefault();
> > smsManager.sendTextMessage(destAddr, null, mMessageText, il, null);
>
> > But, the same SMS message needs to be reflected in the Native sms
> > inbox,
> > Can anyone help me out in achieving this
>
> > Thanks in Advance !- 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: Intercepting outgoing sms

2009-03-17 Thread Kenny

I think check database seems not feasible. Seer, I posted a rely to
you about SMSDispatcher class. Take a look, there may be certain
intent sent there.

Kenny

On Mar 16, 9:44 pm, Kenny  wrote:
> Sms should have provider, through which you may put your SMS to
> database, I think.
>
> But the topic was about intercepting/redirecting being-sent SMS. Is it
> resolved?
>
> On Mar 16, 12:52 pm, Seer  wrote:
>
>
>
> > ok i have written an app for sending the sms over the web but how do i
> > insert the sms sent over the web into the list of sms sent from the
> > phone?
>
> > On Mar 6, 1:25 am, Avraham Serour  wrote:
>
> > > not sure if you can do that, if not you could do the opposite, make the 
> > > user
> > > send sms using you app, so if the number match your criteria you use your
> > > gateway, if not send it using the phone regular sms service
>
> > > On Thu, Mar 5, 2009 at 5:04 AM, Seer  wrote:
>
> > > > Hi,
> > > > What i want to do is intercept outgoing sms.  The reason been that i
> > > > want to redirect some sms over a web based sms sending service and
> > > > others to go over the normal mobile network.  I would really like to
> > > > do this as an invisible background process that does not need
> > > > modifications to any of the existing apps people use to send sms.
>
> > > > Is this possible or will i have to write my own app to send sms and
> > > > let that app decide how to send the sms?  with so many sms apps out
> > > > there i really did not want to add another to the mix and to instead
> > > > work on a lower level.
>
> > > > thanks
>
> > > > Chris- Hide quoted text -
>
> > - Show quoted text -- 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: android.os.ServiceManager

2009-03-17 Thread Kenny

Reading the file frameworks/base/telephony/java/com/android/internal/
telephony/gsm/SMSDispatcher.java, you can find handleSendComplete( )
has a PendingIntent to send. I don't understand PendingIntent well,
only seeing the LOG code saying "SMS send complete. Broadcasting
intent ..."

Is this sendIntent interceptable? Not sure if the
PendingIntent has extra data of SMS contents. Seer, let me know your
insight.

Kenny

On Mar 17, 12:54 pm, Seer  wrote:
> So if that is not the way you are meant to services such as alternate
> SMS gateways, what is?  Using intents will not work as most of the sms
> apps have the reply for a thread built in.  This is the only way i
> have been able to discover to capture all outgoing sms so i can either
> redirect them over the web or over the mobile network. I find it sort
> of strange that the developers of Android did not think that people
> would want to also use alternate networks and mediums to the gsm
> network for things like calls and sms.  With sms prices as high as
> they are in Australia the internet can be up to 5 times cheaper to
> send them and even with data costs that is still much cheaper.
>
> I know all apps are meant to be equal but some apps / services need to
> be able to do things on a much lower level or have intents or
> something for the lower level services of the phone as well.
>
> I am open to any ideas you have.
>
> On Mar 17, 3:31 pm, Dianne Hackborn  wrote:
>
>
>
> > You can't do this.  Especially from the SDK, on so many levels:
>
> > 1. ServiceManager is not public.  The features it contains are not available
> > in the SDK.
> > 2. None of the interfaces of the services published in the service manager
> > are published in the SDK, so you wouldn't be able to redefine them anyway.
> > 3. And even if any of this were in the SDK, applications are not allowed to
> > modify what is published in the service manager, and they never will be able
> > to.
>
> > On Mon, Mar 16, 2009 at 8:47 PM, Seer  wrote:
>
> > > Is there a way to access this class in the SDK or is there another
> > > class that does the same thing?  I need to rename one of the services
> > > listed in the servicemanager so that it will call my service instead
> > > and then pass calls i don't handle onto the original service that i
> > > have renamed.
>
> > --
> > 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.  All such questions should be posted on public
> > forums, where I and others can see and answer them.- 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: GridView ImageView and performance

2009-03-17 Thread Streets Of Boston

I had similar issues. I managed to fix the performance of the list-
view, but i ran into memory issues.

My app downloads images from Smugmug, images that are 'front-page'
images of galleries/albums.
First, my app needed to get the information about the album, to get
the image-id of the album's front-page image. This would result in a
URL and then my app downloads the image using this URL and then shows
it in a list-item.

I used the ExecutorService to fetch the necessary album information
and image-retrieval and image decoding in a limited number of
background threads.

In the list-adpater's getView method, i would tag (setTag) the list-
item view with the album-id and submit a new (cancelable) task using
the ExecutorService (java.util.concurrent packages). This task
downloads the album info and then downloads the image. While the album
information and the image were downloading, i showed a place-holder
picture in my list-item's imageview (a bitmap from the res/drawable
directory)

When the task that has been submitted finishes, it posts the result
back to the main-thread: Loop over the current list-view children
(which are the visible list-items). For each child get its tag
(getTag) and if this tag matched the task-result, i would set the
child's imageview's bitmap to the image i just downloaded.

This all worked quite well, with images downloading at their own pace
and the list-view kept performing well.
However, at some point i got memory errors when calling
ImageView.setImageBitmap(Bitmap). I checked my code. I made sure to
recycle not-used bitmaps, i did not cache bimtaps, etc., but i kept
getting memory errors (note that the smugmug images downloaded were
small: 100x100 pixels).

I was not able to solve these memory errors and i abandoned this idea.
Any ideas to prevent these memory errors? :-)

On Mar 17, 7:28 am, ifuller1  wrote:
> Thanks gesh - as suggested the problem was related to recycling.
> Preformance is pretty good now, sadly my images keep shuffling but
> given your recent input this should be easy to fix.
>
> On Mar 15, 10:03 pm, Gesh  wrote:
>
>
>
> > > I'm currently using the ImageAdapter from the Hello GridView sample.
> > > But loading the images from the web rather than using resources.
>
> > I think you need a better understanding of how adapters work to solve
> > your problem. The getView() method of your Adapter is inkoved every
> > time an image in your grid becomes visible (yes, including when you
> > scroll back and forth to previously visible images). So if you have
> > just replaced that one line image.setImageResource(int) with
> > image.setImageDrawable(Drawable.createFromStream()) it means you are
> > re-downloading images every time they get scrolled into view.
>
> > So you need to cache those downloaded images and while you are at it
> > make sure you cache scaled thumbnail of the image, just as big as you
> > need them to avoid the possible problem Romain suggested. Use
> > Bitmap.createScaledBitmap() - it's worked great for me.
>
> > Also be aware that the emulator is running on your PC using that same
> > network speed. If you want to test for real network problems you might
> > get on a real device try starting the emulator with limited network
> > (or on your G1 disable wireless and 3G). I alwasy run my emulator with
> > network speed and latency set to EDGE, or for some debugging purposes
> > even GPRS or GSM.
>
> > hope that helps you,
> > gesh.
>
> > On Mar 15, 7:22 am, ifuller1  wrote:
>
> > > Hi Gesh,
>
> > > Thanks for the response. I'll certainly give the bitmap factory a go.
> > > I'm currently using the ImageAdapter from the Hello GridView sample.
> > > But loading the images from the web rather than using resources. The
> > > problem is immediate, in that the performance doesn't degrade after re-
> > > visits to the activity, but is instead directly proportional to the
> > > number of images I'm displaying.
>
> > > As well as trying the bitmap factory can I ask what you think is the
> > > best way to encourage garbage collection? Will nulling my objects be a
> > > big help.
>
> > > Once I have it optimized I'm going to release it for free... I think
> > > there's a big hole in androids picasa support.
>
> > > Ian
>
> > > On Mar 14, 11:38 pm, Gesh  wrote:
>
> > > > hi,
>
> > > > I have written 2 connected apps with some image content pulled from
> > > > the web and must say if you handle your resources right it shouldn't
> > > > be a problem at all.
>
> > > > Do you use your own Adapter for theGridViewor do you use some of the
> > > > already available ones in the SDK? If you use your own you should keep
> > > > in mind that when you deal with AdapterViews in general they keep
> > > > references to Views you create in your adapter and recycle them, so
> > > > try to reuse the convertView reference you get in the Adapter.getView
> > > > (int position, View convertView, ViewGroup parent) method.
>
> > > > And although memory leaks are difficult to achieve 

[android-developers] OnDraw in Listview

2009-03-17 Thread vovkab

Hello

I made my own widget by extended listview.
How to draw over list?

When i draw in Overridden OnDraw method it's showing behind the list
items, but i need to draw over.
--~--~-~--~~~---~--~~
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: Bitmap Memory

2009-03-17 Thread bra...@gmail.com

Well Im sorry - but this is a memory leak. Watching the core its
obvious that the actual memory is being freed but when an attempt is
made to use that memory the vm buffer still thinks the memory is in
use. I have to say this is probably one of the worst bugs I have come
across and it should be addressed rapidly. In a phone where visuals
are everything to have such a HUGE problem with handling them is a
real PITA.

On Mar 1, 1:57 am, "bra...@gmail.com"  wrote:
> Best darn suggestion yet. Thankyou I was wondering if I could use that
> setting, but feared that perhaps I would not be able to generate new
> bitmaps from the original - you can - thankyou
>
> On Feb 27, 1:19 pm, Alexey Krasnoriadtsev 
> wrote:
>
> > There best working approach is to only load Bounds of the image, and
> > then use scale to load the Bitmap of the needed size.
> > This way you never load the full-size bitmap in the memory.
>
> >http://code.google.com/intl/ja/android/reference/android/graphics/Bit...
>
> > get the bounds, and then use those to calculate the appropriate sample
> > size.
>
> > On Feb 26, 2:36 pm, mark.ka...@gmail.com wrote:
>
> > >   I'm just saying there have been a number of threads on this issue,
> > > I've had out of memory problems when processing bitmaps, and so have
> > > many other developers. It looks to me like a bug IMHO. I hope this
> > > problem will be resolved at some point.
>
> > > On Feb 26, 2:02 pm, "bra...@gmail.com"  wrote:
>
> > > > If that is the case then why does calling myBitmap.recycle not give me
> > > > that memory back to use for the next time I go into an edit.
>
> > > > On Feb 26, 4:59 pm, Romain Guy  wrote:
>
> > > > > BitmapFactory does NOT leak Bitmaps.
>
> > > > > A 2056x1536 opaque image requires 6 MB of RAM. An application has 16
> > > > > MB max. Do the math.
>
> > > > > On Thu, Feb 26, 2009 at 1:50 PM,   wrote:
>
> > > > > >  Are you using BitmapFactory? There have been a number of threads
> > > > > > about memory leaks, or similar problems when using BitmapFactory to
> > > > > > process bitmaps. Using Bitmap.recycle may mitigate, but not 
> > > > > > eliminate
> > > > > > these types of problems.
>
> > > > > >                 M
>
> > > > > > On Feb 26, 11:39 am, Mattaku Betsujin 
> > > > > > wrote:
> > > > > >> I think the best solution to handle very large bitmaps is to be 
> > > > > >> able to
> > > > > >> decode only a small chunk of the bitmap at a time and process it.
>
> > > > > >> Does anyone know if the existing Android API can support this?
>
> > > > > >> If not, probably one solution is to write a smart decoder (in 
> > > > > >> Java, so slow
> > > > > >> :-( )  that can decode a small chunk.
>
> > > > > >> On Thu, Feb 26, 2009 at 11:32 AM, Tomei Ningen 
> > > > > >> wrote:
>
> > > > > >> > You're running into memory fragmentation problems. Bitmap memory 
> > > > > >> > is
> > > > > >> > not allocated from the Java object heap. Instead, it's allocated 
> > > > > >> > from
> > > > > >> > the 'malloc' heap. That's why you don't see the Java heap 
> > > > > >> > expanding.
>
> > > > > >> > How big is your bitmap? If you're processing JPEG files, 
> > > > > >> > probably it
> > > > > >> > will be better to read the thumbnail directly from the JPEG 
> > > > > >> > file. This
> > > > > >> > way you don't need to create the Bitmap at all.
>
> > > > > >> > On Feb 26, 9:47 am, "bra...@gmail.com"  
> > > > > >> > wrote:
> > > > > >> > > Ok I am at the end of my rope.
>
> > > > > >> > > I am doing some image processing. I have a large image file 
> > > > > >> > > which I
> > > > > >> > > open and create a smaller bitmap from. At the end of 
> > > > > >> > > processing I call
> > > > > >> > > recycle on everything. I null everything. I run GC manually.
>
> > > > > >> > > I then try edit another image and I get an out of VM memory 
> > > > > >> > > error.
> > > > > >> > > Bitmap exceeds etc etc.
>
> > > > > >> > > I am looking at the heap and the secone edit doesnt seem to 
> > > > > >> > > cause it
> > > > > >> > > to increase at all.
>
> > > > > >> > > What else can I do. Surely google cannot possibly be 
> > > > > >> > > suggesting that
> > > > > >> > > we can open one large bitmap per session and thats it?- Hide 
> > > > > >> > > quoted text -
>
> > > > > >> - Show quoted text -
>
> > > > > --
> > > > > 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- 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...@go

[android-developers] Understand Broadcast and Intent with Dalvik process

2009-03-17 Thread Kenny Yu

Does anyone know if sendBroadcast(intentA) will bring intents to all
Dalvik processes?

For example, process android.process.acore behaves sendBroadcast(new
intentA). Will the intentA be received in com.android.camera? We think
android.process.acore and com.android.camera are zygoted to two Dalvik
VMs (Linux processes).

Same question to sendIntent(intentB). In terms of docs, sendIntent( )
can address certain class to receive the intent. Is this behavior
across processes?

Kenny
--~--~-~--~~~---~--~~
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 the use same instances when launching application twice ?

2009-03-17 Thread dillirao malipeddi
when you create a new intent
set flag as

your_intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);

 startActivity(your_intent);



On Tue, Mar 17, 2009 at 2:56 PM, Derek  wrote:

>
> Hi,
>
> Is it possible to re-use all the instances of Activities and Services
> when an application is launched twice. For instance:
> 1/ I start my application APP1. Some activities are launched and a
> service is started.
> 2/ I click "Home" device button
> 3/ I can see the icon the launch again my application APP1
> 4/ I click on it and the APP1 is launched twice
>
> I would like to re-use the existing the instances of Activities and
> Services from the first launch.
> I guess it is related to "SingleTop" or "SingleTask" but it doesn't
> seem to work.
>
> Any suggestion ?
>
> >
>


-- 
Dilli Rao. M

--~--~-~--~~~---~--~~
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: jarsigner jar sign apk update

2009-03-17 Thread dillirao malipeddi
when you want to update application in the device it checks for the previous
key info with modifications.
it wont allow you to sign same application with different signs

if you want to use different keys you must change your package name of your
application
then it wont give error. otherwise it will give the error

because it store installed application details in the system folder as xml
file

when you want to update an application it will check with previous one with
same package

On Tue, Mar 17, 2009 at 6:17 PM, Maxence Warzecha  wrote:

>
> Hi all,
>
> This is what I did :
>
> - I signed my apk.
> - I published my apk.
> - I updated my application.
> - I sign my new apk file succesfully (**with an other keystore**).
> - I upload my new apk.
> - When poeple what to install updated version, they receive message
> look like "apk file was not signed correctly". If they uninstall
> previous version, they are able to install new version (piouf...).
>
> I don't understand why.
>
> Can you tell me if need to keep my previous keystore *OR* with similar
> information? Or ...?
>
> Thank you!
> Max
> >
>


-- 
Dilli Rao. M

--~--~-~--~~~---~--~~
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: Thumbnails

2009-03-17 Thread Gaurav

One point is still left, can we have duplicate thumbnails of same
kind. Say I have an Image, can there be two thumbnails of micro kind
of the same image? - No, right?

On Mar 17, 4:52 am, Dave Sparks  wrote:
> We have a number of issues with metadata that need to be sorted out.
> Unfortunately, it will have to wait until the next major release.
>
> Unless I'm mistaken, micro-thumbnails are generated by the music
> player for album art. This is just an optimization to improve list
> flinging operations in the music browser.
>
> On Mar 16, 1:20 pm, todd  wrote:
>
> > Having the camera app create thumbs when a photo is taken is great,
> > but another common scenario has been left unanswered. What happens
> > when the user inserts (or copies) images to the SD card?
>
> > I've found that unless the Pictures app is run, no thumbs have been
> > generated for the images on the SD card and I have to add the thumbs
> > myself in order to display thumbnail images.
>
> > Additionally, the gallery/camera apps only create the mini version of
> > the thumbnail and not the micro version. It would be great to have a
> > clear, consistent policy for thumbnail generation of images that
> > reside on the SD card. I can foresee apps battling over thumb
> > creation, some doing it well, others not so well and using different
> > (custom?) sizes for both sizes.
>
> > That's my two cents.
>
> > Todd
>
>
--~--~-~--~~~---~--~~
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: R.id.icon missing?

2009-03-17 Thread Fred Grott(shareme)

never mind, needed to add android. prefix

On Mar 17, 8:23 am, "Fred Grott(shareme)" 
wrote:
> I have a problem..
>
> Frist my envir0onment:
> -Ubuntu 8.10
> -Eclipse 3.4.2/ADt 0.8
> android SDk 1.1.r1
>
> R.id.icon reference i snto showing upo..
>
> my R java file shows:
>
>  public static final class id {
>         public static final int all_apps=0x7f050006;
>         public static final int faves_and_recents=0x7f050007;
>         public static final int gallery=0x7f050005;
>         public static final int horizontal=0x7f05;
>         public static final int label=0x7f050004;
>         public static final int show_all_apps=0x7f050002;
>         public static final int show_all_apps_check=0x7f050003;
>         public static final int vertical=0x7f050001;
>     }
>
> Was implementing ViewHoldr/Wrapper classes when I noticed it..
>
> As you can see label show up fine
--~--~-~--~~~---~--~~
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] R.id.icon missing?

2009-03-17 Thread Fred Grott(shareme)

I have a problem..

Frist my envir0onment:
-Ubuntu 8.10
-Eclipse 3.4.2/ADt 0.8
android SDk 1.1.r1

R.id.icon reference i snto showing upo..

my R java file shows:

 public static final class id {
public static final int all_apps=0x7f050006;
public static final int faves_and_recents=0x7f050007;
public static final int gallery=0x7f050005;
public static final int horizontal=0x7f05;
public static final int label=0x7f050004;
public static final int show_all_apps=0x7f050002;
public static final int show_all_apps_check=0x7f050003;
public static final int vertical=0x7f050001;
}

Was implementing ViewHoldr/Wrapper classes when I noticed it..

As you can see label show up fine
--~--~-~--~~~---~--~~
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] I need to use jbossall-client.jar

2009-03-17 Thread DaRolla

hello,

I need to use some jars inside android. well, most of them work. It
seems that the standard java compiled jars are decompiled and compiled
into dalvik format (for example Log4J.jar).

The only jar that makes troubles is jbossall-client.jar.

Eclipse console says:

Attempt to include a core VM class in something other than a core
library.
It is likely that you have attempted to include the core library from
a desktop
virtual machine into an application, which will most assuredly not
work. If
you really intend to build a core library -- which is only appropriate
as
part of creating a full virtual machine binary, as opposed to
compiling an
application -- then use the "--core-library" option to suppress this
error
message. If you go ahead and use "--core-library" but are in fact
building
an application, then please be aware that your build will still fail
at some
point; you will simply be denied the pleasure of reading this helpful
error
message.

So I tried to remove the javax package from the jar.

Now Eclipse console says:

Conversion to Dalvik format failed: Unable to execute dex: null

:(

Who can help me on this?

Greetings,
DaRolla

--~--~-~--~~~---~--~~
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: jarsigner jar sign apk update

2009-03-17 Thread Maxence Warzecha

Hi XD!

Ok I understand. I will be aware about that.


On 17 mar, 13:51, Stoyan Damov  wrote:
> Of course you should sign your updated app with the same keystore,
> think about it - if this wasn't the case, I could make an app which
> claims to be yours, sign it with my own key and push a bogus update.
>
> On Tue, Mar 17, 2009 at 2:47 PM, Maxence Warzecha  wrote:
>
> > Hi all,
>
> > This is what I did :
>
> > - I signed my apk.
> > - I published my apk.
> > - I updated my application.
> > - I sign my new apk file succesfully (**with an other keystore**).
> > - I upload my new apk.
> > - When poeple what to install updated version, they receive message
> > look like "apk file was not signed correctly". If they uninstall
> > previous version, they are able to install new version (piouf...).
>
> > I don't understand why.
>
> > Can you tell me if need to keep my previous keystore *OR* with similar
> > information? Or ...?
>
> > Thank you!
> > Max
--~--~-~--~~~---~--~~
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: jarsigner jar sign apk update

2009-03-17 Thread Stoyan Damov

Of course you should sign your updated app with the same keystore,
think about it - if this wasn't the case, I could make an app which
claims to be yours, sign it with my own key and push a bogus update.

On Tue, Mar 17, 2009 at 2:47 PM, Maxence Warzecha  wrote:
>
> Hi all,
>
> This is what I did :
>
> - I signed my apk.
> - I published my apk.
> - I updated my application.
> - I sign my new apk file succesfully (**with an other keystore**).
> - I upload my new apk.
> - When poeple what to install updated version, they receive message
> look like "apk file was not signed correctly". If they uninstall
> previous version, they are able to install new version (piouf...).
>
> I don't understand why.
>
> Can you tell me if need to keep my previous keystore *OR* with similar
> information? Or ...?
>
> Thank you!
> Max
> >
>

--~--~-~--~~~---~--~~
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: Hosting APKs files on site works for emulator, but not device?

2009-03-17 Thread Jean-Baptiste Queru

There is a transparent proxy on T-Mobile's port 80, which works at the
IP level (so it doesn't need to be explicitly configured at the HTTP
level, but also can't be bypassed).

Does your apk download over wifi? Can you try serving it from a port
other than 80?

There's an open issue
http://code.google.com/p/android/issues/detail?id=1085 about
situations where small apks (less than 64kB) sometimes cause problems,
though we've never been able to quite get to the bottom of it.

JBQ

On Tue, Mar 17, 2009 at 1:36 AM, Al Sutton  wrote:
>
> If you want to send me a link off list I'll see what I can find.
>
> Al.
>
> Michael Krehan wrote:
>>
>> Al, thanks for the reply. It's on my own server (a Linux-based Apache
>> server), and it's a simple A HREF that goes straight to the file in
>> the same directory. No redirection or anything.
>>
>> I tried it on an ADP1 and a G1, both on the T-Mobile network, and it
>> didn't work. The emulator worked fine. The symptoms point to a proxy.
>>
>> On Mar 17, 2009 12:42 AM, "Al Sutton" > > wrote:
>>
>>
>> Does the URL you're downloading from use a redirect or something
>> similar
>> to get to the apk?
>>
>> Many free file hosting or website hosting packages use a loading page
>> and some type of redirect (a Meta refresh tag being one example), and
>> there have been problems with those on the device (see
>> 
>> http://groups.google.com/group/android-developers/browse_thread/thread/b4fffb26e83d9653
>> for one example).
>>
>> Al.
>>
>> EboMike wrote: > I'm currently hosting an app on my own server so
>> my beta testers can > test it. I'...
>>
>> --
>>
>> * Written an Android App? - List it at http://andappstore.com/ *
>>
>> ==
>> Funky Android Limited is registered in England & Wales with the
>> company number  6741909. The registered head office is Kemp House,
>> 152-160 City Road, London,  EC1V 2NX, UK.
>>
>> The views expressed in this email are those of the author and not
>> necessarily those of Funky Android Limited, it's associates, or it's
>> subsidiaries.
>>
>>
>>
>>
>> >
>
>
> --
>
> * Written an Android App? - List it at http://andappstore.com/ *
>
> ==
> Funky Android Limited is registered in England & Wales with the
> company number  6741909. The registered head office is Kemp House,
> 152-160 City Road, London,  EC1V 2NX, UK.
>
> The views expressed in this email are those of the author and not
> necessarily those of Funky Android Limited, it's associates, or it's
> subsidiaries.
>
>
> >
>



-- 
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

--~--~-~--~~~---~--~~
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] jarsigner jar sign apk update

2009-03-17 Thread Maxence Warzecha

Hi all,

This is what I did :

- I signed my apk.
- I published my apk.
- I updated my application.
- I sign my new apk file succesfully (**with an other keystore**).
- I upload my new apk.
- When poeple what to install updated version, they receive message
look like "apk file was not signed correctly". If they uninstall
previous version, they are able to install new version (piouf...).

I don't understand why.

Can you tell me if need to keep my previous keystore *OR* with similar
information? Or ...?

Thank you!
Max
--~--~-~--~~~---~--~~
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: Store log messages on adp1

2009-03-17 Thread Jean-Baptiste Queru

As far as I know this is not run-time configurable.

JBQ

On Tue, Mar 17, 2009 at 3:21 AM, Michael Bollmann
 wrote:
>
> Is it possible to configure the ADP1 to keep the last 5mb(for example)
> of log messages
> especially when it's not connected to a development machine?
>
> >
>



-- 
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

--~--~-~--~~~---~--~~
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: Transferring paid apps G1 -> HTC Magic

2009-03-17 Thread Jean-Baptiste Queru

If those apps were downloaded from Android Market, just be sure to
sign into the new device with the same Google account and re-download
the apps there (they'll be listed in Market -> My Downloads).

JBQ

On Tue, Mar 17, 2009 at 1:48 AM, Carl Whalley
 wrote:
>
> With the imminent arrival of the Magic I was wondering what impact
> this would have on both end users and developers who want to transfer
> their apps over, or may even have both handsets for whatever reason.
> Is there a licensing provision for it? A means via software? This will
> become more of an issue as the other new Android handsets are
> launched.
>
> --
> Android Academy: http://www.androidacademy.com
>
>
> >
>



-- 
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

--~--~-~--~~~---~--~~
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 the use same instances when launching application twice ?

2009-03-17 Thread deepdr...@googlemail.com

I would expect that the attribute
android:launchMode="singleTask"
(notice the lower case s)
on the Activity does what you want.
How do you determine this doesn't work?

--
http://www.deepdroid.com

On 17 Mrz., 10:26, Derek  wrote:
> Hi,
>
> Is it possible to re-use all the instances of Activities and Services
> when an application is launched twice. For instance:
> 1/ I start my application APP1. Some activities are launched and a
> service is started.
> 2/ I click "Home" device button
> 3/ I can see the icon the launch again my application APP1
> 4/ I click on it and the APP1 is launched twice
>
> I would like to re-use the existing the instances of Activities and
> Services from the first launch.
> I guess it is related to "SingleTop" or "SingleTask" but it doesn't
> seem to work.
>
> Any suggestion ?
--~--~-~--~~~---~--~~
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: Vibrator device simulation in the emulator

2009-03-17 Thread David Turner
Hello,

The vibrator is not currently emulated by the Android emulator at this
point.

On Mon, Mar 16, 2009 at 8:07 PM, Prem Thilagar  wrote:

>
> Hi I am trying to actually simulate a vibrator device inside the
> emulator .A timed_output driver for the vibrator was created and i am
> able to access the node at /sys/class/timed_output/vibrator/enable
> that is specified as THE_DEVICE in the vibrator.c file at hardware/
> libhardware/vibrator/.The driver is tested to work from the kernel
> below
>
> I ran into some issue while trying to invoke the driver from a user
> level app.I just added these two lines and created an app.
>
> vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
> vibrator.vibrate(1);
>
> when i created an .apk and ran it i could see the following messages
> in Logcat
>
> I/ActivityManager( 589): Starting activity: Intent
> { action=android.intent.action.MAIN categories=
> {android.intent.category.LAUNCHER} flags=0x1020
> comp={com.uiactivity.ui/com.uiactivity.ui.uiSimpleWidet} }
> I/ActivityManager( 589): Start proc com.uiactivity.ui for activity
> com.uiactivity.ui/.uiSimpleWidet: pid=791 uid=10023 gids={}
> :
> : A bunch of Dalvik messages
> :
> :
> V/ActivityThread( 791): Resuming ActivityRecord
> {436b6288token=android.os.binderpr...@436b5e50 {com.uiactivity.ui/
> com.uiactivity.ui.uiSimpleWidet}} with isForward=true
> I/ActivityManager( 589): Displayed activity
> com.uiactivity.ui/.uiSimpleWidet: 1203 ms
>
> Do i have to do something specific to make sure that the Harware
> service kicks in after this.?
>
> After this nothing happens ,
>
> is it guaranteed that VIBRATOR_SERVICE will automatically be binded
> when i do this
> vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
> because i dont really see a error there.
>
> could some one throw some light on it
>
> Is there a way i can verify VIBRATOR_SERVICE is actually running in
> the emulator .( i made sure the libhardware.so and
> libhardware_legacy.so are present )I could see from ddms service
> hardware is running .
>
> >
>

--~--~-~--~~~---~--~~
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: Determine images at runtime - getResources().getIdentifier()

2009-03-17 Thread Tommaso

I solved it, the parameter must be:
getPackageName()+":drawable/"+symbolIdentifier

Still the question:
How can it be done better?

Thanks,
  Tommaso

On 17 Mrz., 11:44, Tommaso  wrote:
> Hi all,
>
> in my application I have a table that stores information for symbols.
> These symbols have to be displayed, so also the source, the *.png, is
> stored in each row. These symbols are loaded randomly at runtime.
>
> How do I get the the image(s) to be loaded?
>
> getResources().getIdentifier(symbolIdentifier, null, null) always
> results 0 (zero).
>
> Here is the code:
>     private void loadSymbol(final String source) {
>         int imageIdentifier = getResources().getIdentifier
> (symbolIdentifier, null, null);
>         Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
> imageIdentifier);
>         mImageOfSymbol.setImageBitmap(bitmap);
>         mImageOfSymbol.setVisibility(ImageView.VISIBLE);
>         mImageOfSymbol.refreshDrawableState();
>     }
>
> It says in the JavaDoc that the use of getIdentifier() is discouraged.
> What is a best practice to load images at runtime, when only knowing
> the source as a string?
>
> Many thanks in advance.
>
> Ciao,
>   Tommaso
--~--~-~--~~~---~--~~
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: GridView ImageView and performance

2009-03-17 Thread ifuller1

Thanks gesh - as suggested the problem was related to recycling.
Preformance is pretty good now, sadly my images keep shuffling but
given your recent input this should be easy to fix.

On Mar 15, 10:03 pm, Gesh  wrote:
> > I'm currently using the ImageAdapter from the Hello GridView sample.
> > But loading the images from the web rather than using resources.
>
> I think you need a better understanding of how adapters work to solve
> your problem. The getView() method of your Adapter is inkoved every
> time an image in your grid becomes visible (yes, including when you
> scroll back and forth to previously visible images). So if you have
> just replaced that one line image.setImageResource(int) with
> image.setImageDrawable(Drawable.createFromStream()) it means you are
> re-downloading images every time they get scrolled into view.
>
> So you need to cache those downloaded images and while you are at it
> make sure you cache scaled thumbnail of the image, just as big as you
> need them to avoid the possible problem Romain suggested. Use
> Bitmap.createScaledBitmap() - it's worked great for me.
>
> Also be aware that the emulator is running on your PC using that same
> network speed. If you want to test for real network problems you might
> get on a real device try starting the emulator with limited network
> (or on your G1 disable wireless and 3G). I alwasy run my emulator with
> network speed and latency set to EDGE, or for some debugging purposes
> even GPRS or GSM.
>
> hope that helps you,
> gesh.
>
> On Mar 15, 7:22 am, ifuller1  wrote:
>
> > Hi Gesh,
>
> > Thanks for the response. I'll certainly give the bitmap factory a go.
> > I'm currently using the ImageAdapter from the Hello GridView sample.
> > But loading the images from the web rather than using resources. The
> > problem is immediate, in that the performance doesn't degrade after re-
> > visits to the activity, but is instead directly proportional to the
> > number of images I'm displaying.
>
> > As well as trying the bitmap factory can I ask what you think is the
> > best way to encourage garbage collection? Will nulling my objects be a
> > big help.
>
> > Once I have it optimized I'm going to release it for free... I think
> > there's a big hole in androids picasa support.
>
> > Ian
>
> > On Mar 14, 11:38 pm, Gesh  wrote:
>
> > > hi,
>
> > > I have written 2 connected apps with some image content pulled from
> > > the web and must say if you handle your resources right it shouldn't
> > > be a problem at all.
>
> > > Do you use your own Adapter for theGridViewor do you use some of the
> > > already available ones in the SDK? If you use your own you should keep
> > > in mind that when you deal with AdapterViews in general they keep
> > > references to Views you create in your adapter and recycle them, so
> > > try to reuse the convertView reference you get in the Adapter.getView
> > > (int position, View convertView, ViewGroup parent) method.
>
> > > And although memory leaks are difficult to achieve in what sounds like
> > > a single activity app the other thing that comes to mind is that you
> > > might have memory leaks due to the way you use Drawables. Try using
> > > Bitmaps from the BitmapFactory.decodeStream(InputStream) method and
> > > maybe read this blog for more info why Drawables could cause memory
> > > leaks 
> > > -http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks.
>
> > > cheers,
> > > gesh.
>
> > > On Mar 14, 12:47 pm, ifuller1  wrote:
>
> > > > I've managed to successfully connect to the picasa web services using
> > > > JSON and download a list of thumbnails from my picasa album. The
> > > > thumbnails are all very small but I'm getting pretty terrible
> > > > performance (especially when compared to the native picture viewer).
> > > > As my main goal was getting the application working their is obviously
> > > > lots of optimisation work I can do but I just wanted to know where the
> > > > most likely cause of poor performance is coming from. Is it the memory
> > > > usage (so I should try cleaning up existing objects) or is it display
> > > > performance (can't cope with 30 thumbnails at once)?
>
> > > > Example thumbnail 
> > > > imagehttp://lh6.ggpht.com/_QIFTbqmwS8U/Samo30_xoBI/AEk/VeBxiukdKzU...
>
> > > > being loaded via Drawable.createFromStream
>
> > > > Thanks in advanced.
>
> > > > Ian
--~--~-~--~~~---~--~~
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: Testing Android Game on real device: please help

2009-03-17 Thread TjerkW

I cannot follow only 1 thread there, it is all-threads or threads with
a specific keyword.
What i want is to only follow certain threads..

(sorry to be so off-topic)

On 15 mrt, 17:46, Stoyan Damov  wrote:
> Go tohttp://groups.google.com/group/android-developers/subscribe?hl=en
> and edit your membership
>
> On Sun, Mar 15, 2009 at 5:13 PM,TjerkW wrote:
>
> > Ok both your email adresses are noted... but the game still needs some
> > work,
> > so if i think it can be tested youll get an .apk in your inbox! :-)
>
> > Btw: how do you subscribe to a thread in order to get automatic emails
> > here at google-groups?
> > I can only subscribe by easing search-words.. or by getting an email
> > once a day ...
> > I only want to subscribe to this thread... how do i do that?
>
> > On 13 mrt, 15:53, Andrea Fanfani  wrote:
> >> On Fri, Mar 13, 2009 at 06:40:52AM -0700,TjerkWwrote:
>
> >> > Hello all,
>
> >> > I am making an android game, but i do not have the money to buy a
> >> > developer phone.
> >> > The game is not finished but i should it is testable.. and if i dont
> >> > test it know i may
> >> > have a big problem later... it is playable though.
>
> >> > Is there somebody who has a real device and wants to test the game for
> >> > me,
> >> > just starting it up and playing it a little bit is good enough.
>
> >> > It's a 2d airplane shoot gane, much like the old raptor game.
>
> >> > If someone is interested please reply, i will sent you
> >> > the (singed) APK and with some things i want to test (using both the
> >> > buttons as well as touch screen for gameplay).
>
> >> > Could anybody help me out?
>
> >> hi, send me at andrea.fanfani(at)gmail.com
>
> >> I will try to take a look at the application.
>
> >> a.f.
--~--~-~--~~~---~--~~
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] Reg: Porting of camera code with android source code

2009-03-17 Thread alok Yadav

Hi ,
I am porting camera code with the android source code .I am 
following all the
procedure but while doing ant, i am getting following error.

**

[r...@localhost CameraApiTest_alok]# /usr/bin/ant
Exception in thread "main" java.lang.NoClassDefFoundError: 
org.apache.tools.ant.launch.Launcher
   at gnu.java.lang.MainThread.run(libgcj.so.7rh)
Caused by: java.lang.ClassNotFoundException: 
org.apache.tools.ant.launch.Launcher not found in 
gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/bin/build-classpath,file:/usr/lib/jvm/java-1.4.2/lib/tools.jar],
 
parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.7rh)
   at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at gnu.java.lang.MainThread.run(libgcj.so.7rh)





i have set all the path like:

export JAVA_HOME=/usr/lib/jvm/java-1.4.2
export ANT_HOME=/usr/share/ant
PATH=$PATH:$HOME:$JAVA_HOME:$ANT_HOME:

But still getting the issue.
Can some one tell that where the issue is??

Thanks in advance
Alok




--~--~-~--~~~---~--~~
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: InstrumentationTestRunner on G1

2009-03-17 Thread sukumar bhashyam
hi Fred,

CheckJNI has nothing to do with testRunner. Din't remember the exact cause
why it was not running on phone. But, it started working after sometime(
might be problem with my code ).

Sukumar.

On Tue, Dec 30, 2008 at 3:12 PM, sukumar  wrote:

>
> hi,
>
> I'm facing problems running TestRunner on G1 phone. I haven't had any
> problems running on emulator.   Was there any setting I need to turn
> it ON on G1 phone?. Also from catlogs, for emulator CheckJNI is
> printed as ON but on phone its printed as OFF.  Is checkJNI has
> something to do with test runner ?. Thanks in advance.
>
>
> Sukumar.
>
>
>
> >
>

--~--~-~--~~~---~--~~
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] Determine images at runtime - getResources().getIdentifier()

2009-03-17 Thread Tommaso

Hi all,

in my application I have a table that stores information for symbols.
These symbols have to be displayed, so also the source, the *.png, is
stored in each row. These symbols are loaded randomly at runtime.

How do I get the the image(s) to be loaded?

getResources().getIdentifier(symbolIdentifier, null, null) always
results 0 (zero).

Here is the code:
private void loadSymbol(final String source) {
int imageIdentifier = getResources().getIdentifier
(symbolIdentifier, null, null);
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
imageIdentifier);
mImageOfSymbol.setImageBitmap(bitmap);
mImageOfSymbol.setVisibility(ImageView.VISIBLE);
mImageOfSymbol.refreshDrawableState();
}

It says in the JavaDoc that the use of getIdentifier() is discouraged.
What is a best practice to load images at runtime, when only knowing
the source as a string?

Many thanks in advance.

Ciao,
  Tommaso
--~--~-~--~~~---~--~~
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: Help using autocomplete in my database.....

2009-03-17 Thread aljo

Thanks... your program worked...

Thank you for your help...

Just one question... If what I understand is correct, your program
queries only the first column of the table... If I query the second
column which is the "_id" column, it still looks into the "name"
column and displays the content of the name column in the autocomplete
textview. So i have to change the ((TextView) view).setText
(cursor.getString(columnIndex)) and return cursor.getString
(columnIndex) to ((TextView) view).setText(cursor.getString(1)) and
return cursor.getString(1)...
I don't know if what I did to modify the code was the correct way or
do you have a better way?

it now looks like this...

 @Override
public void bindView(View view, Context context, Cursor
cursor) {
((TextView) view).setText(cursor.getString(1));
}

@Override
public String convertToString(Cursor cursor) {
Log.i("info", " convertToString ");
return cursor.getString(1);
}

@Override
public Cursor runQueryOnBackgroundThread(CharSequence
constraint) {
if (constraint != null) {
String selection = "_id like \'" + constraint.toString()
+"%\'";
return sqlite.query("test", null, selection, null,
null, null, null);
}
else {
return null;
}
}

sorry if im such a noob



On Mar 13, 5:28 pm, roland  wrote:
> Hi, i made a sample of using a AutoCompleteTextView to showing names
> which are saved in a database.
>
> Here is the link of 
> project:http://0467525716.free.fr/Android/AutocompleteTest.zip
>
> I hope it helps.
>
> On 10 mar, 04:26, aljo  wrote:
>
>
>
> > i already saw that thread but i still can't understand some of the
> > codes... i don't know how to incorporate my database in that code...
> > how can i import my db...
>
> > public ContactListAdapter(Context context, Cursor c) {
> >                     super(context, c);
> >                     Log.d("exp", "*** A VER EHJEE
> > *");
> >                     mDb = new Database
> > (context);
> > <--- (is this where i will put my DB?)
> >                     mDb.open();
> >                     Log.d("exp", "*** A VER PUES 100
> > *");
> >                 }
>
> >  private static final String[] PEOPLE_PROJECTION = new String[]
> > <- (is this where autocomplete extracts its data?)
> > {
> >                 Database.KEY_REASON,
> >                 Database.KEY_VALUE,
> >                 Database.KEY_TAX
> >         };
>
> > sorry guyz... im kinda new on this whole thing
> > tnx for any of your help...
>
> > On Mar 5, 6:42 pm, roland  wrote:
>
> > > Check this 
> > > out,http://groups.google.com/group/android-developers/browse_thread/threa...
>
> > > On 4 mar, 07:22, aljo  wrote:
>
> > > > i'm kinda new to this android application and still a newbei to
> > > > programming so hope someone could help me
>
> > > > i've created an SQLitedatabaseprogram.. but i don't know how to use
> > > > theautocompletefunction to access mydatabase... here's my code:
>
> > > > ---­­---
>
> > > > packagedatabase.dev5;
>
> > > > import java.util.ArrayList;
>
> > > > import android.app.ListActivity;
> > > > import android.database.Cursor;
> > > > import android.database.sqlite.SQLiteDatabase;
> > > > import android.os.Bundle;
> > > > import android.widget.ArrayAdapter;
> > > > import android.widget.EditText;
>
> > > > public classDatabaseextends ListActivity {
>
> > > >         private final String MY_DATABASE_NAME = "myCoolDB_2";
> > > >         private final String MY_DATABASE_TABLE = "Users";
>
> > > >         /** Called when the activity is first created. */
> > > >         @Override
> > > >         public void onCreate(Bundle icicle) {
> > > >                 super.onCreate(icicle);
>
> > > >                 EditText et = new EditText(this);
> > > >                 et.setSelection(et.getText().length());
> > > >                 /* Will hold the 'Output' we want to display at the 
> > > > end. */
> > > >                 ArrayList results = new ArrayList();
>
> > > >                 SQLiteDatabase myDB = null;
> > > >                 try {
>
> > > >                         //Create theDatabase(no Errors if it already 
> > > > exists)
> > > >                         this.openOrCreateDatabase(MY_DATABASE_NAME, 
> > > > MODE_PRIVATE, null);
> > > >                         // Open the DB and remember it
> > > >                         myDB = 
> > > > this.openOrCreateDatabase(MY_DATABASE_NAME, MODE_PRIVATE,
> > > > null);
>
> > > >                         //this.deleteDatabase(MY_DATABASE_NAME);
>
> > > >                         // Create a Table in theDatabase.
> > > >                         myDB.execSQL("CREATE TABLE IF NOT EXISTS "
> > > > 

[android-developers] Store log messages on adp1

2009-03-17 Thread Michael Bollmann

Is it possible to configure the ADP1 to keep the last 5mb(for example)
of log messages
especially when it's not connected to a development machine?

--~--~-~--~~~---~--~~
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: Sensing The Touch Event

2009-03-17 Thread Abdul Mateen
Actually , What I am trying to achieve is , making an Application, that is
running behind user will start his application on top of my Application,
same on the emulator and on the real device some where, when he touch on the
emulator , my application should get the information about the touch and
send it over the http to the instance of application running on the real
phone, then it will execute that particular event, see by this , we can
remotely execute the same applications, Can this be possible?

Otherwise if from SDK this is not possible I will have to make some native
programs and push that into the phone to accomplish this.

On Tue, Mar 17, 2009 at 3:06 AM, Ralf  wrote:

>
> When your second activity is running, your first one is most likely
> stopped.
>
> What are you trying to achieve? There might be other ways to achieve
> it, e.g. using a service or collecting data and passing it back to the
> first activity.
> R/
>
> On Sun, Mar 15, 2009 at 4:31 AM, mateen  wrote:
> >
> > Asslam-u-Alikum,
> >
> > I am a developer of Android platform, I have been stucked at the
> > point, Consider the senerio,
> >
> > First Activity named MainActivity is starting the second Activity
> > named ChildActivity from another package installed in the android
> > phone. Now, I want to have the knowledge of touch from childActivity
> > to MainActivity I know this is not possible directly , but Do there
> > exists any method or some service I can use to do this?
> >
> > Thank You,
> > Regards,
> > Abdul Mateen,
> > Android Developer and Linux Administrator,
> > Addictive Mobility, CA.
> > www.addictivemobility.com.
> >
> > >
> >
>
> >
>

--~--~-~--~~~---~--~~
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: Redistributing the eclipse plugins

2009-03-17 Thread danielolsson

On 16 Mar, 22:37, Ralf  wrote:
> With the usual "I'm not a lawyer" disclaimer applied, I'd think yes as
> long as you comply with the EPL and thus redistribute that part using
> the EPL. However you'd have to carefully choose your wording to make
> it clear this is not the original plugin distributed by Google.
>

Thank you for your answer. However, I have realised that the binary
plugins I have are NOT under the EPL.

I've been looking into this a little bit more in detail, and have come
to the following conclusions:
The eclipse plugins (0.8.0.v200809220836) downloadable from the update
site https://dl-ssl.google.com/android/eclipse/ are distributed under
the Android Software Development Kit License Agreement. According to
3.3 in that agreement we are not allowed to redistribute the plugins
in our own eclipse distribution.
If we would take the source code of the plugins in git (0.8.1 or 0.9.0
work in progress) we could build the plugins ourselves and distribute
it under EPL and Apache 2 accordingly.
To build them ourselves appears to us as an unnecessary step which we
would like to avoid. If possible we would like to take the prebuilt
binaries and include them in our distribution. However, it appears
that we would need Google's written permission in order to do that.

Could someone from Google comment on that?


BR
Daniel Olsson
--~--~-~--~~~---~--~~
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: How to rea d the file in sdcard?

2009-03-17 Thread AlexNguyen

Thanks for your help!

--Alex

On Mar 17, 5:22 pm, Jiang  wrote:
> Sorry, you need to write like:
> FileInputStream is = new FileInputStream("/sdcard/your_file");
>
> --- 09年3月17日,周二, Jiang  写道:
> 发件人: Jiang 
> 主题: 回复: [android-developers] Re: How to read the file in sdcard?
> 收件人: android-developers@googlegroups.com
> 日期: 2009,317,周二,5:17下午
>
> InputStream is = new InputStream("/sdcard/your_file");
>
> --- 09年3月17日,周二, AlexNguyen  写道:
> 发件人: AlexNguyen 
> 主题: [android-developers] Re: How to read the file in sdcard?
> 收件人: "Android Developers" 
> 日期: 2009,317,周二,5:15下午
>
> I created the file.java  to read file so I don't know why it's error.
> And there's the error: "android.content.res.AssetManager
> $AssetInputStream"
>
> public class Test1 extends Activity{
>  /** Called when the activity is first created. */
> @Override
> public void onCreate(Bundle savedInstanceState) {
>
>  super.onCreate(savedInstanceState);
> readfilefromlocal(this);
> }
> protected void readfilefromlocal(Context ctx) {
>
>  FileInputStream istream = null;
>  TextView tv = new TextView (this);
> try {
>   istream = (FileInputStream)ctx.getResources().openRawResource
> (R.raw.sample);
>
>  SAXParserFactory spf = SAXParserFactory.newInstance();
>  SAXParser sp = spf.newSAXParser();
>  XMLReader xr = sp.getXMLReader();
>  ExampleHandler myExampleHandler = new ExampleHandler();
>  xr.setContentHandler(myExampleHandler);
>  xr.parse(new InputSource(istream));
>
>  ParsedExampleDataSet parsedExampleDataSet =
> myExampleHandler.getParsedData();
>  tv.setText(parsedExampleDataSet.toString1());
> }
> catch (Exception e){
>   tv.setText("Error: " + e.getMessage());
> }
>
> this.setContentView(tv);
> }
>
> }
>
> If I want to modify to read file at sdcard, how must i do?
> Thanks,
> --Alex
>
> 好玩贺卡等你发,邮箱贺卡全新上线!
>
>   ___
>   好玩贺卡等你发,邮箱贺卡全新上线!http://card.mail.cn.yahoo.com/
--~--~-~--~~~---~--~~
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 the use same instances when launching application twice ?

2009-03-17 Thread Derek

Hi,

Is it possible to re-use all the instances of Activities and Services
when an application is launched twice. For instance:
1/ I start my application APP1. Some activities are launched and a
service is started.
2/ I click "Home" device button
3/ I can see the icon the launch again my application APP1
4/ I click on it and the APP1 is launched twice

I would like to re-use the existing the instances of Activities and
Services from the first launch.
I guess it is related to "SingleTop" or "SingleTask" but it doesn't
seem to work.

Any suggestion ?

--~--~-~--~~~---~--~~
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 re ad the file in sdcard?

2009-03-17 Thread Jiang
Sorry, you need to write like:
FileInputStream is = new FileInputStream("/sdcard/your_file");


--- 09年3月17日,周二, Jiang  写道:
发件人: Jiang 
主题: 回复: [android-developers] Re: How to read the file in sdcard?
收件人: android-developers@googlegroups.com
日期: 2009,317,周二,5:17下午

InputStream is = new InputStream("/sdcard/your_file");


--- 09年3月17日,周二, AlexNguyen  写道:
发件人: AlexNguyen 
主题: [android-developers] Re: How to read the file in sdcard?
收件人: "Android Developers" 
日期: 2009,317,周二,5:15下午


I created the file.java  to read file so I don't know why it's error.
And there's the error: "android.content.res.AssetManager
$AssetInputStream"

public class Test1 extends Activity{
 /** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
   
 super.onCreate(savedInstanceState);
readfilefromlocal(this);
}
protected void readfilefromlocal(Context ctx) {

 FileInputStream istream = null;
 TextView tv = new TextView (this);
try {
  istream = (FileInputStream)ctx.getResources().openRawResource
(R.raw.sample);

 SAXParserFactory spf = SAXParserFactory.newInstance();
 SAXParser sp = spf.newSAXParser();
 XMLReader xr = sp.getXMLReader();
 ExampleHandler myExampleHandler = new ExampleHandler();
 xr.setContentHandler(myExampleHandler);
 xr.parse(new InputSource(istream));

 ParsedExampleDataSet parsedExampleDataSet =
myExampleHandler.getParsedData();
 tv.setText(parsedExampleDataSet.toString1());
}
catch (Exception e){
  tv.setText("Error: " + e.getMessage());
}

this.setContentView(tv);
}
}

If I want to modify to read file at sdcard, how must i do?
Thanks,
--Alex


好玩贺卡等你发,邮箱贺卡全新上线!







  ___ 
  好玩贺卡等你发,邮箱贺卡全新上线! 
http://card.mail.cn.yahoo.com/
--~--~-~--~~~---~--~~
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: TextView

2009-03-17 Thread Mr.No

Nobody knows how to set the text in a TextView underlinded within the
code?

On 16 Mrz., 12:11, "Mr.No"  wrote:
> Thx, but its static, i wonna also change the text within the code.
>
> On 16 Mrz., 11:59, manoj  wrote:
>
> > Define a string value in strings.xml as suggested below.
> > My Booking
>
> > On Mar 16, 3:38 pm, "Mr.No"  wrote:
>
> > > Hello,
> > > how i can set the Text in a TextView underlined within the xml?
>
> > > rgds mr.no
>
>
--~--~-~--~~~---~--~~
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 re ad the file in sdcard?

2009-03-17 Thread Jiang
InputStream is = new InputStream("/sdcard/your_file");


--- 09年3月17日,周二, AlexNguyen  写道:
发件人: AlexNguyen 
主题: [android-developers] Re: How to read the file in sdcard?
收件人: "Android Developers" 
日期: 2009,317,周二,5:15下午


I created the file.java  to read file so I don't know why it's error.
And there's the error: "android.content.res.AssetManager
$AssetInputStream"

public class Test1 extends Activity{
 /** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
readfilefromlocal(this);
}
protected void readfilefromlocal(Context ctx) {

 FileInputStream istream = null;
 TextView tv = new TextView (this);
try {
  istream = (FileInputStream)ctx.getResources().openRawResource
(R.raw.sample);

 SAXParserFactory spf = SAXParserFactory.newInstance();
 SAXParser sp = spf.newSAXParser();
 XMLReader xr = sp.getXMLReader();
 ExampleHandler myExampleHandler = new ExampleHandler();
 xr.setContentHandler(myExampleHandler);
 xr.parse(new InputSource(istream));

 ParsedExampleDataSet parsedExampleDataSet =
myExampleHandler.getParsedData();
 tv.setText(parsedExampleDataSet.toString1());
}
catch (Exception e){
  tv.setText("Error: " + e.getMessage());
}
this.setContentView(tv);
}
}

If I want to modify to read file at sdcard, how must i do?
Thanks,
--Alex




  ___ 
  好玩贺卡等你发,邮箱贺卡全新上线! 
http://card.mail.cn.yahoo.com/
--~--~-~--~~~---~--~~
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 read the file in sdcard?

2009-03-17 Thread AlexNguyen


I created the file.java  to read file so I don't know why it's error.
And there's the error: "android.content.res.AssetManager
$AssetInputStream"

public class Test1 extends Activity{
 /** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
readfilefromlocal(this);
}
protected void readfilefromlocal(Context ctx) {

 FileInputStream istream = null;
 TextView tv = new TextView (this);
try {
  istream = (FileInputStream)ctx.getResources().openRawResource
(R.raw.sample);

 SAXParserFactory spf = SAXParserFactory.newInstance();
 SAXParser sp = spf.newSAXParser();
 XMLReader xr = sp.getXMLReader();
 ExampleHandler myExampleHandler = new ExampleHandler();
 xr.setContentHandler(myExampleHandler);
 xr.parse(new InputSource(istream));

 ParsedExampleDataSet parsedExampleDataSet =
myExampleHandler.getParsedData();
 tv.setText(parsedExampleDataSet.toString1());
}
catch (Exception e){
  tv.setText("Error: " + e.getMessage());
}
this.setContentView(tv);
}
}

If I want to modify to read file at sdcard, how must i do?
Thanks,
--Alex
--~--~-~--~~~---~--~~
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: global object? (singleton, intends, db)

2009-03-17 Thread Al Sutton

Have you actually benchmarked using the database against alternatives?

You may find that although you consider the database slow it's the 
fastest option you have when compared to serialization methods.

Al.

DaRolla wrote:
> hello,
>
> in order to communicate with the server I need a huge global object
> (class with some hashmaps).
>
> all my activities (about 10) need that huge global object.
>
> wich options do I have?
>
> I am thinking about passing the object using intends and about the
> possibility to make the object a singleton.
>
> using the db will be much too slow.
>
>
> any ideas?
>
> greetings & thanks for reading,
> DaRolla
> >
>   


-- 

* Written an Android App? - List it at http://andappstore.com/ *

==
Funky Android Limited is registered in England & Wales with the 
company number  6741909. The registered head office is Kemp House, 
152-160 City Road, London,  EC1V 2NX, UK. 

The views expressed in this email are those of the author and not 
necessarily those of Funky Android Limited, it's associates, or it's 
subsidiaries.


--~--~-~--~~~---~--~~
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: global object? (singleton, intends, db)

2009-03-17 Thread Cyril Jaquier

Hi,

> in order to communicate with the server I need a huge global object
> (class with some hashmaps).
> 
> all my activities (about 10) need that huge global object.
> 
> wich options do I have?
> 
> I am thinking about passing the object using intends and about the
> possibility to make the object a singleton.
> 
> using the db will be much too slow.
> 
> 
> any ideas?
> 

I just rewrote part of my application (NetCounter) last week to get ride 
of the aidl I used between activity and service. I wrote a model created 
in Application#onCreate [1]. You can register an Application object in 
your manifest so the platform will create it before anything else in 
your application. You can then use getApplication [2][3] to get this 
reference from your activities and services.

You can have a look at NetCounter code as it is now open-source ;)

http://www.jaqpot.net/viewvc/android/netcounter/trunk/

Regards,

Cyril Jaquier

[1] http://developer.android.com/reference/android/app/Application.html
[2] 
http://developer.android.com/reference/android/app/Activity.html#getApplication()
[3] 
http://developer.android.com/reference/android/app/Service.html#getApplication()

--~--~-~--~~~---~--~~
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] global object? (singleton, intends, db)

2009-03-17 Thread DaRolla

hello,

in order to communicate with the server I need a huge global object
(class with some hashmaps).

all my activities (about 10) need that huge global object.

wich options do I have?

I am thinking about passing the object using intends and about the
possibility to make the object a singleton.

using the db will be much too slow.


any ideas?

greetings & thanks for reading,
DaRolla
--~--~-~--~~~---~--~~
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] Transferring paid apps G1 -> HTC Magic

2009-03-17 Thread Carl Whalley

With the imminent arrival of the Magic I was wondering what impact
this would have on both end users and developers who want to transfer
their apps over, or may even have both handsets for whatever reason.
Is there a licensing provision for it? A means via software? This will
become more of an issue as the other new Android handsets are
launched.

--
Android Academy: http://www.androidacademy.com


--~--~-~--~~~---~--~~
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: Hosting APKs files on site works for emulator, but not device?

2009-03-17 Thread Al Sutton

If you want to send me a link off list I'll see what I can find.

Al.

Michael Krehan wrote:
>
> Al, thanks for the reply. It's on my own server (a Linux-based Apache 
> server), and it's a simple A HREF that goes straight to the file in 
> the same directory. No redirection or anything.
>
> I tried it on an ADP1 and a G1, both on the T-Mobile network, and it 
> didn't work. The emulator worked fine. The symptoms point to a proxy.
>
> On Mar 17, 2009 12:42 AM, "Al Sutton"  > wrote:
>
>
> Does the URL you're downloading from use a redirect or something
> similar
> to get to the apk?
>
> Many free file hosting or website hosting packages use a loading page
> and some type of redirect (a Meta refresh tag being one example), and
> there have been problems with those on the device (see
> 
> http://groups.google.com/group/android-developers/browse_thread/thread/b4fffb26e83d9653
> for one example).
>
> Al.
>
> EboMike wrote: > I'm currently hosting an app on my own server so
> my beta testers can > test it. I'...
>
> --
>
> * Written an Android App? - List it at http://andappstore.com/ *
>
> ==
> Funky Android Limited is registered in England & Wales with the
> company number  6741909. The registered head office is Kemp House,
> 152-160 City Road, London,  EC1V 2NX, UK.
>
> The views expressed in this email are those of the author and not
> necessarily those of Funky Android Limited, it's associates, or it's
> subsidiaries.
>
>
>
>
> >


-- 

* Written an Android App? - List it at http://andappstore.com/ *

==
Funky Android Limited is registered in England & Wales with the 
company number  6741909. The registered head office is Kemp House, 
152-160 City Road, London,  EC1V 2NX, UK. 

The views expressed in this email are those of the author and not 
necessarily those of Funky Android Limited, it's associates, or it's 
subsidiaries.


--~--~-~--~~~---~--~~
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: Hosting APKs files on site works for emulator, but not device?

2009-03-17 Thread Michael Krehan
Al, thanks for the reply. It's on my own server (a Linux-based Apache
server), and it's a simple A HREF that goes straight to the file in the same
directory. No redirection or anything.

I tried it on an ADP1 and a G1, both on the T-Mobile network, and it didn't
work. The emulator worked fine. The symptoms point to a proxy.

On Mar 17, 2009 12:42 AM, "Al Sutton"  wrote:


Does the URL you're downloading from use a redirect or something similar
to get to the apk?

Many free file hosting or website hosting packages use a loading page
and some type of redirect (a Meta refresh tag being one example), and
there have been problems with those on the device (see
http://groups.google.com/group/android-developers/browse_thread/thread/b4fffb26e83d9653
for one example).

Al.

EboMike wrote: > I'm currently hosting an app on my own server so my beta
testers can > test it. I'...
--

* Written an Android App? - List it at http://andappstore.com/ *

==
Funky Android Limited is registered in England & Wales with the
company number  6741909. The registered head office is Kemp House,
152-160 City Road, London,  EC1V 2NX, UK.

The views expressed in this email are those of the author and not
necessarily those of Funky Android Limited, it's associates, or it's
subsidiaries.



--~--~-~--~~~---~--~~
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: Hosting APKs files on site works for emulator, but not device?

2009-03-17 Thread Al Sutton

Does the URL you're downloading from use a redirect or something similar 
to get to the apk?

Many free file hosting or website hosting packages use a loading page 
and some type of redirect (a Meta refresh tag being one example), and 
there have been problems with those on the device (see 
http://groups.google.com/group/android-developers/browse_thread/thread/b4fffb26e83d9653
 
for one example).

Al.

EboMike wrote:
> I'm currently hosting an app on my own server so my beta testers can
> test it. I've set up the apk MIME type to be application/
> vnd.android.package-archive, and when I try to download the app from
> the emulator, it downloads the 53KB apk file and installs it.
>
> When I try to do the same thing from a real ADP1 device, it only loads
> 43KB. When I try to install it, the system says that I'm trying to
> install an app that already exists (called "Android System") and that
> doesn't require any permissions, but nothing happens when I proceed.
> logcat tells me "D/asset   (16379): failed to open Zip archive '/
> sdcard/download/[name of the app].apk'
>
> Bonus points! When I try to download the app from the emulator, I can
> see that in the accesslog of my server. Not so when I download it from
> the device, even after deleting /sdcard/download/* and clearing the
> cache through the settings. Almost as if the device was loading an old
> copy from a proxy server. I'm not sure which APN I'm using, but none
> of the T-Mobile APNs have a proxy AFAICS.
>
> Is there a way to circumvent the proxy, assuming that this is the
> case? And/or tell the proxy not to cache this apk file?
>
> -Mike
>
>
> >
>   


-- 

* Written an Android App? - List it at http://andappstore.com/ *

==
Funky Android Limited is registered in England & Wales with the 
company number  6741909. The registered head office is Kemp House, 
152-160 City Road, London,  EC1V 2NX, UK. 

The views expressed in this email are those of the author and not 
necessarily those of Funky Android Limited, it's associates, or it's 
subsidiaries.


--~--~-~--~~~---~--~~
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] Hosting APKs files on site works for emulator, but not device?

2009-03-17 Thread EboMike

I'm currently hosting an app on my own server so my beta testers can
test it. I've set up the apk MIME type to be application/
vnd.android.package-archive, and when I try to download the app from
the emulator, it downloads the 53KB apk file and installs it.

When I try to do the same thing from a real ADP1 device, it only loads
43KB. When I try to install it, the system says that I'm trying to
install an app that already exists (called "Android System") and that
doesn't require any permissions, but nothing happens when I proceed.
logcat tells me "D/asset   (16379): failed to open Zip archive '/
sdcard/download/[name of the app].apk'

Bonus points! When I try to download the app from the emulator, I can
see that in the accesslog of my server. Not so when I download it from
the device, even after deleting /sdcard/download/* and clearing the
cache through the settings. Almost as if the device was loading an old
copy from a proxy server. I'm not sure which APN I'm using, but none
of the T-Mobile APNs have a proxy AFAICS.

Is there a way to circumvent the proxy, assuming that this is the
case? And/or tell the proxy not to cache this apk file?

-Mike


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



<    1   2