[android-developers] Re: How to override android device home button

2013-06-14 Thread Matt Kanninen
You would have to create a custom home-screen replacement application.
http://stackoverflow.com/questions/3666771/how-can-i-create-a-custom-home-screen-replacement-application-for-android

On Thursday, June 13, 2013 11:22:39 PM UTC-7, Sadhna Upadhyay wrote:
>
> Hi guys,
> 
>   can some one tell me that how to override  android 4.0,4.2 version 
> device home button.
>
> thanks in advance.
>
> sadhnan.
>
>  

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




[android-developers] Re: HI BROS

2013-01-01 Thread Matt Kanninen
OP's post needs better subject line.  I was expecting a happy new year 
message.

On Tuesday, January 1, 2013 2:22:49 PM UTC-8, Lew wrote:
>
> sree wrote:
>
>> After takeing two one dimensional arrays, i prepared one two dimensional 
>> array.like this way
>>
>> String [ ][ ] taskoutput=new 
>> String[prioritynamearray.length][taskvaluesarray.length];
>> then Loop is rotating like this way,
>>
>>
>> for (int s = 0; s > for (int t = 0; t > taskoutput[s][t]=here how can i add above two values into 2d arrays.
>>  }
>> }
>>
>>
>> PLEASE SEND ME REPLAY.
>>
>
> You don't need to keep posting the same question over and over. Did not 
> the other answers
> work for you? Have you replied to the questions in your other thread on 
> this exact matter?
>
> I spent a bit of time piecing together example code and links for you. Did 
> any of that help?
>
> -- 
> Lew
>  
>

-- 
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: optimized way to get large data from webservice(json or xml)

2012-10-09 Thread Matt Kanninen
Try:

http://stackoverflow.com/questions/10254872/download-sqlite-database-from-internet-and-load-into-android-application

-MK

On Tuesday, October 9, 2012 11:30:24 AM UTC-7, satyaandroid wrote:
>
> Hi  Friends..
>
> This is satya, new to android development, can anybody...
>
> fetching the data from json or xml format, ok..
>
> how can we achieve the the best optimized way to do this...
>
>
> thanks in advance...
>

-- 
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] Career for a Android Developer

2012-06-20 Thread Matt Kanninen
This is:

https://groups.google.com/forum/?fromgroups&pli=1#!forum/android-discuss

On Tuesday, June 19, 2012 6:43:58 AM UTC-7, Kristopher Micinski wrote:
>
> This is not the place to look for career advice or non development 
> related questions. 
>
> kris 
>
> On Tue, Jun 19, 2012 at 8:10 AM, Sandeep Venkat 
>  wrote: 
> > ofcourse i am a b.tech 2011 passout from the background of DOTNET 
> > development..Till now i don't know anything about android but my firm 
> wants 
> > me to get into android department..I want to put all my efforts in 
> android.. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Android Developers" group. 
> > To post to this group, send email to android-developers@googlegroups.com 
> > To unsubscribe from this group, send email to 
> > android-developers+unsubscr...@googlegroups.com 
> > For more options, visit this group at 
> > http://groups.google.com/group/android-developers?hl=en 
>

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

[android-developers] Re: lunch apps from native daemon

2012-05-31 Thread Matt Kanninen
The native daemon will automatically eat apps as needed to free up 
resources.

On Thursday, May 31, 2012 2:39:20 PM UTC-7, fan zhang wrote:
>
> Hi:
>  
> Is there any way to lunch applications from native daemon just like adb 
> shell command am does?
>  
> Thanks
>  
> Fan
>

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

2010-11-09 Thread Matt Kanninen
Per:

http://d.android.com/resources/dashboard/platform-versions.html

The current platform version distribution of devices accessing the
android market is:

Android 1.5 3   7.9%
Android 1.6 4   15.0%
Android 2.1 7   40.8%
Android 2.2 8   36.2%

With Android 1.5 only represents 8% it might be worth it to only
target 1.6 or higher.   I'm assuming you want to target 1.6 or higher
because of some API introduced in 1.6 that you want to use?

-MK

On Nov 9, 2:36 pm, Neilz  wrote:
> I have a number of apps, and so far I have supported all versions from
> level 3, android 1.5.
>
> For my latest app, I'm considering supporting only from 1.6, or
> possibly 2.1, upwards.
>
> What's the trend thesedays? Is it becoming usual, or acceptable, to
> adopt this strategy?

-- 
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: color banding. can't get over it :(

2010-10-29 Thread Matt Kanninen
Last time we had this problem the art guy used photoshop to pre dither
the art asset by adding noise.  It worked, but it made it look a
little grainy.

On Oct 29, 4:01 pm, Hatch  wrote:
> Seems my original post ("ugly pngs...") somehow disappeared :(
> nvm.
>
> I have a problem with a png resource that has gradient fade-out alpha.
>
> The png looks great in the emulator, but displays an artefact known as
> "color banding" (http://en.wikipedia.org/wiki/Colour_banding)
>
> Has anyone surpassed this issue ?
>
> My designer wants to trop a shadow behind his icons, and that's where
> the bands appear.
>
> What are my options ?
>
> Thanks
>
> Hatch
>
> BTW is there any way to see all my posts here on google groups ?

-- 
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: Bitmaps and OutOfMemoryError: Best Practices needed

2010-09-03 Thread Matt Kanninen
I found OutOfMemory Bitmap errors happened more frequently when I had
a compatibility mode set.  Although that was just on the Moto Droid,
on Android 2.1, back in December.

On Sep 3, 12:44 pm, "blahblah...@gmail.com" 
wrote:
> We can't split up the bitmap into smaller ones. It is a drawing
> program and we draw shapes to the offscreen bitmap. For now we have
> just put a gc() and recycle() before reallocating bitmaps, and also
> put a gc() at the end of onDestroy() as suggested in another thread.
> This is working so far, but I can see that running out of memory could
> be an issue in many other situations where you are dealing with large
> documents or graphics.
>
> On Sep 2, 8:07 pm, "EnjoyLifeHappyEveryday--Jay Meng"
>
>
>
>  wrote:
> > hey
> > blahblah...@gmail.com
>
> > We meet the same question,but we thought two ways to solve it:
> > 1> cutting up a big bitmaps into many small bitmaps, less than 2M of every 
> > bitmaps, and then splitting joint small bitmaps
> > 2> using virtual-point idea to call small bitmaps when is used at once and 
> > release small bitmaps when isn't used at once.
>
> > Hope it useful for you.
>
> > Best Regards.
>
> > Jay Meng
> > EnjoyLifeHappyEveryday
> > CodeCore Groups

-- 
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 check if the current thread is in the ui thread?

2010-07-15 Thread Matt Kanninen
Yeah I don't bother ever checking if I'm in the UI thread or not,
whenever it's an issue I just either spawn a new thread (for things I
don't want on the UI thread), or I explicitly start the execution onto
the UI thread.  It's simpler to put it on the path you want then to
check if you are already on it.

I like the UI method were you do very little work on the UI thread.  I
like to return immediately from onCreate with something, but start a
thread to do all my calculations, etc.  At the same time I try to keep
the number of threads low, basically one worker thread for each
activity.  Maybe one more thread for network calls.

My 2 cents,
-MK



On Jul 15, 7:56 am, TreKing  wrote:
> On Thu, Jul 15, 2010 at 8:15 AM, guich  wrote:
> > Hey, what about answering the original question?
>
> There's not built in way to do this, AFAIK. You could probably get away with
> saving a reference to the current thread in onCreate or somewhere you know
> is running in the main thread, then comparing against that. This is probably
> overkill.
>
> --- 
> --
> TreKing  - Chicago
> transit tracking app for Android-powered devices

-- 
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: What are the advantages of an Android Developers Device?

2010-06-29 Thread Matt Kanninen
If you want to trace "mass media hype driven by spending large sums of
cash" I suggest you compare how much Google has spent marketing
Android with how much Apple has spent marketing iOS.  I can't recall
the last Google funded Android commercial I saw on TV.

In terms of what platform you want to develop for, you may also wish
to compare recent sales numbers for iPhone to recent sales numbers for
Android devices.  If you are more convinced by existing market share
then current sales, I would suggest you compare either of those to
J2ME and BREW device sales.  While those 2 still greatly outnumber
smartphones, there is nothing stopping Android from cannibalizing the
feature phone market.

On the other hand, if you want money NOW, and you want to be an
independent application developer who depends directly upon immediate
sales, it does make sense to do iOS development.  If you can find
funding, and are willing to accept a lower rate of return now, but an
exponentially greater rate of return in the long run, I'd target
Android.  Either way, once you create an application that generates
you some revenue, you'll want to port it to the other platform, and
then to J2ME, Brew, etc.  Uniwar is a good example of that.

My 2 cents,
MK

On Jun 28, 11:22 am, "iC and iC++"  wrote:
> Do not waste you time with android. It is a mass media hype driven by
> google spending large sums of cash to create value where it does not
> exist. If I were you, I would stick with iPhone app development, as I
> can see a real future in that, especially if you like to get paid for
> your work.
>
> On Jun 28, 1:56 am, sagare  wrote:
>
>
>
> > Hi All,
>
> >        I saw thishttp://developer.android.com/guide/developing/device.html
> > and as per what i got the advantages of Android developer device is
> > that it is SIM unlocked and unlocked bootloader what i wanted to know
> > is are there any other advantages than this of the Android developers
> > Device?
>
> >           Also i want to know which device are all of the developers
> > using for developing their apps are they using only Android developers
> > device or any other device?
>
> >            Also i want to know whether Android developers device has
> > Android 2.1 update?
>
> >            Also i want to know is motorola droid a good device to be
> > selected for android application testing?
>
> > Please help me on this.
>
> > Thanks,
> > Sagar

-- 
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: You tube player class name

2010-05-24 Thread Matt Kanninen
One cannot depend upon access to Youtube, but it's a very common
feature request, and the Youtube player is preloaded.  It is dangerous
to use it, because it is undocumented.

Is there a preferred or standard way to load a youtube video?  Is it
better to send an intent to view a youtube url, giving the youtube app
the option over riding the behavior?  Should the url be to the regular
youtube page, an internal link to the video, or a link to the mobile
page?

Youtube could also detect the device server side and serve appropriate
content to the web browser, including a link to their app.

-MK

On May 24, 5:00 am, Mark Murphy  wrote:
> zohar lerman wrote:
> > I hold youtube url (http://www.youtube.com/watch?v=dMH0bHeiRNg) and i
> > want to show it directly in youtube player without opening the browser
> > first?
>
> Note that if Google wanted you to access the YouTube player directly,
> they would have documented it here:
>
> http://developer.android.com/guide/appendix/g-app-intents.html
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, One Low Price!
>
> --
> 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 
> athttp://groups.google.com/group/android-developers?hl=en

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


[android-developers] Re: Force no scaling on web page

2010-05-24 Thread Matt Kanninen
I am also curious.

On May 24, 2:15 am, ebisudave  wrote:
> Android Developers,
>
> I am developing a web page that is designed for viewing on an Android
> phone.
>
> The width is fixed at 320 pixels.
>
> For some reason, when I view my web page on my Android phone (HT-03A),
> it scales the page down, so there is all sorts of extra space on the
> right of the viewport.
>
> I just want the page to remain at a pixel ration of 1:1. No scaling.
> Just leave it as it is.
>
> After searching on the web, I came across some meta tags which, I
> think, should force the Android to leave the web page alone:
>
> 
>
> However, the Android still insists on changing the scale of the web
> page.
>
> How can I get Android to not scale my web page? I want one pixel to be
> one pixel, and leave it at that.
>
> Thank you for any advice.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

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


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

2010-05-06 Thread Matt Kanninen
k when given at runtime.
> <http://groups.google.com/group/android-developers/t/6863650ee337395d>
>
> Alok Kulkarni  May 05 09:36PM +0530 ^ <>
>
> Hi guys,
> I am having an EditText. If i specify image for the EditText in the layout
> XML file (android:background) it looks different and looks different when i
> specify it at runtime more...
> <http://groups.google.com/group/android-developers/msg/3768b25a6ce7ac52>
>
> Kumar Bibek  May 05 11:58AM -0700 ^ <>
>
> What do you mean by compile time? If you mean the layout that the
> Layout Editor shows, you might not always get the right results.
>
> But, as far as I know, both ways should produce the same results. more...
> <http://groups.google.com/group/android-developers/msg/5ed4cc6305d58c94>
>
>  Topic: Widget Auto Install
> <http://groups.google.com/group/android-developers/t/8f625ab9b36644f3>
>
> fr4gus  May 05 10:08AM -0700 ^ <>
>
> I've been asked by a client if it's possible to install automatically
> a Widget just after an application is installed (to avoid the user
> place the widget in the home screen). Is it possible? My more...
> <http://groups.google.com/group/android-developers/msg/9bbdf62e118a090d>
>
> Kumar Bibek  May 05 11:55AM -0700 ^ <>
>
> No, Not possible.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to more...
> <http://groups.google.com/group/android-developers/msg/22f2a8757d161600>
>
>  Topic: Adding child views
> <http://groups.google.com/group/android-developers/t/92ccb51f358acbbe>
>
> John Gaby  May 05 08:26AM -0700 ^ <>
>
> I am new to Android development. I would like to be able to add child
> views (e.g. buttons, text, etc.) to my main view at runtime, and to be
> able to position and size those views dynamically. more...
> <http://groups.google.com/group/android-developers/msg/7dffce78d20bf0c>
>
> TreKing  May 05 10:47AM -0500 ^ <>
>
> > layout.add(tv);
>
> I think you want 
> this:http://developer.android.com/intl/fr/reference/android/view/ViewGroup...
> ddView(android.view.View,
> android.view.ViewGroup.LayoutParams)
> more...
> <http://groups.google.com/group/android-developers/msg/c3228e0c66b19453>
>
> social hub  May 05 10:42AM -0500 ^ <>
>
> You basically need a context to create and possibly a layout to add
>
> TextView tv = new TextView(mContext);//context can be an activity or u can
> use getBaseContext();
> tv.setLayoutParams(new more...
> <http://groups.google.com/group/android-developers/msg/c9e790ef73608c0f>
>
> John Gaby  May 05 09:14AM -0700 ^ <>
>
> Thanks for the response. I want to be able to set both the size and
> position of the child view. It seems like in order to do that I would
> need to use AbsoluteLayout which is deprecated. more...
> <http://groups.google.com/group/android-developers/msg/4f608549341e7486>
>
> John Gaby  May 05 09:15AM -0700 ^ <>
>
> Thanks for the response. I cannot instantiate the ViewGroup class.
> Do I have to create my own layout class based on ViewGroup to get what
> I want?
>
> Thanks.
>
> --
> You received this message more...
> <http://groups.google.com/group/android-developers/msg/225978fee2a6ab96>
>
> "Kostya Vasilyev"  May 05 08:21PM +0400 ^ <>
>
> AbsoluteLayout can be replaced by RelativeLayout.
>
> Use android:layout_marginLeft and android:layout_marginTop in the child
> view to position it.
>
> -- Kostya
>
> PS - Why they got rid of more...
> <http://groups.google.com/group/android-developers/msg/f2b2b0f181d8251>
>
> John Gaby  May 05 09:46AM -0700 ^ <>
>
> Thanks for the response, but I am still at a loss. I don't see how to
> set the marginLeft and marginTop for a child view. Here is what I
> have:
>
> public class HelloAndroid extends Activity { more...
> <http://groups.google.com/group/android-developers/msg/aef65eb934b19a25>
>
> TreKing  May 05 12:34PM -0500 ^ <>
>
> > Now this will display my text, but if I want to set the absolute position
> > of the text, what would I do?
>
> Why do you need absolute positioning? There are many devices with varying
> more...
> <http://groups.google.com/group/android-developers/msg/5c6dda79c515f71c>
>
> John Gaby  May 05 11:12AM -0700 ^ <>
>
> Actually, the size of the display would be taken into consideration.
> I merely want to be able to have precise control over the placement of
> the views. Actually, I have been able to get it to work more...
> <http

[android-developers] Re: XMPP service, jabber , push notification

2010-05-05 Thread Matt Kanninen
It's hard to download an application from the Android Market without
having a google account registered on the phone, it's hard to have a
google account without a gmail account.

I don't think there are many Android users who don't have a google
account.  There are probably some that have turned off google account
synching though.

On Apr 21, 1:36 pm, Bob Kerns  wrote:
> Um, why do you assume every Android user has a gmail account?
>
> On Apr 21, 1:17 am, SLY  wrote:
>
>
>
>
>
> > Hi,
> > I am currently working on a project which requires a server to request
> > data from the devices which are currently connected to the server.
> > Meaning, first the server finds out which devices are connected to the
> > server and then sends an application specific message to the client
> > device which should wake certain functionality present on the client,
> > like for example send out its current location.
>
> > I was looking into XMPP service which looked promising since it works
> > as a PUSH notification. The  in XMPP can be used to check if
> > the device is currently connected and has subscribed to the server.
> > Since every android user has a gmail account, I was thinking of using
> > the gmail xmpp service to connect /subscribe to the server. Then send
> > specific message to the client, i.e x...@gmail.com. But if a message is
> > sent this way the client app gets the message as well as the native
> > gtalk client. So how do I go about intercepting this so that it
> > doesn't show up on the gtalk client but my app still gets it.
>
> > I want the PUSH notification to work, not PUSH.
>
> > Please do comment on the above approach. If there is another way to do
> > this, please do suggest.
>
> > - SLY
>
> > --
> > 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 
> > athttp://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

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


[android-developers] Re: Lots of lost sales due to Credit Card authorization.

2010-05-04 Thread Matt Kanninen
I would suggest you post a thread discussing the issue on Android
Developers, as you have already done.  There is also help and support
for the market application itself, I don't have the link handy.

You can't actually make Google do anything, but it wouldn't surprise
me if this is the sort of thing they have already thought long and
hard about, but their many lawyers and bizdev types will have to
completely grok the problem before anything is done.


On May 4, 9:40 am, Paul  wrote:
> Here's a perfect example, just got this one today:
>
> " will not download. It says its purchased but unsuccessful
> downloading. What do I do?" (replace  with the name of the app the
> user is trying to download).
>
> This has to get fixed. All user needs is some notification in Android
> Market to let them know what is going on and how to correct it.
>
> How do we get Google/Android Market Development team to take care of
> this?
>
> --
> 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 
> athttp://groups.google.com/group/android-developers?hl=en

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


[android-developers] Re: Access active window from a background service

2010-05-04 Thread Matt Kanninen
I hope not.

On May 4, 10:10 am, Tudor Tihan  wrote:
> Is there a way to access the currently active window belonging to a
> different process from a background service and be allowed to modify
> some of its properties such as the transparency ?
>
> --
> 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 
> athttp://groups.google.com/group/android-developers?hl=en

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


[android-developers] Re: Is it possible to start an Activity from a non-context class?

2010-05-04 Thread Matt Kanninen
Yeah thats what I usually do.  I'm also a fan of static methods that
get passed a Context object.  You can also have your application or
activities extend an interface, and have your methods expect that
interface.

The important thing is that your utility code trigger an execution
thread, with access to the right context.


I have a related question.  What are the consequences, and best
practices, of starting activities from a non activity context?  The
documentation says:

http://developer.android.com/reference/android/content/Context.html#startActivity(android.content.Intent)
"
Note that if this method is being called from outside of an Activity
Context, then the Intent must include the FLAG_ACTIVITY_NEW_TASK
launch flag. This is because, without being started from an existing
Activity, there is no existing task in which to place the new activity
and thus it needs to be placed in its own separate task.
"
This seems to work, but I'm betting it has some interaction with
http://developer.android.com/guide/topics/manifest/activity-element.html
android:launchMode

but that already confuses me...

-MK


On May 4, 8:42 am, Timo Prill  wrote:
> just pass your context over to the utility class via getter/setter or in
> constructor...
>
> Am 04.05.2010 17:40, schrieb TreKing:
>
>
>
>
>
> > On Tue, May 4, 2010 at 2:02 AM, Michael J  > > wrote:
>
> >     For example, I have an activity that uses a utility class.  I
> >     would like to be able to start an activity from the utility class
> >     and have the activity result sent back to the utility class.
>
> > Why are you doing this? What purpose is your utility class serving
> > that it requires starting and retrieving data from another activity?
>
> > --- 
> > --
> > TreKing - Chicago transit tracking app for Android-powered devices
> >http://sites.google.com/site/rezmobileapps/treking
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

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


[android-developers] Re: private input method

2010-04-29 Thread Matt Kanninen
Thanks Mark.  That really surprises me, but from examination of the
API's I came to the same conclusion.  Do you think I could achieve a
similar effect by simply reusing the related views, like:

http://d.android.com/reference/android/inputmethodservice/KeyboardView.html

?



On Apr 29, 10:06 am, Mark Murphy  wrote:
> Matt Kanninen wrote:
> > Can I create an input method that is private, not available to other
> > applications on the phone?
>
> Not that I am aware of, at least through the standard IME system.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Training in US: 14-18 June 2010:http://bignerdranch.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 
> athttp://groups.google.com/group/android-developers?hl=en

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


[android-developers] private input method

2010-04-29 Thread Matt Kanninen
Can I create an input method that is private, not available to other
applications on the phone?

-- 
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: Unit Testing : Who uses it ?

2010-04-21 Thread Matt Kanninen
I find that most of my problems are device or user specific issues.
So to be useful, the unit tests would have to run on the actual
hardware used by consumers, and would have to emulate the behavior of
real users.

Years ago, when I had to write a small bit of generic java code for
server side logging, reporting, and metrics, that was going to be used
for lots of different purposes, we used test driven development, and I
was glad for the experience.

So basically, I suggest you use the right tool to ensure the right
level of quality for each specific project.

On Mar 11, 1:36 pm, DulcetTone  wrote:
> I routinely find a disproportionate number of my bugs and crashes
> reside in the code set up for the purpose of testing and evaluation of
> the program rather in the function of the program itself.
>
> I'm sure this is a measure of my unfamiliarity with "best practices",
> but I find it more beneficial to try to write crash-detection-and-
> reporting code rather than explore testing.  That said, I am not
> inspired to look at junit.org
>
> tone

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

2010-04-21 Thread Matt Kanninen
I've been told that my applications will be useless until they allow
the user to make toast.

In theory Symbian is being open sourced, and in theory Android is
already open source, so as time goes by it should be easier to get
them to inter operate.

Also, Nokia does have a linux platfom, Maemo, so you might have more
luck there.

My 2 cents,
-MK

On Apr 21, 4:27 am, Disconnect  wrote:
> I read somewhere that android would give my car better gas milage. Chirayu,
> can you explain to me how that works?
>
>
>
>
>
> On Wed, Apr 21, 2010 at 7:00 AM, Max Gilead  wrote:
> > On 21 April 2010 11:52, Chirayu Dalwadi  wrote:
>
> >> javame_android's reply was perfect. But i was annoyed by Disconnect's
> >> reply
>
> > Welcome to the internet ;) You may need to grow a thick skin and keep your
> > head cool if you want to talk on tech forums :)
>
> >  --
> > 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 > cr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

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


[android-developers] Re: OutOfMemoryError: how best to transfer large video files into a byte array?

2010-04-21 Thread Matt Kanninen
I think you are on the right track.  I have had very similar problems
in the past.  For me the temporary file solution was obvious because I
had to modify the media before I uploaded it.  Once you have a
temporary file, then you have the generic problem of uploading a large
file to a web server, and you aren't using don't need any Android
specific code.

It also makes it much easier if there are interstitial pages, multiple
activities client side that will need to access the temporary media
file, (perhaps to display a preview), and you can handle low memory
conditions better.  The more Android development I do the more I find
myself writing to private local storage, to make sure I never lose
state.

On Apr 21, 9:02 am, Android Development  wrote:
> Select a fixed buffer size first.
>
> Then start writing the byte array to a file. Once the file size reaches the
> buffer size configured, copy that file to a temporary location (a temp
> file). Then transfer this temp file to the web server. Once transferred
> successfully, make sure to delete this temp file (by calling deleteOnExit()
> ) when the file was created.
>
> To make this work properly, there have to be 2 threads at work  - the thread
> that is writing the byte array to a file and the thread that is doing the
> heavy duty stuff in the background - copy to the temp file location and
> finally upload it to a server etc. This heavy duty thread waits on a
> condition (waits for the file to reach the buffer size configured to start
> the transfer).
>
> I hope this makes sense...just sharing my thoughts aloud.
>
> Best Regards
> Indodroid.
>
> On Sat, Apr 10, 2010 at 12:19 AM, Anna Powell-Smith <
>
>
>
>
>
> annapowellsm...@googlemail.com> wrote:
>
> > On 9 April 2010 19:35, Anna Powell-Smith 
> > wrote:
>
> >> On 9 April 2010 18:19, Gubatron  wrote:
>
> >>> I suppose when you say FilePart, you mean this
>
> >>> org.apache.commons.httpclient.methods.multipart.FilePart
>
> >>> I'm thinking along these lines after looking at that API (I haven't
> >>> tested this)
>
> >>> final File theFile = new File("yourFileLargerThan2Mb.ext");
>
> >>> //Implement your own PartSource to feed your File
> >>> PartSource  partSource = new PartSource() {
> >>>   //this should return a buffered reader... right?
> >>>   public InputStream createInputStream() {
> >>>      return BufferedInputStream (new FileInputStream(theFile));
> >>>   }
>
> >>>   //implement the other methods of the interface
> >>>   public String getFileName() {
> >>>     return theFile.getName();
> >>>   }
>
> >>>   public long getLength() {
> >>>     return theFile.length();// although this might be how much is
> >>> left on the stream, not sure.
> >>>   }
>
> >>> }
>
> >>> FilePart part = FilePart(theFileName, partSource);
>
> >>> then use your part on your multipart request.
>
> >> Thanks. Constructing a FilePart from a File is actually as easy as this, I
> >> think - but do you think your method would provide some advantage?
>
> >>     File temp_file = new File(Environment.getExternalStorageDirectory(),
> >>  "myfile.gif");
> >>     FilePart vFile = new FilePart("fileupload", temp_file);
>
> >> As I say, this works for files of 50MB. The only reason I can't use it is
> >> that I can't construct a File object from an Android content Uri. I have to
> >> use an Android content Uri because that's what the video intent returns.
>
> > Ah. If I could transform my content Uri into FileInputStream (will have to
> > experiment) then I could use your method.
>
> > I can convert a content Uri to an InputStream already, so it'll just be
> > getting from an InputStream to a FileInputStream that might be the
> > challenge. I'll experiment.
>
> > --
> > 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 > cr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

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


[android-developers] Re: How to stay backwards and forwards compatible - targetSDKVersion, hdpi, minSDKVersion?

2010-04-16 Thread Matt Kanninen
On Apr 16, 3:31 pm, Dianne Hackborn  wrote:
> > 3. Even if I leave out the targetSdkVersion="4", the app runs ok. So
> > do I really need it?
>
> You do if you want the system to run your app as well as possible on SDK 4
> or later.

The worst bug I've had so far in Android development was an out of
memory that showed up when I used targetSdkVersion="X".  It took quite
awhile to figure out that was the culprit, and when I removed it I
didn't see any out of memory problems at all.  The problems showed up
on the Motorola Droid, late last year.   I spent a lot of time
optimizing my own memory usage to try and fix it, but removing
targetSdkVersion="X" worked best.

My 2 cents,
-MK

-- 
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: Your feedback on Samples/Tutorials/Articles

2010-04-09 Thread Matt Kanninen
I've been using Sidewiki, it's an easy way to comment on problems with
documentation, it's almost as good as directly fixing the docs myself.

On Mar 25, 12:41 pm, "Fred Grott(Android Expert, 
http://mobilebytes.wordpress.com)"
 wrote:
> Might I make suggestion?
>
> Several of us had this idea before..but for some reason Google at that
> time was not showing interest..
>
> Fred Grott
> Mark Murphy
> Al Sutton
> Nicolas, owner of anddev.org and CS student in Germany
>
> and others have suggested before to use the Google Knol service as a
> way to get article contributions as a way to improve this area..
> Google Knol services already has the collaboration structure in place
>
> Mark Murphy's and My knols are already marked with the android-
> programming tags
>
> Si there any reason not to use this Google Knol service for such a
> use?
>
> In fact why not set up a contest, highest viewed Android Tutorial
> knols get a Nexus One..
>
> On Mar 18, 5:38 pm, Megha Joshi  wrote:
>
>
>
> > Hi everyone,
>
> > As many of you might have noticed by now, we have added a new
> > Resourcestab under
> > developer.android.com. It contains samples, tutorials and technical
> > articles. We want your feedback to add more samples and tutorials to
> > it.. Please add/vote topics for new samples and tutorials at the link
> > here.
> > Please be very specific (like mentioning API or package or feature or tool
> > names) when you submit a suggestion.
>
> > Thanks for your feedback in helping us improve our Android developer
> > resources.
>
> > -Megha

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

To unsubscribe, reply using "remove me" as the subject.


[android-developers] Re: How to start an Activity from a Service and getting a result from it

2010-03-26 Thread Matt Kanninen
Sorry about resurrecting an old thread, but really?  All resources
from all APK's are public to all APK's at all times?

Could yall post a new blog post about how to write secure Android
applications? ;)

How about assets?  And whats the deal with the stuff that ends up in
your assets folder that you didn't put there?

On Feb 16, 2:04 pm, Dianne Hackborn  wrote:
> On Mon, Feb 15, 2010 at 4:37 PM, jotobjects  wrote:
> > Are the resources of the another application package essentially
> > public - can any application call Context.createPackageContext() to
> > get the context of a different application?
>
> Yep all resources are public.  This allows other applications to display
> your icons and labels (such as when you appear in a picker), inflate your
> layout for app widgets, etc.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


[android-developers] Re: Game Developers: Some general questions about high scores, achievements, multi player support and in game ads.

2010-03-26 Thread Matt Kanninen
They surveyed 108 developers.

On Mar 25, 8:55 pm, Kevin Duffey  wrote:
> 108 of what? I read the link..didn't see anything about 108?
>
> I don't know that google isn't too keen on monetizing android..they bought
> admob after all and a lot of apps on android use that to make money, so they
> get a bit from there. I think they are nuts NOT to provide an android SDK
> for billing customers for in-app purchases, be it music, themes, or game
> characters or new maps... take 25% of that and google could probably retire
> most of their staff in a few years time from the money they'll make.
>
>
>
> On Thu, Mar 25, 2010 at 5:49 PM, Matt Kanninen  wrote:
> > On Mar 17, 8:54 pm, Kevin Duffey  wrote:
> > > I still do not
> > > understand for the life of me why google (and even iPhone) did NOT make
> > this
> > > charge directly to the carrier bill.
>
> > Carrier billing is very hard to do.  I don't think Google is rushing
> > to monetize Android.  Honestly I don't think anyone should rush to
> > monetize Android.  There will be plenty of money for us all to share.
> > At my local Mall I visited a Sprint store, a T-Mobile store, a Verizon
> > kiosk, and an ATT kiosk.  They were were all willing to sell me
> > Android phones.
>
> > The ATT Kiosk guy had no idea what Android was, and he couldn't demo
> > his phone, but he could sell it.
>
> > The T-Mobile Store guy said he's selling mostly smart phones, and
> > those are mostly Android.  They don't sell HotSpot @Home phones
> > anymore, I miss those dearly.
> >http://en.wikipedia.org/wiki/Generic_Access_Networkor
> >http://en.wikipedia.org/wiki/Unlicensed_Mobile_Access
>
> > The Sprint Store guy said he was selling plenty of the Samsung Android
> > device.
>
> > The Verizon Kiosk girl said she was selling Droids, and that she did
> > not yet have Devour's in stock, but the bigger store.
>
> > Have yall read this?
>
> >http://metrics.admob.com/
>
> > were you one of the 108?  I think I was.
>
> > -My 2 cents,
> > MK
>
> > PS Enjoy the lack of carrier billing while everything is free.  Enjoy
> > free tethering, for example.  As soon as there is carrier billing, on
> > android, with monthly subscriptions, I expect them to charge for
> > tethering.  I'm not sure what that means for people like me that have
> > paid for the improved version of PDA Net.  (I wanted my https.)
>
> > --
> > 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 > cr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> > To unsubscribe from this group, send email to android-developers+
> > unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> > ME" as the subject.

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


[android-developers] Re: Possible to finish() my activity when Home is pressed?

2010-03-26 Thread Matt Kanninen
Um, isn't an activity pause any time it's display is no longer
displayed?  Home is a special activity, but it's still an activity?
When does onPause get called then?

On Mar 25, 9:29 pm, Guru  wrote:
> < activity in response to Home key presses, but I think you can get it
> to call finish in all cases where the Home button is pressed.>>
>
> The Home Button is not interpreted by the application ,so it is not possible
> for the app to call the finish on click of Home.The Home Button is basically
> designed for the user to goto the phone's desktop(which the user is
> familiar).
>
>
>
> On Fri, Mar 26, 2010 at 5:52 AM, Matt Kanninen  wrote:
> > I think onPause is called.  It will be hard to only close your
> > activity in response to Home key presses, but I think you can get it
> > to call finish in all cases where the Home button is pressed.
>
> > On Mar 25, 11:52 am, paladin  wrote:
> > > I saw another thread related to this question, but did not find the
> > > answer that was useful to me. Is it possible when the user presses the
> > > Home button to be able to finish() my activity somewhere? I saw that
> > > people were having problems with using onStop(). Has anyone found a
> > > resolution to see if this is always called on Home being pressed?
>
> > --
> > 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 > cr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> > To unsubscribe from this group, send email to android-developers+
> > unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> > ME" as the subject.

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


[android-developers] Re: GK: Urgent -- Combine all the multiple apks in one APK file

2010-03-25 Thread Matt Kanninen
If you don't plan to submit to the Android Market, then its easy.  You
write an APK, that consists of one activity, with 4 buttons.  Each
button launches the browser to download and install each of the APKs
you were going to package together.

On Mar 25, 10:24 am, Kevin Duffey  wrote:
> To add to what Mark says, if you were to actually take 4 separate APK games,
> combine them into a single project (copy their /src folders into one /src
> folder in the new single project), build it and all the code compiles.. but
> now you will have 4 launchers (one from each APK). You will need to create a
> new launcher for the one APK and have some sort of menu option to select
> which game to run. Then, send the intent to launch the specific game/APK
> launcher as if it were started directly by Android on launch. You may need
> to combine other elements as well. Basically you're doing what someone like
> Namco has done with their Namco Museum games.. where you buy one installable
> game pack, and it offers a menu selection of some sort to choose which game
> you want to play. Is this what you are trying to do?
>
>
>
> On Thu, Mar 25, 2010 at 6:28 AM, Yahel  wrote:
> > > On Android portal there is option to upload single APK for all
> > > devices.
>
> > Since I think Mark's answer is clear about the fact that ONE APK = ONE
> > GAME, and that if you want all your games under one APK, you need to
> > recombine them all into one single app, that you will ship as one APK,
> > maybe we just don't understand your problem.
>
> > Maybe it as more of a market question : You can upload as many apk as
> > you like, but one at a time. They will be seen on the market as
> > several apps. But you are not limited to one game on the market, you
> > can upload as many as you want, just one at a time.
>
> > Yahel
>
> > --
> > 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 > cr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> > To unsubscribe from this group, send email to android-developers+
> > unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> > ME" as the subject.

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


[android-developers] Re: Game Developers: Some general questions about high scores, achievements, multi player support and in game ads.

2010-03-25 Thread Matt Kanninen
On Mar 17, 8:54 pm, Kevin Duffey  wrote:
> I still do not
> understand for the life of me why google (and even iPhone) did NOT make this
> charge directly to the carrier bill.


Carrier billing is very hard to do.  I don't think Google is rushing
to monetize Android.  Honestly I don't think anyone should rush to
monetize Android.  There will be plenty of money for us all to share.
At my local Mall I visited a Sprint store, a T-Mobile store, a Verizon
kiosk, and an ATT kiosk.  They were were all willing to sell me
Android phones.

The ATT Kiosk guy had no idea what Android was, and he couldn't demo
his phone, but he could sell it.

The T-Mobile Store guy said he's selling mostly smart phones, and
those are mostly Android.  They don't sell HotSpot @Home phones
anymore, I miss those dearly.
http://en.wikipedia.org/wiki/Generic_Access_Network or
http://en.wikipedia.org/wiki/Unlicensed_Mobile_Access

The Sprint Store guy said he was selling plenty of the Samsung Android
device.

The Verizon Kiosk girl said she was selling Droids, and that she did
not yet have Devour's in stock, but the bigger store.

Have yall read this?

http://metrics.admob.com/

were you one of the 108?  I think I was.

-My 2 cents,
MK


PS Enjoy the lack of carrier billing while everything is free.  Enjoy
free tethering, for example.  As soon as there is carrier billing, on
android, with monthly subscriptions, I expect them to charge for
tethering.  I'm not sure what that means for people like me that have
paid for the improved version of PDA Net.  (I wanted my https.)

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


[android-developers] Re: Possible to finish() my activity when Home is pressed?

2010-03-25 Thread Matt Kanninen
I think onPause is called.  It will be hard to only close your
activity in response to Home key presses, but I think you can get it
to call finish in all cases where the Home button is pressed.

On Mar 25, 11:52 am, paladin  wrote:
> I saw another thread related to this question, but did not find the
> answer that was useful to me. Is it possible when the user presses the
> Home button to be able to finish() my activity somewhere? I saw that
> people were having problems with using onStop(). Has anyone found a
> resolution to see if this is always called on Home being pressed?

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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.


[android-developers] Re: Do Cursors provide write access?

2010-03-16 Thread Matt Kanninen
Yeah getting the Android documentation updated would be one of my
highest priorities.  I waisted a day proving to myself it was wrong.

My goal was to have a ListView, with items in the ListView grouped by
first letter.  Seemed easy, but the best way I could think of was to
add 2 database columns, one with what grouping an entry counts as (in
case we use a more complicated localized algorithm then the first
letter in the string), and one with a groupingrank, which only matters
for determining whether an entry is the first entry in a group..  I
could not find a better way to do it then to go through each entry in
the sorted cursor, calling

context.getContentResolver().update(

for any row that does not yet have it's grouping and groupingrank set
properly.

then in my ListView's Adapter I have a view which is invisible unless
it is the first row in a group, and then it's group (the Letter A for
example) would appear looking like a section header.

So it would be
A
Aardvark
Android
Anteater
B
Bear
C
CyberBear
M
MutantCyberBear


where

A
Aardvark

is really a single row in the ListView.


On Mar 16, 10:58 am, Mark Murphy  wrote:
> Matt Kanninen wrote:
> > This page:
>
> >http://developer.android.com/reference/android/database/Cursor.html
>
> > says:
>
> > "This interface provides random read-write access to the result set
> > returned by a database query."
>
> > but I can't find any way to update a database with a cursor.
>
> That document is somewhat out of date. You used to be able to modify the
> database using a Cursor, but that got dropped somewhere before Android 1.0.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Consulting/App Development:http://commonsware.com/consulting

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


[android-developers] Do Cursors provide write access?

2010-03-16 Thread Matt Kanninen
This page:

http://developer.android.com/reference/android/database/Cursor.html

says:

"This interface provides random read-write access to the result set
returned by a database query."

but I can't find any way to update a database with a cursor.

-MK

PS I have started noting things like this as a sidewiki entry for the
documentation page, like so:

http://www.google.com/sidewiki/entry/mathiastck/id/QjAEe_iUbNB7b8fgNGTxUftHQEI

-- 
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 detect when android kill my process?

2010-03-09 Thread Matt Kanninen
Streets is right, and gives good practical advice, as usual.  I do the
same, if it's important, it has a getter and a setter.  The getter
checks for null, if it's null it gets from local storage, be it a
preference, a file, an sqlite db, or it makes a new network call.
Then it gets set to local storage.

I do this with the response from most network calls, but definitely
the first important one.  Also with any user preference set in
settings, etc.

On Mar 9, 1:37 pm, Streets Of Boston  wrote:
> Try to avoid subclassing the Application class.
> Just use static variables. Initialize them to null/0/whatever and
> check them in the onCreate of your activity. If these are null/0/
> whatever, initialize these static variable properly and continue. But
> re-initializing them *won't maintain* state. After you process has
> been killed, your state is reset. You can use static variables to
> share state between multiple activities in your app (as long as
> they're started in the same process).
>
> If you want to maintain state over configuration changes (e.g. slide
> out keyboard, orientation changes), use the activity's
> onRetainNonConfigurationInstance method.
>
> If you want to maintain state even if your process has been killed,
> use the activity's onSaveInstanceState method (and related methods).
>
> On Mar 9, 5:59 am, miguelo  wrote:
>
>
>
> > Hi, thanks for your help. I have read about how to save and restore
> > the status of an activity (onSavedInstanceState(),
> > onRestoreInstanceState(), ...)
>
> > My problem is I'm extending the android.app.Application class, which
> > is a "base class for those who need to maintain global application
> > state" and I'm using it to maintain some global data (user logged in,
> > DB helper, ...). These are the data I'm losing if I leave my
> > application opened and after a few hours I return to it. I'm able to
> > restore the specific data of the running activity but not these global
> > data.
>
> > I don't know if I'm using a bad practice (and in that case which is
> > the recommended approach to store global application state), and if
> > that's the correct place to do it, how can I save/restore those data
> > when my process is killed/restarted.
>
> > Thanks,
>
> > Miguel
>
> > On 8 mar, 17:22, TreKing  wrote:
> > ...
>
> > > Did you readed about onSavedInstanceState and onRestoreInstanceState ?
>
> > ...

-- 
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: List adapter: failing to recycle views = lots of memory allocated?

2010-03-02 Thread Matt Kanninen
Con how often does Mark ask for help?  I hope someone has already
dropped him a line.

On Mar 2, 11:01 am, Mark Murphy  wrote:
> Romain Guy wrote:
> > That's sad :(
>
> :: shrug ::
>
> It's going to take a metric buttload of work for me to navigate the
> whole process, in particular figuring out everything the site
> instructions don't tell me. If I'm going to do that work, I'm going to
> do it seriously, which means not just to fix an old SDK sample. I need
> to get more bang for my proverbial buck, so to speak.
>
> Besides, writing an Android book isn't as big a hurdle for me as it
> might be for most people. :-)
>
> That being said, if there's anyone reading this thread that is
> contributing to Android through the public process, who wouldn't mind me
> kibitzing a bit, drop me a line.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Development Wiki:http://wiki.andmob.org

-- 
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: Device Seeding Program for Top Android Market Developers

2010-03-02 Thread Matt Kanninen
On Mar 2, 8:31 pm, Rob Franz  wrote:
> This is win for developers.  So much better testing on a real phone than an
> emulator.

Nuff said.

-- 
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] New Android Project -> Create from existing source -> Unhandled event loop exception, java.lang.StackOverflowError

2010-02-23 Thread Matt Kanninen
This work flow is causing Eclipse to give me:

Unhandled event loop exception
java.lang.StackOverflowError


Looking at the eclipse log it gives just a bit more information:

Unhandled event loop exception java.lang.StackOverflowError
org.eclipse.ui


I am running:

Eclipse IDE for Java Developers 1.2.1.20090918-0703 epp.package.java

I tried re downloading eclipse, re installing the ADT plugin, using a
new workspace, same problem.


I am running a Dell Studio XPS 8100 64-bit Operating system with
Windows 7 Home Premium.


I can work around this by doing File -> Import rather then File -> New.

-- 
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: IP Adress of android device

2010-02-12 Thread Matt Kanninen
I highly recommend you don't do Client to Client communcications if
you can avoid it.  You should do Client - Server - Client.  There are
lots of free server side options.  I like App Enginer myself, but I
have not had to do server side work since 2006.

On Jan 28, 5:13 pm, Tony  wrote:
> Bob Kerns and WoodManEXP  ,thank you very much.
>
> Now ,I know what should I do next step,  Maybe ,I need more information on
> network  than  android platform itself.
> so ,I 've decided to read more about  network online. I am engaging in sip
> development on android platfor ,  and I have wrote a sample  in sip, so I
> need to test its function .
>
>  thank you  for your advices.
>
> Best regards.
>
> 2010/1/28 WoodManEXP 
>
>
>
> > Yea, trying to communicate between any two Androids, or any devices
> > for that matter, using their IP address is probably going to be next
> > to impossible, in the general case.
>
> > It would work OK inside an intranet where IP addresses are less
> > volatile (like the way controllers communicate with robots over a
> > local wireless LAN). Even then the devices are configured to have
> > predetermined, unchanging IP addresses.
>
> > Like Bob Kerns says you may way to consider using a server as
> > intermediary, much the same way that instant messaging works. A
> > reasonably dependable connection can be established between a server
> > and the Android and then the server can pass messages between the two.
>
> > If the Androids are in close proximity, like in the same small room,
> > take a look at Bluetooth for establishing a connection. That works
> > really well in such cases.
>
> > BTW, you can determine an Android's IP address like this:
>
> >        public String getLocalIpAddress() {
> >            try {
> >                for (Enumeration en =
> > NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) {
> >                    NetworkInterface intf = en.nextElement();
> >                    for (Enumeration enumIpAddr =
> > intf.getInetAddresses(); enumIpAddr.hasMoreElements();) {
> >                        InetAddress inetAddress = enumIpAddr.nextElement();
> >                        if (!inetAddress.isLoopbackAddress()) {
> >                            return inetAddress.getHostAddress().toString();
> >                        }
> >                    }
> >                }
> >            } catch (SocketException ex) {
> >            }
> >            return null;
> >        }
>
> > But it is mostly useless as it is usually known only to the nearest
> > DHCP server and not outside that sphere.
>
> > On Jan 28, 7:44 am, Bob Kerns  wrote:
> > > The IP addresses will be whatever the DHCP server on that subnet says
> > > they should be. Often, the DHCP server role will be handled by your
> > > router to the internet, but in a corporate environment, things may be
> > > more complicated.
>
> > > When a device connects to an IP network, it usually broadcasts "who am
> > > I?", and a DHCP server then tells it basic stuff like it's IP address.
> > > This can be a pre-allocated address assigned to that device, or it can
> > > be allocated dynamically from a pool of addresses.
>
> > > I would guess you don't want to require pre-assignment, because,
> > > typically, users would not be able to do so.
>
> > > So how do the devices discover each other's IP addresses?
>
> > > Well, there are a lot of options there. You can have each user type in
> > > the IP address. You can register the device dynamically under a DNS
> > > server, and have them type in the DNS name. You can use a service
> > > discovery protocol (like Apple's Bonjour service). You can roll your
> > > own using broadcast or multicast messages. You can register each
> > > device on a server -- and then even talk to each other THROUGH the
> > > server. This last has the great advantage that it allows two devices
> > > on incompatible networks to communicate. (I presume the disadvantages
> > > are obvious).
>
> > > About the only thing I can say for sure is -- you're going to need to
> > > know more about networking than you do today. It's learnable, and
> > > there are resources out there to help. Most of what you need to know
> > > is information that is not specific to the Android platform, so there
> > > will be a wide array of sources of information. Google searches are
> > > you friend.
>
> > > You can probably accomplish everything you're trying to do entirely
> > > with the classes in the java.net package. So you can develop your
> > > approach in any connected Java environment.
>
> > > On Jan 28, 1:56 am, Tony  wrote:
>
> > > > Hello ,all!
>
> > > > If I connect  two android pwer  real-devices   to  a LAN  through wifi,
> > > > then what  are their  IP adress???
>
> > > > How can then find each other by IP address???
>
> > > > are  their IP address 192.168.0.* ??
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send ema

[android-developers] Re: New sales have come to a halt Re: Developer console stopped updating?

2010-02-12 Thread Matt Kanninen
Google seems to be kind of busy.  My Nexus 1 just got updated to 2.1
update 1, we're supposed to get Droid updates, they launched Buzz,
people have started using Google Wave, and I'm really excited about
Video and Voice chat in Gmail, using Googletalk, from Firefox or
Chrome.

On Jan 28, 5:43 am, TreKing  wrote:
> On Thu, Jan 28, 2010 at 4:35 AM, String wrote:
>
> > Why don't you just contact your dedicated Market support rep,
>
> LOL ... now that's funny.
>
> >  you know, the one who's paid out of the 30% cut that Google takes?
>
> To be fair, Google does not take the 30% cut, the carrier does:
> 3.2 The price you set for Products will determine the amount of payment you
> will receive. A Transaction Fee, as defined below, will be charged on the
> sales price and apportioned to the Payment Processor and, if one exists, the
> Authorized Carrier.
>
> -
> TreKing - Chicago transit tracking app for Android-powered 
> deviceshttp://sites.google.com/site/rezmobileapps/treking

-- 
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: Hey Mr or Ms Moderator...

2010-02-12 Thread Matt Kanninen
It is normal.

This post of yours did make it through.

On Feb 12, 6:26 am, tony obrien  wrote:
> Hi,
>
> I have been attempting to operate within the android-developers and
> android-beginners Groups.
>
> I understand that new members are moderated, and completely agree with
> the concept. But to date, NONE of my posts have appeared. Is this
> normal?
>
> I am a new developer (thus the groups I am trying to participate in)
> and would *really* like to get active.
>
> Anything you can do to hasten my acceptance would be greatly
> appreciated.
>
> thanks,
> tony obrien

-- 
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: Variable values just get lost!??!?

2010-02-08 Thread Matt Kanninen
When I unexpectedly saw important, small, static strings get cleared,
my solution was to surround them with getters and setters, and check
if they were null each time.  In the setter I would write them to
private internal storage, and in the getter, if I found a null I'd
check if they were stored locally.

-- 
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] Roll Call

2010-01-28 Thread Matt Kanninen
Would it be off topic, if I was to suggest, or just myself start a
thread, where Android developers describe who they are, what countries
they are in, what cities, etc?

My name is Matt Kanninen I am in California.

-- 
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: Out of memory / orientation change / Memory Analyzer question

2010-01-21 Thread Matt Kanninen
I had a similar issue, randomly getting the external allocation too
large for this process error.

For me, it started when I added android:targetSdkVersion="4" to the
manifest, and went away when I removed that bit.

On Jan 21, 3:17 pm, OldSkoolMark  wrote:
> Yes,  the OOM is related to 'external allocations'. I googled
> 'dalvikvm external allocation' and there's plenty to pore over. Is
> there an update on this issue in general?
>
> Here's the relevant logcat excerpt:
>
> 01-21 13:04:49.140: INFO/WindowManager(79): onOrientationChanged,
> rotation changed to 1
> 01-21 13:04:49.140: INFO/WindowManager(79): Setting rotation to 1,
> animFlags=0
> 01-21 13:04:49.150: INFO/WindowManager(79): Config changed:
> { scale=1.0 imsi=0/0 loc=en_US touch=3 keys=1/1/2 nav=3 orien=2
> layout=18}
> 01-21 13:04:49.370: DEBUG/StatusBar(79): updateResources
> 01-21 13:04:49.680: DEBUG/dalvikvm(2630): GC freed 556 objects / 24056
> bytes in 127ms
> 01-21 13:04:49.790: ERROR/dalvikvm-heap(2630): 614400-byte external
> allocation too large for this process.
> 01-21 13:04:49.790: ERROR/(2630): VM won't let us allocate 614400
> bytes
>
> On Jan 21, 2:47 pm, fadden  wrote:
>
> > On Jan 21, 12:58 pm, OldSkoolMark  wrote:
>
> > > Is this telling me something useful? If forcing a GC with DDMS
> > > reclaims the memory used by now-defunct instances of my activity, I
> > > would have thought the VM would have garbage collected some, if not
> > > all of these defunct activities automatically. Do I need to request GC
> > > at the very beginning of my activity lifecycle to make sure?
>
> > Something doesn't sound right.  What does logcat show?  Are you seeing
> > GCs in the log file?  Is the OOM related to "external allocations"?

-- 
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: Battery Life vs Features

2010-01-14 Thread Matt Kanninen
It's pretty easy for users to check which applications are draining
the battery, so it's in your interest not to have your application on
the top of the list.

I say conserve battery wherever possible, but a good user experience
and quality application is more important.

On Jan 14, 2:27 pm, Acchao  wrote:
> I'm curious as to how many developers take into consideration battery
> life before implementing a feature.
> Say you could implement a really nifty feature using the camera, but
> you know that would drain the phone's battery faster on an
> nonessential ability, what do you do? Do you completely disregard
> battery consumption because that really just isn't your concern/ it's
> just too cool? Or do you go for a more simple variation, that would
> give the user longer battery life?
-- 
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: Carnegie Mellon University seeks Android developers opinion

2010-01-08 Thread Matt Kanninen
This seems like an insightful survey.  I like the idea of academic
interest in this hard problem.

On Jan 7, 9:26 pm, Mobile Survey CMU  wrote:
> We are conducting a survey of mobile application developers aimed at
> improving our understanding of mobile application development, focused
> on developer practices for building mobile applications. This is a
> research project, sponsored by the CyLab Mobility Research Center of
> Carnegie Mellon University. Survey results will be made public and
> will be available athttp://mobileplatforms.wikidot.com in early
> 2010.
>
> The survey is open to anyone who is involved in the design and
> development of mobile applications, and should take 10-15 minutes to
> complete. If you would like to participate in the survey, please click
> to go to the survey site at:
>
> http://2010MobileDeveloperSurvey.questionpro.com
>
> You will first be asked to give your consent to participating in the
> survey. If you have questions about the survey, please send an email
> message to mobilesur...@sv.cmu.edu
>
> Thank you very much for your participation.
>
> All responses will remain confidential and secure. Thank you in
> advance for your valuable feedback. Your input will be used to ensure
> that we continue to meet your needs. We appreciate your trust and look
> forward to serving you in the future.
>
> NOTE: Feel free to circulate this message amongst your colleagues and/
> or post it on your blog.
-- 
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] Nexus bug

2010-01-08 Thread Matt Kanninen
I've found that you have to write firmware and or hardware specific
camera code.  As such I didn't touch the code inherited that worked on
every Android handset.

But it doesn't work on the Nexus.  Mind you I saw similar
"setParameters failed" errors on other handsets in the logs, but it
just seemed like the sort of silent error I expect the Android
framework to make.  Everything worked on the other handsets, it just
had error messages in the log.  Now it crashes the app.


I request an SDK update.  Also can we get a blog post about best
practices for using the camera?

I would also like a cookie.

Thanks a bunch, exception details follow:

01-08 15:58:11.548: WARN/System.err(5376): java.lang.RuntimeException:
setParameters failed
01-08 15:58:11.568: WARN/System.err(5376): at
android.hardware.Camera.native_setParameters(Native Method)
01-08 15:58:11.578: WARN/System.err(5376): at
android.hardware.Camera.setParameters(Camera.java:619)
01-08 15:58:11.578: WARN/System.err(5376): at
com.company.apps.activities.Preview.surfaceChanged(activityname.java:
154)
01-08 15:58:11.578: WARN/System.err(5376): at
android.view.SurfaceView.updateWindow(SurfaceView.java:460)
01-08 15:58:11.578: WARN/System.err(5376): at
android.view.SurfaceView.dispatchDraw(SurfaceView.java:287)
01-08 15:58:11.578: WARN/System.err(5376): at
android.view.ViewGroup.drawChild(ViewGroup.java:1529)
01-08 15:58:11.578: WARN/System.err(5376): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
01-08 15:58:11.578: WARN/System.err(5376): at
android.view.View.draw(View.java:6538)
01-08 15:58:11.578: WARN/System.err(5376): at
android.widget.FrameLayout.draw(FrameLayout.java:352)
01-08 15:58:11.578: WARN/System.err(5376): at
android.view.ViewGroup.drawChild(ViewGroup.java:1531)
01-08 15:58:11.578: WARN/System.err(5376): at
android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
01-08 15:58:11.578: WARN/System.err(5376): at
android.view.View.draw(View.java:6538)
01-08 15:58:11.578: WARN/System.err(5376): at
android.widget.FrameLayout.draw(FrameLayout.java:352)
01-08 15:58:11.578: WARN/System.err(5376): at
com.android.internal.policy.impl.PhoneWindow$DecorView.draw
(PhoneWindow.java:1830)
01-08 15:58:11.578: WARN/System.err(5376): at
android.view.ViewRoot.draw(ViewRoot.java:1349)
01-08 15:58:11.588: WARN/System.err(5376): at
android.view.ViewRoot.performTraversals(ViewRoot.java:1114)
01-08 15:58:11.588: WARN/System.err(5376): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1633)
01-08 15:58:11.588: WARN/System.err(5376): at
android.os.Handler.dispatchMessage(Handler.java:99)
01-08 15:58:11.588: WARN/System.err(5376): at
android.os.Looper.loop(Looper.java:123)
01-08 15:58:11.588: WARN/System.err(5376): at
android.app.ActivityThread.main(ActivityThread.java:4363)
01-08 15:58:11.588: WARN/System.err(5376): at
java.lang.reflect.Method.invokeNative(Native Method)
01-08 15:58:11.588: WARN/System.err(5376): at
java.lang.reflect.Method.invoke(Method.java:521)
01-08 15:58:11.588: WARN/System.err(5376): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:860)
01-08 15:58:11.598: WARN/System.err(5376): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
01-08 15:58:11.598: WARN/System.err(5376): at
dalvik.system.NativeStart.main(Native Method)
01-08 15:58:11.598: ERROR/
com.company.apps.activities.activityname.Preview(5376): ERROR DURING
surfaceChanged, QUITTING ACTIVITY
01-08 15:58:11.628: WARN/InputManagerService(67): Starting input on
non-focused client com.android.internal.view.IInputMethodClient$Stub
$pr...@44a1eaa8 (uid=10045 pid=5376)
-- 
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: What does targetSdkVersion do?

2010-01-08 Thread Matt Kanninen
Diane,

I try hard not test on the emulator, and have access to the Android
phones users are using.  This bug happened only on the Droid, and our
application depends on the Camera and Mic to function.

More details on the bug here:
http://groups.google.com/group/android-developers/browse_frm/thread/100ce8c4e5cade6a/df64df59143b8e98?lnk=gst&q=mathiastck#df64df59143b8e98

and other threads related to:


java.lang.OutOfMemoryError: bitmap size exceeds VM budget

Sometimes out of memory errors, especially DEVICE SPECIFIC MEMORY
ERRORS, are best fixed in the framework, or the specific devices code.

I can't help debug this issue too much longer either, I'll be off the
project, and on to other Android applications soon.

-MK

On Jan 6, 4:27 pm, Dianne Hackborn  wrote:
> On Wed, Jan 6, 2010 at 3:10 PM, Matt Kanninen  wrote:
> >         > android:normalScreens="true" android:largeScreens="true" />
>
> If you don't specify anyDensity, then the system will run your app in
> density compatibility mode on high and low density devices.  You really want
> to avoid this, since it can result in some artifacts in the UI such as some
> text being clipped.
>
> If you are designing your app to support different screens/densities, I
> highly recommend that you make the target SDk version at least 4, since this
> will allow the system to do the correct default configuration to make it
> work correctly.  It also allows various other compatibility features to be
> turned off, which we try to document under each API version here:
>
> http://developer.android.com/reference/android/os/Build.VERSION_CODES...
>
> As for running out of memory -- it is probably because outside of
> compatibility mode the system is being allowed to pre-scale some of your
> loaded bitmaps to allow them to be drawn faster.  I would guess this is just
> a matter of you being close to the memory limit, and this pushing you over
> (the high density or large screen devices should always have a higher memory
> limit to account for this...  though I don't think the emulator changes
> this, come to think of it, so it could just be an emulator issue).
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: App crashes on Droid, works fine on G1

2010-01-08 Thread Matt Kanninen
Do you specify a target SDK in your manifest?  Do you use any Droid
specific layouts?

What firmwares do you support?

You can throw giant try catches around problematic code, log the
exception to local file, and upload them to your servers.  Although
you might want to warn users you do this in your terms of service,
especially if you aren't really a networked app.

On Jan 8, 12:07 pm, MJB  wrote:
> Hi Dianne,
>
> That's the difficulty, only end-users see the crash so I can't see the
> stack trace.  If I had my own Droid to try it on, it should be
> relatively easy to work through the bug.  Unfortunately, I don't have
> a Droid and even if I wanted one, they are not available in my
> country.
>
> The app I'm referring to specifically is Andrometer (2nd place in ADC2
> misc. category).
>
> Thanks,
> Mike
>
> On Jan 7, 4:37 pm, Dianne Hackborn  wrote:
>
> > What is the stack crawl of the crash?
>
> > On Thu, Jan 7, 2010 at 1:12 PM, MJB  wrote:
> > > Hi All,
> > > I'm having a problem where my app crashes on the Droid and seems to
> > > work fine on the G1.  We have a G1 dev phone but do not have access to
> > > a Droid phone, so the issue is difficult to debug at this stage.
>
> > > The app loads up the main screen okay, but once the user moves beyond
> > > the main screen, the app crashes.  Moving beyond main screen initiates
> > > the following:
>
> > > - GPS signal acquired
> > > - Accelerometer sensor listener active
> > > - Geomagnetic sensor listener active
> > > - Camera preview active
>
> > > I have a suspicion that the issue may be related to the camera
> > > preview.  With the G1, it didn't seem to matter how I set the camera
> > > preview size, so I just made it fit the size of the view.
>
> > >  Camera.Parameters parameters = mCamera.getParameters();
> > > parameters.setPreviewSize(w, h);   //where w, h are the width and
> > > height.
>
> > > One possibility is that with the Droid having a larger screen
> > > resolution to the G1, it may be setting the preview size to something
> > > that is not supported.  I plan on addressing this, but I have a few
> > > questions that I was hoping someone could shed some light on.
>
> > > 1. If the app attempts to set a preview size that is not supported,
> > > will it just be ignored or will the app crash?
> > > 2. If the preview size is smaller than the surface that is holding the
> > > preview, will the image be stretched to fill the surface?
> > > 3. Can anyone think of anything else that may be related specifically
> > > to the Droid that could be causing me problems?
>
> > > Thanks,
> > > 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
>
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
>
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see and
> > answer them.- Hide quoted text -
>
> > - Show quoted text -
-- 
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 Books?...

2010-01-06 Thread Matt Kanninen
I do get the impression most game developers ignore most of the
Android specific stuff.  They still have to respect the Android
lifestyle, and a game or two I otherwise like fails to properly save
state...

but you basically end up writing directly to the canvas and can follow
the standards for java and opengl game development.  Garbage
collection is your enemy for real time games.  So for RT games you'll
want to create nearly all of your objects up front, and thus attempt
to avoid garbage collection.  You'll want to avoid creating new
objects during real time portions of a game.

If you aren't making a real time game you might consider sticking with
standard Android UI actually.

On Jan 6, 7:36 am, kylestew  wrote:
> There really aren't any good Android books out there. I bought two of
> them and they are just poor copies of what Google wrote for
> developers. If you want to build games you should look for books on
> making games with open gl es. You should be able to find info on the
> internet about any Android specific open gl implementation.
>
> Good luck
>
> On Jan 5, 3:37 pm, Duey Oxburger  wrote:
>
> > Can anyone recommend any good Android books for a beginner?  I'm
> > mostly interested in games...
>
> > Thx All,
>
> > D
>
>
-- 
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 run application in Back ground?

2010-01-06 Thread Matt Kanninen
So most applications are android Activites, long running processes
outside of a given activity should be Android Services.  The other
major "kind" of Android "thingy" are content providers.

On Jan 6, 3:33 am, Ganeshkumar  wrote:
> Hello Friends,
>
> I want to develope an application in which if SIM card is changed then
> the application should sent SMS to a predefined number from the new
> SIM. User should not know that SMS are being send from his/ her
> mobile. For this application needs to run in background. How can I
> achieve it?
>
> Thank you in advance
-- 
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 GIF image for a finate time

2010-01-06 Thread Matt Kanninen
Yeah that's probably the right answer.  In theory you can open a GIF
as a video, it hasn't worked for me in practice.

Actually it pisses me off that in the specs for Android phones they
say they support the GIF filetype.  They really should say they have
partial support, until GIFs are animated in the browser and easily
animated by applications.

Apparently some GIFs work, just not most GIFs you find in the wild.

On Jan 6, 11:51 am, TonyDoc  wrote:
> Convert it to multiple png's & use androids animation manager.
>
> On Jan 6, 5:31 am, RamaMohan  wrote:
>
> > Hi all,
> > I want to show  a loading Image of GIF type  for a finite time .how to
> > do this.
> > Please tell me the solution if anyone knows.
>
> > Thanks,
> > Ram
>
>
-- 
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 clear activity stack in task

2010-01-06 Thread Matt Kanninen
Hard to do without changing code.  I always end having to implement
logout(), so all my activities extend a custom base activity, and in
that base activity in onCreate I always end up checking for a global
static:

if(!isLoggedIn){
  finish();
  return;
}


On Jan 6, 4:43 am, Zhihong GUO  wrote:
> thanks for the quick answer. but is there any other solutions? i mean do not
> change the code of activity a and b, just clear the task stack.
-- 
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: Null pointer exception

2010-01-06 Thread Matt Kanninen
I do the management in onStop, for my cursor which supplies the data
needed by a ListView (which means the cursor has to be open whenever
the activity is displayed).

@Override
protected void onStop() {
super.onStop();
if(db!=null){
if(db.isOpen()){
db.close();
}
}
if(mCursor!=null){
if(!mCursor.isClosed()){
mCursor.close();
}
}
}

On Jan 6, 7:25 am, JasonMP  wrote:
> That was it!  I took out the startManagingCursor() and it worked
> fine.  My next question is what should I do to handle the life cycle
> of my cursor?  Should I close it outside the switch statement?
>
> On Jan 5, 5:41 pm, Vladimir  wrote:
>
> > What do you think about this:
> > 1. Cursor created in onContextItemSelected() is null (for some reason)
> > 2. Since its lifecycle is managed by the activity (startManagingCursor
> > (c)), it tries to release it when the activity is stopped (when the
> > new intent is launched)
> > 3. It doesn't expect managed cursor to be null and crashes (at
> > android.app.Activity.performStop(Activity.java:3604))
> > Does that make sense? I have little idea about how this cursor
> > management works, but I would do the following:
> > 1. Try removing startManagingCursor() calls to see if these are
> > related
> > 2. Double check if the cursor is null
> > 3. Take a look inside Android source and specifically Activity.java:
> > 3604
> > Just a guess :)
>
> > On Jan 5, 4:02 pm, JasonMP  wrote:
>
> > > Ok, I tried gino's idea with initializing my arrays differently.  I
> > > also changed there names so that they did not share a name with any
> > > other arrays in my app:  Did not work.
>
> > > I also tried calling to static variables instead of passing variables
> > > between classes with intents:  This also did not work.
>
> > > I can't determine which line of code causes the error.  The logcat
> > > does not give me a pointer to anything in my app at all.  I tried to
> > > narrow it down with breakpoints and logging and what I found is that
> > > it runs through all of my code without a hitch, and then once its done
> > > it throws the exception.
>
> > > And again the exception only happens when I call the intent from a
> > > contextMenu.
>
> > > On Jan 1, 2:56 am, Wiebbe  wrote:
>
> > > > Shouldnt you check if the bundle is null or not? Try to loop through
> > > > it when you get there from a onContextItemSelected event. I'm guessing
> > > > some value somewhere is null when it should be instantiated. Perhaps
> > > > the intent is started quicker or without the bundle somehow so you get
> > > > a nullpointer exception?
>
> > > > On 31 dec 2009, 15:57, JasonMP  wrote:
>
> > > > > yes, Select.class is another one of my files.  throughout my app there
> > > > > are a few different calls to it, all done the same way i.e. "Intent i
> > > > > = new Intent(this, Select.class); startActivity(i);"
>
> > > > > No where in Select.class do I make a call to start Select.class or
> > > > > Sheet.class.  When its done it calls finish();
>
> > > > > in the onCreate() of Select.class I grab the extras from the invoking
> > > > > class with this line of code:
>
> > > > > public class Select extends ListActivity{
>
> > > > >         DBAdapter db = new DBAdapter(this);
> > > > >         String slotName = null;
>
> > > > >         @Override
> > > > >         public void onCreate(Bundle savedInstanceState) {
> > > > >                   super.onCreate(savedInstanceState);
>
> > > > >                   db.open();
>
> > > > >                   ListView list = getListView();
>
> > > > >                   View v = View.inflate(this, R.layout.list_header, 
> > > > > null);
> > > > >                   list.addHeaderView(v, null, false);
>
> > > > >                   name = 
> > > > > this.getIntent().getStringExtra(DBAdapter.KEY_NAME);
> > > > >         }
>
> > > > > Could it be something in the .getIntent() method?  or
> > > > > the .getStringExtra()?
>
> > > > > On Dec 30, 7:19 pm, "Stephen @ gmail.com" 
> > > > > wrote:
>
> > > > > > Now that I understand your intent creation a little better, and I 
> > > > > > see that
> > > > > > the intent you are creating is unique from the class in which the 
> > > > > > code
> > > > > > exists, I am not quite sure how it could be an infinite loop in the
> > > > > > (immediate) way I was thinking.
>
> > > > > > Reading this code
>
> > > > > > Intent i = new Intent(this, Select.class);
>
> > > > > > I have to start thinking there's something wrong with this.  I 
> > > > > > tried to look
> > > > > > up the "Select" class on the android developers site, and couldn't 
> > > > > > find it.
> > > > > > Is that a class from another of your files?  I guess I would wonder 
> > > > > > if the
> > > > > > code being invoked there, is somehow causing this class

[android-developers] Re: What does targetSdkVersion do?

2010-01-06 Thread Matt Kanninen
Got it.  I don't think I need targetSdkVersion now that I have:



I want to target HVGA and up.

On Jan 5, 8:10 pm, Lance Nanek  wrote:
> Can change defaults for supports-screens. Can also disable
> compatibility features, like reporting a smaller size than the actual
> display and scaling your app up.
>
> See:http://developer.android.com/intl/zh-TW/guide/practices/screens_suppo...
>
> On Jan 5, 9:15 pm, Matt Kanninen  wrote:
>
> > What does targetSdkVersion do?
>
> > There isn't much detail on what targetSdkVersion actually does.
>
> > I've read:
>
> >http://developer.android.com/guide/topics/manifest/uses-sdk-element.h...
>
> > android:targetSdkVersion
> >     An integer designating the API Level that the application is
> > targetting.
>
> >     With this attribute set, the application says that it is able to
> > run on older versions (down to minSdkVersion), but was explicitly
> > tested to work with the version specified here. Specifying this target
> > version allows the platform to disable compatibility settings that are
> > not required for the target version (which may otherwise be turned on
> > in order to maintain forward-compatibility) or enable newer features
> > that are not available to older applications. This does not mean that
> > you can program different features for different versions of the
> > platform—it simply informs the platform that you have tested against
> > the target version and the platform should not perform any extra work
> > to maintain forward-compatibility with the target version.
>
> >     Introduced in: API Level 4
>
> >   I'm curious because it appears that switching from:
>
> >         
>
> > to
>
> >         
>
> > is the change that started the
>
> > android.view.InflateException ... java.lang.OutOfMemoryError: bitmap
> > size exceeds VM budget
>
> > errors I was randomly seeing in setContentView.  When I remove the
> > targetSdkVersion it runs much better.
>
> > Now I'm having trouble remembering what adding targetSdkVersion got me
> > in the first place.
>
>
-- 
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] What does targetSdkVersion do?

2010-01-05 Thread Matt Kanninen
What does targetSdkVersion do?

There isn't much detail on what targetSdkVersion actually does.

I've read:

http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#target

android:targetSdkVersion
An integer designating the API Level that the application is
targetting.

With this attribute set, the application says that it is able to
run on older versions (down to minSdkVersion), but was explicitly
tested to work with the version specified here. Specifying this target
version allows the platform to disable compatibility settings that are
not required for the target version (which may otherwise be turned on
in order to maintain forward-compatibility) or enable newer features
that are not available to older applications. This does not mean that
you can program different features for different versions of the
platform—it simply informs the platform that you have tested against
the target version and the platform should not perform any extra work
to maintain forward-compatibility with the target version.

Introduced in: API Level 4



  I'm curious because it appears that switching from:



to



is the change that started the

android.view.InflateException ... java.lang.OutOfMemoryError: bitmap
size exceeds VM budget

errors I was randomly seeing in setContentView.  When I remove the
targetSdkVersion it runs much better.

Now I'm having trouble remembering what adding targetSdkVersion got me
in the first place.
-- 
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 Dev Phone with Verizon?

2010-01-04 Thread Matt Kanninen
The Droid, and HTC's main line being  G1 MyTouch and Hero are all
popular handsets that work fine as dev phones.  It doesn't seem like
the other Android handsets are seeing much usage right now, based on
the analytics I've seen.

But I would choose carefully in picking which phones to develop on,
and for.  The hero is still firmware 1.5, the G1 and My Touch as 1.6,
and the Droid is 2.0.1 (unless I missed an update over the holidays).
Anyway there are real differences between the different API levels.

On Jan 4, 3:04 pm, JP  wrote:
> On Jan 4, 11:44 am, Mark  wrote:
>
> > Any phone can work as a dev phone.  
>
> Some are better suited than others however. There's a least one
> consumer level device (I cannot remember which) that didn't dump logs.
> Then there might be driver issues.

-- 
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: } catch (OutOfMemoryError E) {

2009-12-18 Thread Matt Kanninen
As a followup this had no impact.  Also it wasn't an OutOfMemoryError
when it it got bubbled up to my activity, it was an InflateException.
Catching the exception seemed to have no impact, it still crashed.  I
tried this:

//not having much luck fixing our OutOfMemoryErrors, so lets see what
happens if we just catch and log it.  Might be nicer to the user.
try {
setContentView(R.layout.arl_start);
} catch (OutOfMemoryError e) {
GlobalUtils.outOfMemoryCount++;
Log.e(getClass().getCanonicalName(),"GlobalUtils.outOfMemoryCount
"+GlobalUtils.outOfMemoryCount);
e.printStackTrace();
finish();
} catch (InflateException e) {
GlobalUtils.outOfMemoryCount++;
Log.e(getClass().getCanonicalName(),"GlobalUtils.outOfMemoryCount
"+GlobalUtils.outOfMemoryCount);
e.printStackTrace();
finish();
}

On Dec 11, 11:19 am, Matt Kanninen  wrote:
> Can I ask what Android does with un caught OutOfMemoryErrors that it
> wouldn't do if I caught them?  It's really tempting for me to do this:
>
> try {
>             setContentView(R.layout.result);} catch (OutOfMemoryError E) {
>
>            outOfMemoryCount++;
>              e.printStackTrace();
>               finish();
>
> }
>
> If I don't catch the OutOfMemory my activity crashes, but then the
> user just clicks the button again and it loads great the second time.
> So something happens resulting in the rightmemorybeing cleared.

-- 
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: Camera intent - what's safe to use?

2009-12-18 Thread Matt Kanninen
On Dec 11, 4:37 pm, Vytautas Vaitukaitis
 wrote:
> @Matt
>
> Yes, you're absolutely right - I'm trying to do what works on Hero -
> if that fails, I do what works on all the other phones.
>
> I'm not quite sure about which of the Camera API issues you're talking
> about: the failure to retrieve images with resolution greater than
> 512x384 or lack of single method to obtain images of 512x384
> resolution?

I was having out memory leak issues, so I was trying to cleanup my
whole application.  Taking a picture, then manipulating, then
uploading an image takes a lot of memory, so I was looking for the
best practices for this sort of thing.  I hoped a good practice was to
call the default camera activity, and that there would be a
standardized response.  That's what I was talking about.

-- 
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: Upload multiple versions for single android application for different SDK levels 1.5, 1.6, 2.0

2009-12-18 Thread Matt Kanninen
An Android developer has to develop the habit of untraining management
that is used to J2ME.  If you release multiple different APKs you
technically can fork your codebase, into different packages, to target
different firmware.  But you don't want to compete with yourself for
market listings, you don't want to fork your code, you don't want to
have to maintain different branches.

Mind you, I don't want to use reflection, it frightens me a bit, and
it's annoyed me and made my app harder to debug every time I've used
it.  Eventually though we'll really want to use a feature not in 1.5.

I'm curious, what happens if you release an application that requires
Android 1.5 or higher on the market, and then you update it with a
version that requires 1.6 or higher?  Will 1.5 users simply no longer
be able to download the application?  What is their user experience?

Thanks,
-MK

On Dec 18, 2:42 am, lk  wrote:
> hi  TreKing
>
>   Thanks for your reply. I was not aware of reflection.Now I am
> learning about reflection.I will seriously follow your
> recommendations.
>
> thanks
> Alok
>
> On Dec 17, 12:20 am, TreKing  wrote:
>
> > > I've three different .apk files for all three SDK.
>
> > You should probably be using the latest SDK with your minSDK set to 3 (for
> > 1.5) and using reflection to do things that are different across the API
> > levels.
>
> > How can i upload three different .apk files on Android Market Place for
>
> > > single application?
>
> > They all have to have a different package name, which means you would have
> > to make (and maintain) 3 copies of your source code. You probably don't want
> > to do this.
>
> > > I would like to have all 3 versions available under one application name.
> > > is this possible ?
>
> > Technically, yes. They can all have the same name via the "label" attribute
> > in your manifest, and they can appear with the same name in the Market (you
> > set this in the Developer Console). But, again, they have to have different
> > package names.
>
> > I would highly recommend you look through the blog posts for the one about
> > targeting different platform versions and seriously rethink publishing and
> > maintaining 3 different versions of the same app for each SDK.
>
> > What happens when 2.1 comes out? 2.2? 3.0? 43.67? Are you going to keep
> > making a new version of your app for each new version that comes out?
>
> > -
> > TreKing - Chicago transit tracking app for Android-powered 
> > deviceshttp://sites.google.com/site/rezmobileapps/treking
>
> > On Wed, Dec 16, 2009 at 2:11 AM, lk  wrote:
> > > Hi,
>
> > > I'm developing one android application which needs to support Android
> > > OS 1.5, 1.6, and 2.0.
>
> > > I've three different .apk files for all three SDK.
>
> > > How can i upload three different .apk files on Android Market Place
> > > for single application?
> > > I would like to have all 3 versions available under one application
> > > name. is this possible ?
>
> > > So, users with any SDK can use my application.
>
> > > Thanks.
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscr...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
>

-- 
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: ClassLoader leaking memory?

2009-12-18 Thread Matt Kanninen
If you have a small sample that demonstrates the problem that seems
perfect for b.android.com.

On Dec 17, 6:01 pm, "B++"  wrote:
> After some further analysis, it seems that the problem lies on the
> DexFile. The PathClassLoader internally invokes the DexFile which
> apparently unzips the package to retrieve the class. However, these
> resources don't seem to be released.
>
> B.
>
> On Dec 17, 3:45 pm, "B++"  wrote:
>
> > Thanks for the response.
>
> > I have already run it using hprof and mat, and located the issue, and
> > the problem lies in here:
> > onCreate(..) {
> > ...
> > PathClassLoader classLoader =  new PathClassLoader("/path/to/apk.apk",
> > getClassLoader());
> > classLoader.loadClass("path.to.class");
> > classLoader = null;
>
> > }
>
> > Only these three lines will cause a "leak" if you keep on creating
> > this activity and destroying it with the back button.
> > The class is getting loaded successfully, but the resources are never
> > released. As you can see, I set the reference of the classLoader to
> > null, and I never instantiate any object using the loaded class, but
> > the problem still persists.
>
> > I have isolated the code as above, and you can clearly see that the
> > memory is growing.
>
> > Can the getClassLoader() reference create a problem here?
>
> > Thanks
>
> > B.
>
> > On Dec 17, 2:57 pm, fadden  wrote:
>
> > > On Dec 17, 7:45 am, "B++"  wrote:
>
> > > > The problem is that this happens even if no objects are instantiated
> > > > using the loaded class. There seems a problem with garbage collector,
> > > > which doesn't seem to release resources about the loaded class on
> > > > Destroy even if there are no references to it.
>
> > > It usually turns out that something is holding a reference to whatever
> > > it is that isn't getting thrown away.  The best way to figure this out
> > > is to get the HPROF output and run it through jhat or MAT.
>
> > > See also:
> > >  http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks
> > >  http://android.git.kernel.org/?p=platform/dalvik.git;a=blob_plain;f=d...
> > >  http://kohlerm.blogspot.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: OutofMemoryError: bitmap size exceeds VM budget.....

2009-12-18 Thread Matt Kanninen
How did you resolve it?  I think we do need a list of ways one can
cause this, how you figure out what caused it, and what to do to fix
it.

On Dec 18, 8:11 am, Abhi  wrote:
> Resolved!!!
>
> On Dec 18, 9:25 am, Abhi  wrote:
>
> > Anyone?
>
> > On Dec 18, 12:11 am, Abhi  wrote:
>
> > > Hi,
>
> > > I am doing the following in my app, which at times results in the
> > > above error.
>
> > > Action 1: Button on Main activity calls all pictures using ACTION_PICK
> > > (results in a thumbnail view of all pictures on my phone). User picked
> > > image (URI) is then passed over to next activity where the image is
> > > displayed (ImageView) full screen. When I hit back, I go back to the
> > > main activity. If I try to open all pictures and pick a picture again,
> > > I get a FORCE CLOSE and the logCat data says "OutofMemoryError: bitmap
> > > size exceeds VM budget.
>
> > > Action 2: I get the same error and FORCE CLOSE when I try to rotate
> > > the full-sized picture by changing phone orientation back and forth.
>
> > > What am I supposed to do to save memory? I can't change the use case
> > > of my app... the user has to follow the above steps. How can I free up
> > > memory without having to change anything in my app.
>
> > > Thanks,
>
> > > Abhi- 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: ddms

2009-12-16 Thread Matt Kanninen
Try just using adb pull /data/anr/traces.txt /PC/YOUR_FOLDER

On Dec 16, 5:37 am, Business Talk 
wrote:
> I am trying to debug my device from a windows system with no IDE, just
> the android sdk, jdk and jre. I am using the ddms to do so. I works
> fine. I can see the entries in the logcat in the ddms. Among others I
> can see ‘Wrote stack trace to /data/anr/traces.txt”. But when I select
> the Device->File Explorer… and try to open the data folder, there is
> nothing there. It looks like an empty data folder.

-- 
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: Multiple screen sizes problem ( layouts )

2009-12-16 Thread Matt Kanninen
What uses layout-large?  layout-long is used by my droid.

On Dec 16, 7:18 am, Dilli  wrote:
> Hi all,
>
> I have created layout-large and testing against android 2.0.1 WVGA.
> however, its picking layout-normal.
> Can anybody suggest me what I am doing wrong.
> Even though, I have 3 layouts ( layout-normal, layout-large, layout-
> small),
> Its always picking layout-normal.
> why its so.
> can anybody guide me.
>
> i added properties to manifest file
>
>            android:largeScreens="true"
>           android:normalScreens="true"
>           android:smallScreens="true"
>           android:anyDensity="true" />
>
> and
>
>  uses-sdk>
>
> thx
>
> Dilli

-- 
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: ActivityThread.ContextCleanupInfo leaking memory?

2009-12-16 Thread Matt Kanninen
I don't have any advice, I'm just very interested in hearing if and
how you make an progress diagnosing, debugging and fixing this sort of
issue.  I'm still trying to fix what looks like memory leak in my
app.  All I have succeeded in doing is reducing the total memory used,
thereby making the bug dramatically less noticeable.

Thanks,
-Matt Kanninen

On Dec 16, 8:19 am, freezy  wrote:
> Hi all,
>
> I'm trying to locate a memory leak in my app (it's client for a
> mediacenter). So I start it up, go to the screen that lists all movies, go
> back to my home activity, trigger the GC a few times manually via DDMS, dump
> the memory heap, pull it, convert it and load it into MIT in Eclipse.
>
> Now the movie list screen is pretty heavy, around 800k of movie objects,
> which should be freed when I go back to the home screen. However, it stays
> allocated, with the GC root as a local variable in the main thread at
> ActivityThread.ContextCleanupInfo
> (see attached screenshot).
>
> I've tried searching but there is no documentation on this class, not even
> in the source code. Is there any way to avoid this kind of behavior? Am I
> doing something wrong or is the problem in Android? My app is open source
> and can be checked out here[1].
>
> Any hints and suggestions appreciated!
>
> [1]http://code.google.com/p/android-xbmcremote/
>
>  leak-contextcleanupinfo.png
> 120KViewDownload

-- 
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 get the WebView UserAgent (without having a Context)

2009-12-15 Thread Matt Kanninen
So many things require a context I'm just in the habit at this point
of passing the Context around everywhere.  You can get in trouble if
you try to preserve a reference to a context past it's lifetime
though.

On Dec 15, 10:59 am, Mariano Kamp  wrote:
> Hi,
>
>   I am downloading web pages off of the internet and some of those sites
> want to format their content for the actual user agent used.
>
>   I want to use the user agent that is later on used to display the stuff I
> donwnload.
>
>   I can ask WebView.getWebSettings().getUserAgentString() to get the user
> agent, but this doesn't work all that well for my app as I need to
> instantiate a WebView first even though I don't need. Furthermore to do that
> I need to have a UI context, which I don't as this part of the app doesn't
> have a UI.
>
>   Is there another way to get to the User Agent?
>
>   I found in WebSettings:
>
>     // User agent strings.
>     private static final String DESKTOP_USERAGENT =
>             "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en)"
>             + " AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2"
>             + " Safari/525.20.1";
>     private static final String IPHONE_USERAGENT =
>             "Mozilla/5.0 (iPhone; U; CPU iPhone 2_1 like Mac OS X; en)"
>             + " AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2"
>             + " Mobile/5F136 Safari/525.20.1";
>
>   But of course, this is private. Any other idea?
>
> Cheers,
> Mariano

-- 
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: GK:How to Kill all Activity at a time ?

2009-12-15 Thread Matt Kanninen
I've implemented a "Sign Out" function before which was much like exit
except we still wanted the initial login screen to display.  You can
try to open your activities with startActivityForResult and in
onActivityResult check if you were sent an exit code you chose, then
call finish in every activity.  Lots of things can cause this to
fail though.

I find I typically have a ThisApplicationsActivities parent Activity
that most of my activities will inherit from.  So to implement
"SignOut" you change a static variable to indicate you've signed out,
and in onResume of this master Activity class check if the user is
currently logged in, and if not call finish().  This worked fine for
me.

On Dec 14, 8:12 pm, Jack Ganesh  wrote:
> Hi..,
>  i used the following :
>
> void onClick(){
> android.os.Process.killProcess(android.os.Process.myPid())
>
> System.exit(0);
>
> }
>
> but still its coming back to the previous activity.
>
> Any other try ? ?
>
> Cheers,
> Ganesh
>
>
>
> Hi Ganesh,there are two ways
>
> android.os.Process.killProcess(android.os.Process.myPid())
>
> System.exit(0);
>
> I normally use the second, I agree that some times you just want to
> properly exit an app as you dont want it using memory and slowing
> your  phone
>
> Alberto
>
> On Dec 8, 5:11 pm, "Mark Murphy"  wrote:
>
> > > For example, in your browser, if you have been opening many pages, and
> > > then you click on "Back", it takes you to the previous page in the
> > > browser's history. Say, my history has 10 pages, so to finally exit
> > > the application, I have to press back 10 times..
>
> > Press HOME, and you're done. Moreover, that's what Android is trying to
> > teach users to do -- press HOME, and they're done.
>
> > Remember: everybody keeps holding iPhone up as perfection for user design,
> > and applications there do not have normally an "exit" option AFAICT. Users
> > just press The One And Only Button, and they're done. (Note: my iPod Touch
> > hasn't been, er, touched since before the OS 3.0 upgrade, so perhaps they
> > changed their UI approach recently and I missed it).
>
> > So, just make sure your app behaves the way you want when the user presses
> > HOME, and you're done.
>
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com
> > Android App Developer Books:http://commonsware.com/books.html
>
>

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


[android-developers] Re: How to Read/Write .CSV

2009-12-15 Thread Matt Kanninen
Doesn't sound like an Android question to me, just look for Java CSV
samples.

If you need some Android examples for file IO those are plentiful.
Here for example is how to write to your apps private directory:

FileOutputStream fos = context.openFileOutput(fileName,
Context.MODE_PRIVATE);
fos.write(bytes);
fos.flush();
fos.close();

you may prefer to write the sdCard, but then you will have to handle
your own security.  Or you may not care.

On Dec 14, 11:56 pm, Ben  wrote:
> I'll open with, I googled this thing like crazy, searched anddev and a
> few other boards (including this one) and can't quite find what I'm
> looking for.
>
> The predicament : all CSV examples are in reference to contacts, and
> the file read/write posts (the ones that I need) make the assumption
> that I am not a beginner and most don't even post any code leaving me
> nothing to learn on.
>
> The hopeful solution : a link to a solid example of simply how to
> write to a CSV with my own custom fields and values, and how to read a
> CSV and load said values.
>
> I don't imagine anyone is going to take the time to write the code
> solely to post it here, so if you can just point me in the right
> direction it would be greatly appreciated.

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


[android-developers] Re: Is there a way to print the activity stack ?

2009-12-15 Thread Matt Kanninen
Best way I know is to track state within your activities.

Looking at the state diagram on:

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

if onResume has been called and onPause has not then your activity
should be in the foreground.  It might not have focus though, if a
dialog box has it.



On Dec 14, 11:57 pm, rkewlani  wrote:
> Acutally I was trying to automate some stuff on my android emulator. I
> start an activity through adb shell using "am" command, but when the
> activity starts do I have a way out to know that my activity is the
> one which is at the top & has the focus.
>
> I googled about it a lot but couldn't find the right way to do this.
>
> Any help would be greatly appreciated.
>
> Thanks.

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


[android-developers] Re: Why are onCreate() onStart() etc. called when handset orientation is changed?

2009-12-15 Thread Matt Kanninen


On Dec 15, 4:10 am, steff  wrote:
> But my problem is this (at this point my misunderstanding kicks in):
> whenever I rotate the device the onCreate(), onStart() etc. methods
> are called, causing my app to act as if it just started. Furthermore,
> I feel unable to implement an onSizeChanged(int w, int h, int oldw,
> int oldh) { ... } Listener.
>
> Can anyone please explain where my error in reasoning is? I am working
> on a tiny app which is more or less done, except for the just
> mentioned bug(s). Maybe I got it all wrong but it does what it is
> supposed to do (i.e. sending touch positions and accelerometer data
> over the network via UDP).
>
> Thanks for any help.
> Regards,
> Steff

If you don't want your activity to be created/destroyed you can
override that behavior in the manifest.

I googled a bit for an official google page talking about the
paradigm, but was surprised at lack of success.  Better yet though
would be to point you at Mark Murphy's stuff:

http://www.androidguys.com/2008/10/14/rotational-forceson-your-android-app/

-- 
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: Extending the webkit or creating webkit plug in

2009-12-14 Thread Matt Kanninen
You can't extend webkit or the default browser on existing Android
devices, but you can create your own Android distribution and alter
webkit however you please, then install this new firmware on your own
devices or make it available for rooted phones.

You can also ship your own application that features a browser window,
and then track users that way, and in your own application you can do
what what you want with your own cache.

On Dec 14, 10:36 am, javafan  wrote:
> Hi All,
>
> Is there a way to extend Webkit on Android? Can we write plug in for
> webkit in android? Can we do things like creating our own renderer for
> a particular type of data embaded in the webpage? Can we track user
> session or modify data stored in the browser cache/memory?
>
> Please respond if any has any idea about this.
>
> Thanks,
> Javafan

-- 
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: AnimationDrawable and Out of Memory Errors

2009-12-11 Thread Matt Kanninen
Statics are just the first thing to check.

On Dec 11, 5:32 am, Mark Hansen  wrote:
> So I did get the crashes to stop, and I have a idea of why it works...
> anyways.. I updated the onWindowFocusChange set the backGroundDrawable
> to null when the app loses focus.  I also do this on the onDestroy()
> and onPause() methods as well.
>
> My guess is that the app goes into pause mode and when restarted since
> I was reattaching the same animation to the ImageView it was causing a
> leak.
>
> Note this ImageView and Animation were not static variables they were
> loaded only on the onWindowFocusChange event.  I made the assumption
> since I was not letting my ImageView and Animation be created as
> static variables I wouldn't leak the Context, but apparently the
> recreation of the animation attachment to the ImageView was for some
> reason, this I'm not 100% sure on, but it seems to be the case.
>
> On Dec 10, 7:53 pm, Romain Guy  wrote:
>
> > DDMS has a feature to dump the Java heap. You can then analyze is
> > using tools like hat, MAT, JProfiler, etc.
>
> > On Thu, Dec 10, 2009 at 4:17 PM, Matt Kanninen  wrote:
> > > Got any advice on tools to use to debug the most likely situation
> > > you've described?  I'm at the point where I've ruled out static
> > > variables.
>
> > > I'm working on code that started with Android 1.0, and has had a
> > > series of developers since.  Good code analysis tools could help
> > > immensely.  It beats re writing every class.
>
> > > On Dec 10, 3:47 pm, Romain Guy  wrote:
> > >> If there's an OutOfMemoryError, it's most likely that the app is using
> > >> too much memory and/or leaking. Filing a bug won't help.
>
> > >> On Thu, Dec 10, 2009 at 3:43 PM, Matt Kanninen  
> > >> wrote:
> > >> > Best of luck.  I recommend you create a very small test application to
> > >> > reproduce the bug, and submit it to b.android.com.
>
> > >> > On Dec 10, 12:52 pm, Mark Hansen  wrote:
> > >> >> So I want to start an animation when my application starts that always
> > >> >> visible in the application.  So reading about the AnimationDrawable it
> > >> >> was stated to use onWindowFocusChanged instead of onCreate() to ensure
> > >> >> that animation would start properly in the UI thread.
>
> > >> >>         @Override
> > >> >>         public void onWindowFocusChanged(boolean hasFocus) {
> > >> >>                 super.onWindowFocusChanged(hasFocus);
>
> > >> >>                 AnimationDrawable cam;
> > >> >>                 ImageView iv = 
> > >> >> (ImageView)findViewById(R.id.ImageViewFuzzAnimation);
> > >> >>                 iv.setBackgroundResource(R.anim.fuzz_animation);
> > >> >>                 cam = (AnimationDrawable)iv.getBackground();
> > >> >>                 cam.start();
>
> > >> >>         }
>
> > >> >> This works fine, but if I leave my application and come back I get a
> > >> >> out of memory error, below is the log..
>
> > >> >> Can anyone help me out on what I may be doing wrong here?
>
> > >> >> 12-10 15:52:14.365: ERROR/dalvikvm-heap(3102): 805600-byte external
> > >> >> allocation too large for this process.
> > >> >> 12-10 15:52:14.373: ERROR/(3102): VM won't let us allocate 805600
> > >> >> bytes
> > >> >> 12-10 15:52:14.373: DEBUG/skia(3102): --- decoder->decode returned
> > >> >> false
> > >> >> 12-10 15:52:16.490: DEBUG/dalvikvm(1570): GC freed 797 objects / 43592
> > >> >> bytes in 94ms
> > >> >> 12-10 15:52:20.147: DEBUG/AndroidRuntime(3102): Shutting down VM
>
> > >> >> 12-10 15:52:20.147: ERROR/AndroidRuntime(3102): Uncaught handler:
> > >> >> thread main exiting due to uncaught exception
> > >> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):
> > >> >> java.lang.OutOfMemoryError: bitmap size exceeds VM budget
> > >> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> > >> >> android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
> > >> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> > >> >> android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:447)
> > >> >> 12-10 15:52:20.232: ERROR/

[android-developers] Re: US export law

2009-12-11 Thread Matt Kanninen
Not as described.  It is possible to break US export laws from code,
but its hard to do without seeing a big warning first.  IIRC you have
to code your own cryptography and make it too strong.  It's silly, and
I hope the law I'm thinking of isn't actually enforced anymore.

On Dec 11, 10:16 am, Andrei  wrote:
> If I access my web site using https from my app will it break any
> export laws?

-- 
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] } catch (OutOfMemoryError E) {

2009-12-11 Thread Matt Kanninen
Can I ask what Android does with un caught OutOfMemoryErrors that it
wouldn't do if I caught them?  It's really tempting for me to do this:

try {
setContentView(R.layout.result);
} catch (OutOfMemoryError E) {
   outOfMemoryCount++;
 e.printStackTrace();
  finish();
}

If I don't catch the OutOfMemory my activity crashes, but then the
user just clicks the button again and it loads great the second time.
So something happens resulting in the right memory being cleared.

-- 
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: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-11 Thread Matt Kanninen
You catch out of memory?  I wasn't willing to do that yet, but it
would solve all my problems...

On Dec 11, 7:09 am, Streets Of Boston  wrote:
> >>If you're nulling your static bitmap in onPause why is it static to begin 
> >>with?<<
>
> E.g. to have access to bitmaps outside of my activity, in classes that
> don't have reference to my activities.
>
> Or, in case there can be multiple instance of an activity, these
> instances can share 'expensive' data. But this requires something a
> bit more sophisticated than just nulling the static in the 'onDestroy
> ()'.
>
> In my gallery app i use static caches of thumbnails that are capacity
> limited. These caches manage themselves and don't rely on onPause or
> onDestroy. I do catch OutOfMemoryExceptions then clean these caches
> explicitly and try the operation that threw the execption again. So
> far, this has been working for me :)
>
> On Dec 10, 8:27 pm, Matt Kanninen  wrote:
>
> > I don't get it.  If you're nulling your static bitmap in onPause why
> > is it static to begin with?
>
> > Also what you want to do is probably very different for a game that is
> > basically all taking place in one activity and trying to avoid garbage
> > collecting at all, compared to your standard Android app with an
> > activity per screen.
>
> > On Dec 10, 4:53 pm, Streets Of Boston  wrote:
>
> > > Statically held (caches of) bitmaps may come in very very handy.
> > > However, as soon as you do hold static references to 'expensive'
> > > resources, be sure to have a proper clean-up strategy. E.g. make sure
> > > the capacity of your cache of bitmaps is limited. Be sure to set the
> > > static reference to null when the activity is destroyed or paused,
> > > etc.
>
> > > On Dec 10, 6:05 pm, Matt Kanninen  wrote:
>
> > > > I recommend the only things you make static be strings, and that for
> > > > everything else you are considering making static, instead write it to
> > > > file and use static methods, that expect to be passed a context, to
> > > > access the data.
>
> > > > I think my problems might be camera related, so my plan is to stop
> > > > using our own camera related activites and just use an intent to
> > > > launch the camera, and then read the returned result.
>
> > > > On Dec 10, 1:05 pm, fadden  wrote:
>
> > > > > On Dec 8, 12:28 pm, skominac  wrote:
>
> > > > > > So not only is memory of static members not deallocated (which is
> > > > > > actually not surprising), but the static references are still alive,
> > > > > > pointing to the memory, and can be used to invoke the members back.
> > > > > > This last part was surprising to me.
>
> > > > > > This is actually not bad, as long as developers are aware of it.
> > > > > > Is this Dalvik's feature?
>
> > > > > This is the expected behavior.  Keep in mind that the VM doesn't shut
> > > > > down between runs of your activity.  You are not necessarily starting
> > > > > with a clean slate.- 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: leaked window?

2009-12-11 Thread Matt Kanninen
On Dec 11, 9:45 am, stanlick  wrote:
> It sure seems like there is a lot of guess-and-be-golly with Android
> today.  I'm not complaining guys -- just stating my observation.

Today?  It always has, and always will be.  Although the problem could
be helped if Google starts hiring people specifically to improve the
Java docs.

-- 
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: Camera intent - what's safe to use?

2009-12-10 Thread Matt Kanninen
Ohh this is a lot uglier then I thought:

http://code.google.com/p/android/issues/detail?id=1480

I think we need a google blog post on how to do this and support 1.5,
1.6 and 2.0 handsets.

On Dec 10, 5:38 pm, Matt Kanninen  wrote:
> Ok I'm at the point where I'm trying to read back the image returned
> from the camera, I didn't notice till now the Hero is special.  So
> you're just doing what works for the Hero, catching the null pointer,
> then doing what works for the rest?
>
> I'm betting this is an Android 1.5 issue?  Most of the other phones
> are 1.6 now.  The Hero is odd for other reasons too though.
>
> On Dec 10, 11:15 am, Vytautas Vaitukaitis
>
>  wrote:
> > I'm using the following code to obtain the 512x384 resolution images
> > and it seems to work on all of the devices that I've tested it on (G1,
> > Hero, Droid, Tattoo, Magic and some others):
>
> >  - to start the camera app
>
> > intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
> > mImageCaptureUri = Uri.fromFile(new File
> > (Environment.getExternalStorageDirectory(), "test" + String.valueOf
> > (System.currentTimeMillis()) + ".jpg"));
> > intent.putExtra(MediaStore.EXTRA_OUTPUT, imageCaptureUri);
> > startActivityForResult(intent, Editable.IMAGE_CAPTURE_TAG);
>
> >  - to get the picture, in the onActivityResult() method
>
> > Uri source;
> > try
> > {
> >    // this only works with Hero's camera app - otherwise throws
> > NullPointerException
> >    source = data.getData();}
>
> > catch (Exception e)
> > {
> >    // cannot use this as the only case as Hero's camera app wouldn't
> > save the picture where it's asked to, in all of the other phones this
> > works, i.e. the picture is saved at the Uri passed with the intent...
> >    source = mImageCaptureUri;}
>
> > // do whatever you want to do with the image
>
> > If there are some issues with this approach, I would be grateful if
> > anyone could let me know.
>
> > On Dec 9, 3:23 am, API Tests  wrote:
>
> > > Hi,
>
> > > I'd like to let the user take a picture using the camera, then use it
> > > in my app. Ideally I could use the built-in camera app via an intent
> > > for this. It looks like there's a range of issues with the camera app
> > > though:
>
> > >  http://code.google.com/p/android/issues/detail?id=1480
>
> > > is the only reliable option to use the 192x256 memory-only image
> > > supplied by the camera intent? The following seems to not work:
>
> > >  1) Asking the camera intent to write a 'full size' image to disk.
> > >  2) Writing your own camera app (issues on different devices etc).
>
> > > The Facebook app seems to use the memory-only 192x256 option, probably
> > > because that's the only safe option. Anyone else have different
> > > opinions / experiences?
>
> > > Thanks
>
>

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


[android-developers] Re: Camera intent - what's safe to use?

2009-12-10 Thread Matt Kanninen
Ok I'm at the point where I'm trying to read back the image returned
from the camera, I didn't notice till now the Hero is special.  So
you're just doing what works for the Hero, catching the null pointer,
then doing what works for the rest?

I'm betting this is an Android 1.5 issue?  Most of the other phones
are 1.6 now.  The Hero is odd for other reasons too though.

On Dec 10, 11:15 am, Vytautas Vaitukaitis
 wrote:
> I'm using the following code to obtain the 512x384 resolution images
> and it seems to work on all of the devices that I've tested it on (G1,
> Hero, Droid, Tattoo, Magic and some others):
>
>  - to start the camera app
>
> intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
> mImageCaptureUri = Uri.fromFile(new File
> (Environment.getExternalStorageDirectory(), "test" + String.valueOf
> (System.currentTimeMillis()) + ".jpg"));
> intent.putExtra(MediaStore.EXTRA_OUTPUT, imageCaptureUri);
> startActivityForResult(intent, Editable.IMAGE_CAPTURE_TAG);
>
>  - to get the picture, in the onActivityResult() method
>
> Uri source;
> try
> {
>    // this only works with Hero's camera app - otherwise throws
> NullPointerException
>    source = data.getData();}
>
> catch (Exception e)
> {
>    // cannot use this as the only case as Hero's camera app wouldn't
> save the picture where it's asked to, in all of the other phones this
> works, i.e. the picture is saved at the Uri passed with the intent...
>    source = mImageCaptureUri;}
>
> // do whatever you want to do with the image
>
> If there are some issues with this approach, I would be grateful if
> anyone could let me know.
>
> On Dec 9, 3:23 am, API Tests  wrote:
>
> > Hi,
>
> > I'd like to let the user take a picture using the camera, then use it
> > in my app. Ideally I could use the built-in camera app via an intent
> > for this. It looks like there's a range of issues with the camera app
> > though:
>
> >  http://code.google.com/p/android/issues/detail?id=1480
>
> > is the only reliable option to use the 192x256 memory-only image
> > supplied by the camera intent? The following seems to not work:
>
> >  1) Asking the camera intent to write a 'full size' image to disk.
> >  2) Writing your own camera app (issues on different devices etc).
>
> > The Facebook app seems to use the memory-only 192x256 option, probably
> > because that's the only safe option. Anyone else have different
> > opinions / experiences?
>
> > Thanks
>
>

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


[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-10 Thread Matt Kanninen
I don't get it.  If you're nulling your static bitmap in onPause why
is it static to begin with?

Also what you want to do is probably very different for a game that is
basically all taking place in one activity and trying to avoid garbage
collecting at all, compared to your standard Android app with an
activity per screen.


On Dec 10, 4:53 pm, Streets Of Boston  wrote:
> Statically held (caches of) bitmaps may come in very very handy.
> However, as soon as you do hold static references to 'expensive'
> resources, be sure to have a proper clean-up strategy. E.g. make sure
> the capacity of your cache of bitmaps is limited. Be sure to set the
> static reference to null when the activity is destroyed or paused,
> etc.
>
> On Dec 10, 6:05 pm, Matt Kanninen  wrote:
>
> > I recommend the only things you make static be strings, and that for
> > everything else you are considering making static, instead write it to
> > file and use static methods, that expect to be passed a context, to
> > access the data.
>
> > I think my problems might be camera related, so my plan is to stop
> > using our own camera related activites and just use an intent to
> > launch the camera, and then read the returned result.
>
> > On Dec 10, 1:05 pm, fadden  wrote:
>
> > > On Dec 8, 12:28 pm, skominac  wrote:
>
> > > > So not only is memory of static members not deallocated (which is
> > > > actually not surprising), but the static references are still alive,
> > > > pointing to the memory, and can be used to invoke the members back.
> > > > This last part was surprising to me.
>
> > > > This is actually not bad, as long as developers are aware of it.
> > > > Is this Dalvik's feature?
>
> > > This is the expected behavior.  Keep in mind that the VM doesn't shut
> > > down between runs of your activity.  You are not necessarily starting
> > > with a clean slate.- 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: Camera intent - what's safe to use?

2009-12-10 Thread Matt Kanninen
As I understand it if you do

public static final boolean DEBUG = false;

if(DEBUG){
   doStuff();
}

javac will strip the doStuff call since it's known to be unreachable
at compile time.

On Dec 10, 4:59 pm, Jason Proctor 
wrote:
> it would be nice to -
>
> #ifdef DEBUG
> #define Log.i()
> ...
>
> etc, but OTOH, preprocessors are very easily abusable.
>
>
>
> >On Android I'd say java or javac is basically a preprocessor for
> >dalvik.
>
> >On Dec 10, 4:39 pm, Jason Proctor 
> >wrote:
> >>  >On a similar note, what do yall use for your log tags?  I go back and
> >>  >forth between static final Strings and this.getClass().getCanonicalName
> >>  >().  The CONSTANT strings annoy me, since I'm always adding and
> >>  >removing them to reduce my compiler warnings for unused variables, as
> >>  >I add and remove logging.
>
> >>  i go back and forth between wishing Java had a preprocessor, and
> >>  being relieved that it doesn't
>
> >>  --
> >>  jason.vp.engineering.particle
>
> >--
> >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
>
> --
> jason.vp.engineering.particle

-- 
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: Camera intent - what's safe to use?

2009-12-10 Thread Matt Kanninen
On Android I'd say java or javac is basically a preprocessor for
dalvik.

On Dec 10, 4:39 pm, Jason Proctor 
wrote:
> >On a similar note, what do yall use for your log tags?  I go back and
> >forth between static final Strings and this.getClass().getCanonicalName
> >().  The CONSTANT strings annoy me, since I'm always adding and
> >removing them to reduce my compiler warnings for unused variables, as
> >I add and remove logging.
>
> i go back and forth between wishing Java had a preprocessor, and
> being relieved that it doesn't
>
> --
> jason.vp.engineering.particle

-- 
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: Camera intent - what's safe to use?

2009-12-10 Thread Matt Kanninen
Thanks for this, on reading it, it occured to me I have no reason not
to invoke the standard camera intent instead of what I'm doing now.

I just spent some time looking for best practices for result codes.  I
didn't find much, I plan to use MYACTIVITY.class.hashCode().

On a similar note, what do yall use for your log tags?  I go back and
forth between static final Strings and this.getClass().getCanonicalName
().  The CONSTANT strings annoy me, since I'm always adding and
removing them to reduce my compiler warnings for unused variables, as
I add and remove logging.

-MK

On Dec 10, 11:24 am, Vytautas Vaitukaitis
 wrote:
> Sorry, as the code was directly pasted from my app's code, the line
>
> "startActivityForResult(intent, Editable.IMAGE_CAPTURE_TAG);"
>
> might be confusing - Editable.IMAGE_CAPTURE_TAG doesn't have anything
> to do with this excerpt, use any request code instead..
>
> Vytautas
>
> was copy-pasted from my sour
>
> On Dec 10, 7:15 pm, Vytautas Vaitukaitis
>
>  wrote:
> > I'm using the following code to obtain the 512x384 resolution images
> > and it seems to work on all of the devices that I've tested it on (G1,
> > Hero, Droid, Tattoo, Magic and some others):
>
> >  - to start the camera app
>
> > intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
> > mImageCaptureUri = Uri.fromFile(new File
> > (Environment.getExternalStorageDirectory(), "test" + String.valueOf
> > (System.currentTimeMillis()) + ".jpg"));
> > intent.putExtra(MediaStore.EXTRA_OUTPUT, imageCaptureUri);
> > startActivityForResult(intent, Editable.IMAGE_CAPTURE_TAG);
>
> >  - to get the picture, in the onActivityResult() method
>
> > Uri source;
> > try
> > {
> >    // this only works with Hero's camera app - otherwise throws
> > NullPointerException
> >    source = data.getData();}
>
> > catch (Exception e)
> > {
> >    // cannot use this as the only case as Hero's camera app wouldn't
> > save the picture where it's asked to, in all of the other phones this
> > works, i.e. the picture is saved at the Uri passed with the intent...
> >    source = mImageCaptureUri;}
>
> > // do whatever you want to do with the image
>
> > If there are some issues with this approach, I would be grateful if
> > anyone could let me know.
>
> > On Dec 9, 3:23 am, API Tests  wrote:
>
> > > Hi,
>
> > > I'd like to let the user take a picture using the camera, then use it
> > > in my app. Ideally I could use the built-in camera app via an intent
> > > for this. It looks like there's a range of issues with the camera app
> > > though:
>
> > >  http://code.google.com/p/android/issues/detail?id=1480
>
> > > is the only reliable option to use the 192x256 memory-only image
> > > supplied by the camera intent? The following seems to not work:
>
> > >  1) Asking the camera intent to write a 'full size' image to disk.
> > >  2) Writing your own camera app (issues on different devices etc).
>
> > > The Facebook app seems to use the memory-only 192x256 option, probably
> > > because that's the only safe option. Anyone else have different
> > > opinions / experiences?
>
> > > Thanks
>
>

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


[android-developers] Re: AnimationDrawable and Out of Memory Errors

2009-12-10 Thread Matt Kanninen
Got any advice on tools to use to debug the most likely situation
you've described?  I'm at the point where I've ruled out static
variables.

I'm working on code that started with Android 1.0, and has had a
series of developers since.  Good code analysis tools could help
immensely.  It beats re writing every class.

On Dec 10, 3:47 pm, Romain Guy  wrote:
> If there's an OutOfMemoryError, it's most likely that the app is using
> too much memory and/or leaking. Filing a bug won't help.
>
>
>
> On Thu, Dec 10, 2009 at 3:43 PM, Matt Kanninen  wrote:
> > Best of luck.  I recommend you create a very small test application to
> > reproduce the bug, and submit it to b.android.com.
>
> > On Dec 10, 12:52 pm, Mark Hansen  wrote:
> >> So I want to start an animation when my application starts that always
> >> visible in the application.  So reading about the AnimationDrawable it
> >> was stated to use onWindowFocusChanged instead of onCreate() to ensure
> >> that animation would start properly in the UI thread.
>
> >>         @Override
> >>         public void onWindowFocusChanged(boolean hasFocus) {
> >>                 super.onWindowFocusChanged(hasFocus);
>
> >>                 AnimationDrawable cam;
> >>                 ImageView iv = 
> >> (ImageView)findViewById(R.id.ImageViewFuzzAnimation);
> >>                 iv.setBackgroundResource(R.anim.fuzz_animation);
> >>                 cam = (AnimationDrawable)iv.getBackground();
> >>                 cam.start();
>
> >>         }
>
> >> This works fine, but if I leave my application and come back I get a
> >> out of memory error, below is the log..
>
> >> Can anyone help me out on what I may be doing wrong here?
>
> >> 12-10 15:52:14.365: ERROR/dalvikvm-heap(3102): 805600-byte external
> >> allocation too large for this process.
> >> 12-10 15:52:14.373: ERROR/(3102): VM won't let us allocate 805600
> >> bytes
> >> 12-10 15:52:14.373: DEBUG/skia(3102): --- decoder->decode returned
> >> false
> >> 12-10 15:52:16.490: DEBUG/dalvikvm(1570): GC freed 797 objects / 43592
> >> bytes in 94ms
> >> 12-10 15:52:20.147: DEBUG/AndroidRuntime(3102): Shutting down VM
>
> >> 12-10 15:52:20.147: ERROR/AndroidRuntime(3102): Uncaught handler:
> >> thread main exiting due to uncaught exception
> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):
> >> java.lang.OutOfMemoryError: bitmap size exceeds VM budget
> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> >> android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> >> android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:447)
> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> >> android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:
> >> 323)
> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> >> android.graphics.drawable.Drawable.createFromResourceStream
> >> (Drawable.java:697)
> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> >> android.content.res.Resources.loadDrawable(Resources.java:1705)
> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> >> android.content.res.Resources.getDrawable(Resources.java:580)
> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> >> android.graphics.drawable.AnimationDrawable.inflate
> >> (AnimationDrawable.java:265)
> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> >> android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:
> >> 788)
> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> >> android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> >> android.content.res.Resources.loadDrawable(Resources.java:1690)
> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> >> android.content.res.Resources.getDrawable(Resources.java:580)
> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> >> android.view.View.setBackgroundResource(View.java:7187)
> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> >> com.stonedonkey.santatracker.ActivityGUI.onWindowFocusChanged
> >> (ActivityGUI.java:170)
> >> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> >> com.android.internal.policy.impl.PhoneWindow
> >> $DecorView.onWindowFocusChanged(PhoneWi

[android-developers] Re: Block Switch App

2009-12-10 Thread Matt Kanninen
Not only is the source there, but it's pretty liberally licensed.  I'm
a fan of the Apache License now.

On Dec 10, 12:57 pm, Jason Proctor 
wrote:
> (btw, i have no connection with Google and IMHO Android is great but
> in no way perfect. but claiming that it's not open when the source is
> right there, well...)
>
> --
> jason.vp.engineering.particle

-- 
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: AnimationDrawable and Out of Memory Errors

2009-12-10 Thread Matt Kanninen
Best of luck.  I recommend you create a very small test application to
reproduce the bug, and submit it to b.android.com.

On Dec 10, 12:52 pm, Mark Hansen  wrote:
> So I want to start an animation when my application starts that always
> visible in the application.  So reading about the AnimationDrawable it
> was stated to use onWindowFocusChanged instead of onCreate() to ensure
> that animation would start properly in the UI thread.
>
>         @Override
>         public void onWindowFocusChanged(boolean hasFocus) {
>                 super.onWindowFocusChanged(hasFocus);
>
>                 AnimationDrawable cam;
>                 ImageView iv = 
> (ImageView)findViewById(R.id.ImageViewFuzzAnimation);
>                 iv.setBackgroundResource(R.anim.fuzz_animation);
>                 cam = (AnimationDrawable)iv.getBackground();
>                 cam.start();
>
>         }
>
> This works fine, but if I leave my application and come back I get a
> out of memory error, below is the log..
>
> Can anyone help me out on what I may be doing wrong here?
>
> 12-10 15:52:14.365: ERROR/dalvikvm-heap(3102): 805600-byte external
> allocation too large for this process.
> 12-10 15:52:14.373: ERROR/(3102): VM won't let us allocate 805600
> bytes
> 12-10 15:52:14.373: DEBUG/skia(3102): --- decoder->decode returned
> false
> 12-10 15:52:16.490: DEBUG/dalvikvm(1570): GC freed 797 objects / 43592
> bytes in 94ms
> 12-10 15:52:20.147: DEBUG/AndroidRuntime(3102): Shutting down VM
>
> 12-10 15:52:20.147: ERROR/AndroidRuntime(3102): Uncaught handler:
> thread main exiting due to uncaught exception
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):
> java.lang.OutOfMemoryError: bitmap size exceeds VM budget
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:447)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:
> 323)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.graphics.drawable.Drawable.createFromResourceStream
> (Drawable.java:697)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.content.res.Resources.loadDrawable(Resources.java:1705)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.content.res.Resources.getDrawable(Resources.java:580)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.graphics.drawable.AnimationDrawable.inflate
> (AnimationDrawable.java:265)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:
> 788)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.graphics.drawable.Drawable.createFromXml(Drawable.java:729)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.content.res.Resources.loadDrawable(Resources.java:1690)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.content.res.Resources.getDrawable(Resources.java:580)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.view.View.setBackgroundResource(View.java:7187)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> com.stonedonkey.santatracker.ActivityGUI.onWindowFocusChanged
> (ActivityGUI.java:170)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> com.android.internal.policy.impl.PhoneWindow
> $DecorView.onWindowFocusChanged(PhoneWindow.java:1969)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.view.View.dispatchWindowFocusChanged(View.java:3731)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:656)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.view.ViewRoot.handleMessage(ViewRoot.java:1819)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.os.Looper.loop(Looper.java:123)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> android.app.ActivityThread.main(ActivityThread.java:4338)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> java.lang.reflect.Method.invokeNative(Native Method)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> java.lang.reflect.Method.invoke(Method.java:521)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
> (ZygoteInit.java:860)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
> 12-10 15:52:20.232: ERROR/AndroidRuntime(3102):     at
> dalvik.system.NativeStart.main(Native Method)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@

[android-developers] Re: noHistory="true" rocks

2009-12-10 Thread Matt Kanninen
I love the suggestion though, it beats modifiying the manifest for
debugging. I recall finding a way to do it from code too, but so far I
have resisted my bosses suggestions to change our back functionality
only for the Droid.

What I am tempted to do is noHistory all but one or a few of my
activities, then whenever managements decides we really do want to be
able to go back, over ride the back button and specify specifically
where to go in the case the user hits back.  It's ugly, and against
paradigm, but it would improve our stability on the Droid.

On Dec 10, 3:01 pm, Dianne Hackborn  wrote:
> Another thing you can do is use Dev Tools to turn on "Immediately destroy
> activities" in its Development settings.  This causes every activity to be
> destroyed once it is no longer visible.  (I assume you are achieving the
> same thing here by having the activity dropped from the history stack...
>  though I could be totally wrong. :p)
>
>
>
> On Thu, Dec 10, 2009 at 2:56 PM, Matt Kanninen  wrote:
> >         > android:label="@string/arl_results"
> > android:screenOrientation="portrait" android:noHistory="true"> > activity>
>
> > this was invaluable in debugging Droid out of Bitmap memory issues.
>
> > --
> > 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
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

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


[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-10 Thread Matt Kanninen
I recommend the only things you make static be strings, and that for
everything else you are considering making static, instead write it to
file and use static methods, that expect to be passed a context, to
access the data.

I think my problems might be camera related, so my plan is to stop
using our own camera related activites and just use an intent to
launch the camera, and then read the returned result.

On Dec 10, 1:05 pm, fadden  wrote:
> On Dec 8, 12:28 pm, skominac  wrote:
>
> > So not only is memory of static members not deallocated (which is
> > actually not surprising), but the static references are still alive,
> > pointing to the memory, and can be used to invoke the members back.
> > This last part was surprising to me.
>
> > This is actually not bad, as long as developers are aware of it.
> > Is this Dalvik's feature?
>
> This is the expected behavior.  Keep in mind that the VM doesn't shut
> down between runs of your activity.  You are not necessarily starting
> with a clean slate.

-- 
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] noHistory="true" rocks

2009-12-10 Thread Matt Kanninen


this was invaluable in debugging Droid out of Bitmap memory issues.

-- 
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: List view with textviews and imageview, best practices

2009-12-10 Thread Matt Kanninen
I did something similar, but the textView is populated from SQLLite.
I'm still having issues with the SQLLite cursor.  I tried:

http://developer.android.com/reference/android/app/Activity.html#startManagingCursor%28android.database.Cursor%29

but at best it throws ugly log messages.

So I'm implenting onPause, onResume etc to manage it myself, which is
annoying for a ListView since ListView seems to need my cursor open.

Really I just want to materialize the view, and re fetch it on resume,
not leave an open database connection, it's a tiny database since
every row in the database is reflected in the UI (so it crops to 10
items).  That's been harder then it feels it should be.

On Dec 10, 8:33 am, theSmith  wrote:
> Patrick,
>
> I would suggest using a custom ArrayAdapter that uses the 'view
> holder' concept to manage the child views.
> Also instead of using a linearlayout I would use a relative layout as
> it will render faster because your layout tree won't be as deep.
>
> Im not use how you are 'lazy loading' now, but using a separate thread
> that loads the images should do the trick, as it will not lock up the
> UI thread.
>
> -theSmith
>
> On Dec 10, 4:19 am, Patrick Plaatje  wrote:
>
> > Hi All,
>
> > i'm developing an application which has an listview. I'm currently creating
> > the list item view dynamically from code (linearlayout, which includes 2
> > textviews and 1 imageview), but i'd like to use an XML resource for this. I
> > read it isresource intensive when getting this view using findViewById
> > within a loop. I thougth of using a custom adapter for this, but am not sure
> > on how to include lazy loading of the image then. Anyone has some
> > suggestions for this?
>
> > Regards,
>
> > Patrick
>
>

-- 
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: Only Droid Support Bluetooth API?

2009-12-09 Thread Matt Kanninen
I've had bluetooth issues on my Droid.  I was able to get voice and
music over bluetooth with my Jabra headset, but not my Sony car
stereo.  My Blackberry 8830 was able to play music fine over said
stereo for years.

I'm ready to put a good stereo into my 2 other cars, I was planning on
waiting though until I saw some users recommend specific car stereos
that bluetooth well with the Droid.

-MK

On Nov 25, 2:19 pm, moneytoo  wrote:
> I've used G1 with "beta" 2.0 (from xda-devs) for developing Bluetooth
> application. I have to say it works perfectly. I had no stability
> issues. I have few testers with Droid and the app I'm working on works
> fine for them too.

-- 
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: The way to access the android phone.

2009-12-09 Thread Matt Kanninen
Write an Android application, send the apk to the handset from your PC
software.  Profit.

On Dec 9, 3:47 pm, Paul Turchenko  wrote:
> Same here
>
> On Dec 8, 2:17 pm, feng jack  wrote:
>
> > Hi, Buddies,
>
> > I am writing a PC software, which is used to read, write, and update
> > the contact information, send SMS, and change the settings of the
> > phone from a PC connected to a Android phone via USB.
>
> > Currently, the way I figured out is to use adb, but, I found that adb
> > is be able to work only if the debug model is switched on in Phone
> > side. So, I am wondering if there there is any better way to develop
> > this kind of software.
>
> > If the adb is the only way, can we just conquer the 'debug model'
> > problem by any means?
>
> > Thanks a lot.
>
>

-- 
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: Who do you consider as the Android mobile Apps developers Guru ?

2009-12-04 Thread Matt Kanninen
Go to http://groups.google.com/group/android-developers/about, it's
the top 2 most frequent poster Dianne Hackborn and Mark Murphy.  The
both are rated 4 stars with over 200 ratings!

One gets paid by google to, among other things, Guru for us, and the
other gets payed by us when you buy his very reasonably priced books
or digital subscription.

End plug.


On Dec 4, 6:18 am, Ellimac  wrote:
> If you had to suggest 2 to 3 names of Android Gurus, who will you
> suggest?
> What lead you to these choices?
>
> Would you like to be able to chat with them?
>
> Ellimac

-- 
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: HTML sanitization

2009-12-04 Thread Matt Kanninen
http://d.android.com/reference/android/text/Html.html

This lets you put sanitized html content into a textview.  It's great
for clickable links or styled text with inline images if you aren't
too picky about where the image ends up.   It's going to basically
treat each image as a character in the textfield, in terms of how it
looks.

The sanitized html is returned as a Spanned:

http://d.android.com/reference/android/text/Spanned.html

which is a really useful class, and this is a good way to start using
it.  Often if I want to display simple stylized text the easiest way I
can find is to create some simple html, and use the above method.

It's weak on properly wrapping text around the images, you can have
one line of text to the left and or right of an image, but you can't
wrap multiple lines around, so a lot of white space will be created
with tall images.

-My 2 cents

On Dec 4, 1:02 am, Samuh  wrote:
> > The best way I can think of getting around this problem
> > would be showing your HTML content inside a WebView. :)
>
> Thanks for your reply Bibek. That is exactly what I am currently
> doing.
>
> However, I think a WebView would definitely be heavier than a
> TextView. Assuming, I receive say 20 items in the feed wouldn't
> creating 20 WebView instances affect the memory footprint of the
> module?

-- 
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] New SDK!

2009-12-03 Thread Matt Kanninen
As I wait for it download I'll enjoy the documentation.  I'm
particularly excited about:

http://developer.android.com/guide/developing/tools/layoutopt.html

layoutopt

layoutopt is a command-line tool that helps you optimize the layouts
and layout hierarchies of your applications. You can run it against
your layout files or resource directories to quickly check for
inefficiencies or other types of problems that could be affecting the
performance of your application.

To run the tool, open a terminal and launch layoutopt  from
your SDK tools/ directory. In the command, supply a list of uncompiled
resource xml files or directories that you want to analyze.

When run, the tool loads the specified XML files and analyzes their
layout structures and hierarchies according to a set of predefined
rules. If it detects issues, it outputs information about the issues,
giving filename, line numbers, description of issue, and for some
types of issues a suggested resolution.

Here's an example of the output:

$ layoutopt samples/
samples/compound.xml
   7:23 The root-level  can be replaced with 
   11:21 This LinearLayout layout or its FrameLayout parent is useless
samples/simple.xml
   7:7 The root-level  can be replaced with 
samples/too_deep.xml
   -1:-1 This layout has too many nested layouts: 13 levels, it should
have <= 10!
   20:81 This LinearLayout layout or its LinearLayout parent is
useless
   24:79 This LinearLayout layout or its LinearLayout parent is
useless
   28:77 This LinearLayout layout or its LinearLayout parent is
useless
   32:75 This LinearLayout layout or its LinearLayout parent is
useless
   36:73 This LinearLayout layout or its LinearLayout parent is
useless
   40:71 This LinearLayout layout or its LinearLayout parent is
useless
   44:69 This LinearLayout layout or its LinearLayout parent is
useless
   48:67 This LinearLayout layout or its LinearLayout parent is
useless
   52:65 This LinearLayout layout or its LinearLayout parent is
useless
   56:63 This LinearLayout layout or its LinearLayout parent is
useless
samples/too_many.xml
   7:413 The root-level  can be replaced with 
   -1:-1 This layout has too many views: 81 views, it should have <=
80!
samples/useless.xml
   7:19 The root-level  can be replaced with 
   11:17 This LinearLayout layout or its FrameLayout parent is useless

The layoutopt tool is available in SDK Tools, Revision 3 or later. If
you do not have SDK Tools r3 or later installed in your SDK, you can
download it from the Android SDK repository site using the Android SDK
and AVD Manager. For information, see Adding SDK Components.
Usage

To run layoutopt against a given list of layout resources:

layoutopt 

For example:

$ layoutopt res/layout-land

$ layoutopt res/layout/main.xml res/layout-land/main.xml

-- 
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: Load Android App on HTC Smartphone?

2009-12-03 Thread Matt Kanninen
Go to your settings on your phone, make sure your application
development settings have USB debugging checked.

Do this on every phone you encounter, as soon as you encounter it.

On Dec 3, 10:08 am, VBMichi  wrote:
> Already done, but the device list is still empty.
>
> 1. debugable = true
> 2. USB-Debuging enabled
> 3. Windows USB-Drivers successfull installed
> 4. Touch G2 connected to PC
> 5. Hardware recognized successfull
>
> -> device list empty...
>
> On 3 Dez., 19:01, rus  wrote:
>
> > Hey,
> > Check this out:http://developer.android.com/guide/developing/device.html
> > It helped me when I needed to test my Apps on the phone. My phone is
> > HTC Magic
> > but I am sure if you follow the instructions you will be up in no
> > time.
>
> > On Dec 3, 4:26 pm, VBMichi  wrote:
>
> > > Hi,
>
> > > I've get a HTC Hero Touch G2 for testing my android apps.
> > > How can I load the developed apps of my PC to the HTC?
>
> > > I heard smth about "root local"?
>
> > > Maybe anyone has a detailed instruction or a website?
>
> > > Thanks!
>
>

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


[android-developers] Re: how to support multi-touch of Android cupcake?

2009-12-03 Thread Matt Kanninen
http://groups.google.com/group/android-platform

What led you to post that question here?  Was it a google search?
What was your search term?  Did you follow a link?  From where?

On Dec 3, 1:44 am, JW  wrote:
> Is there anyone know how to add multi-touch function in cupcake?
>
> I found that linux kernel 2.6.30 had a new multi-touch protocl,
> did that mean I must upgrade my kernel to be 2.6.30+?

-- 
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 install my app and keep an icon from showing up in the application tray

2009-12-03 Thread Matt Kanninen
I recommend you don't display anything to the user until the next time
they run the main application, and on first run of the main
application you congratulate the user on the upgrade.

You could go over board and add more code to the main application to
test for the existence of the second application, going so far as to
add a service in your main application, that checks for the existence
of upgrades.

Android lets you go over board :)

-My 2 cents

On Dec 3, 9:51 am, Mike  wrote:
> Here's my use case that will hopefully explain why I even want to do
> this:
>
> 1) I have a free app
> 2) I wrote another app that serves strictly as a token which the user
> can purchase to "upgrade" features in the free app
> 3) When they purchase the upgrade app, I want to give them the
> impression they actually downloaded it and it installed correctly.
> Simply having it install without any confirmation will, I assure you,
> result in countless emails to me.
> 4) I really don't want to have to show the "upgrade" app in their app
> tray since they now would have two icons.
>
> So, with all that's been discussed, let me ask a different question.
> Is there a way to programmatically remove an icon from the tray after
> the activity has been shown and still keep the app installed on the
> phone?
>
> - Mike
>
> On Dec 3, 10:44 am, "Mark Murphy"  wrote:
>
> > > Thanks.  That works.
>
> > > BUT... I should have clarified myself a little bit.  Not only do I
> > > want to prevent the icon from getting placed in the app tray, but I
> > > still need the main activity to run and display a message to the
> > > user.
>
> > Fortunately, that's not possible. The only way the user will be able to
> > launch your application is if you put an icon in the launcher.
>
> > > I suppose I can write my own class that extends Application and
> > > create an Intent that shows this Activity in onCreate?
>
> > Except that your Application will never run unless it is launched, and the
> > first launch has to be by the user.
>
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com
> > Android App Developer Books:http://commonsware.com/books.html
>
>

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


[android-developers] Re: Beginner Bitmap Question

2009-12-03 Thread Matt Kanninen
http://developer.android.com/guide/topics/graphics/index.html#draw-with-canvas

I think you next need to display your canvas.  It does not appear to
be attached to your view hierarchy, that I can see.  You setContetView
main, but I don't see you attach to any views.

On Dec 3, 9:37 am, Neilz  wrote:
> I would have guessed that your drawing needs to be done within the
> draw (or onDraw()?) method, which you have to overide. I'm not sure if
> drawing from another method has any effect, but even if it does it is
> probably being 'overdrawn' when the real draw method is called.
>
> Check out SDK samples for use of onDraw();
>
> Someone probably has a better explanation than this...
>
> On Dec 3, 6:10 am, Joe Momma  wrote:
>
> > Eventually I would like to try to port a code I found here:
>
> >http://bodytag.org/tp02/
>
> > I am very new to this though, and I can't even load my image to
> > display.  What I have so far is below, but it doesn't show anything
> > when I run it.  What am I doing wrong?
>
> > Also once I have this loaded will this image be able to be manipulated
> > the way I want to?
>
> > Any help would be appreciated.
>
> > public class Ripple extends Activity {
>
> >     LinearLayout mLinearLayout;
> > //    View mView;
>
> >     /** Called when the activity is first created. */
> >     @Override
> >     public void onCreate(Bundle savedInstanceState)
> >     {
> >         super.onCreate(savedInstanceState);
> >         setContentView(R.layout.main);
>
> >         loadImage();
> >     }
>
> >     public void loadImage () {
> >       Paint mPaint;
> >       Canvas mCanvas;
> >       mPaint = new Paint();
> >       mCanvas = new Canvas();
>
> >       Bitmap baseImage = BitmapFactory.decodeResource(getResources(),
> > R.drawable.my_image);
>
> >       mCanvas.drawBitmap(baseImage, 0, 0, null);
> >       Log.i("draw","Drew");
>
> >     }
>
> > }
>
>

-- 
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: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-03 Thread Matt Kanninen
"My" app involves taking a picture with the camera, or recording voice
using the microphone, and sending the results to the server.  It's a
search tool.  The UI isn't very complicated, as much as possible it is
done in XML.   For the droid we added some layouts in res/long that
differ only in layout margins.

I, like a great many Android developers, had to re create the look and
feel that was established with our iPhone application.  On the droid
we had gradient banding so we pre dithered a png, but that was the art
guy.  The layouts could be simpler, but I have already repeatedly
simplified them from the first version that had the right look and
feel.

I have some FrameLayouts, containing RelativeLayouts, containing
single Views.  It seems like RelativeLayout has been redone and is
less brittle then I remember it,  so I probably can start skipping the
FrameLayouts.  Framelayouts just seem like the simple easy way to
control over lap of views, and I often have 4 over lapping views.  I
also have some linear layouts in side other linear layouts, but all
with different weights.

The 1 or 2 pixel differences between 1.5,1.6 and 2.0 make our
application look worse on the Hero.  I use ListViews, that sometimes
are populated by CursorAdapters.  I have gone back and forth between
letting the activity manage the cursors, and managing them myself.

(I'm referencing AdMob and other's numbers to try and figure out what
Android versions I need to support, and what handsets I need to test
on
http://daringfireball.net/linked/2009/11/23/admob  )

Much of the code for "my" app was written for Android 1.0, 1.1 etc.
and it has been maintained by different developers over the years.

Now I guess my task is to go over every line of code and reduce how
much memory is used.  I've tried to check every static reference that
wasn't a private static final constant primitive, to make sure we
weren't hindering garbage collection.  I don't think I ever store a
context, but we pass them around everywhere as arguments.  I can't
really recycle my drawables because I'm not managing them, I just call
setContentView.

My activities have some member variables, views, etc.  I create some
handlers, but more often just call runOnUiThread.  I guess I can
explicitly set these to null in onStop...  when I hear "improve memory
management" my first response is to set things null, my problem is the
unusual lifecycle of an Android application, it's activities, and it's
static variables.  I'm already prepared for my major static variables,
strings, to unexpectedly become null, and write my strings to a
private preference, or save my camera or microphone content as a
private application file.

It's all pretty vanilla.  The networking is done using some included
apache jars, I guess I could redo all my networking to use something
else, that would make it even more vanilla.  But I will probably wait
until my application becomes less vanilla and we need a push solution.

SoftwareForMe, I have read your post a couple times now, I think it's
clear to me now.  Generating a new version of most or all of our PNGs,
especially our largest, sounds like a good idea.  Is there a good blog
post I can send to the art guy so he can understand what he needs to
do?  I'd like not to have to go 11 more revisions on each asset.

It'd be real cool if there was an easy way to just remove all my
unused PNGs from my project, before I double them.  I have not go
through and removed every PNG that is no longer being referenced yet.

My 2 cents,
Matt Kanninen
Android Developer

On Dec 2, 8:38 pm, "SoftwareForMe.com SoftwareForMe.com"
 wrote:
> The bitmap issue on the Droid is really about whether you want to show more
> graphics at smaller size, or the same graphics at larger size.
>
> I don't know what you app does, but imagine that it's a 2d game, where the
> graphics are re-used a lot (land tiles, character icons, etc.).
>
> If you let the higher resolution screen show more of the game map at a time,
> your program will consume NEARLY identical memory to what it would on other
> devices. Why? Because the tiles will be the same size in memory; the only
> thing that would be larger would be the screen surface, and any back buffers
> you use.
>
> On the other hand, if you want the graphics on the Droid to look the same
> (same game play area visible), then without work, your application will take
> more memory on the Droid. Why? Because unless you explicitly avoid it,
> Android will scale your image up to higher resolution when you load them, so
> they take more memory.
>
> The solutions are to:
> 1) Create high-density images that are simply smaller, but occupy the same
> number of pixels. This way, loading resources on the denser devices won't
> take any memory, or
> 2) Res

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-02 Thread Matt Kanninen
The same code works great on the G1 and the MyTouch.  We've done some
testing on the Hero, and the Moment, but only on the Droid is the
issue significant.  I've told my boss that I am spending time porting
to the Droid.

You have explained that "bitmaps are scaled and require more memory".
This creates a stricter limitation, on the complexity possible for my
xml, on the frequency with which I can create bitmaps, etc.

It's a bug if an application works on phones A, B, C and D, but not
E.  My first instinct is not to blame the guy who wrote the
application, but the guys responsible for handset E's software.  In
fact situations like that are the textbook case for a bug with handset
E.  Especially if handset E is newer, or running a newer firmware then
handsets A, B, C and D.

I think this is a big deal, especially given the fact for a lot of
users and non users, Droid  --  Android.  I'd consider it a priority
to make sure that G1 applications can run on the Droid.

Extensive googling didn't lead me to a lot of other people
complaining, so I may be one of the unlucky few who happens to use the
exact amount of memory such that it works on every phone but the
Droid.  I'm not unfamiliar with that sort of luck :)

Extensive googling did lead me to old posts I remember reading the
year they were written, and I remember being suprised by how Bitmap
memory was handled then.



On Dec 2, 5:40 pm, Romain Guy  wrote:
> The new device does not have stricter limitations since it gives apps
> more RAM (24 MB instead of 16 MB.)
>
>
>
> On Wed, Dec 2, 2009 at 5:29 PM, Matt Kanninen  wrote:
> > What did I do wrong?  I worked within the defined limitations, then a
> > new handset came out with stricter limitations.
>
> > I'm kind of confused how you can blame me!
>
> > On Dec 2, 5:19 pm, Romain Guy  wrote:
> >> The Droid has more pixels and a high display density, therefore
> >> bitmaps are scaled and require more memory. If your app is running out
> >> of memory, do not blame it on the framework and "poorer performance,"
> >> blame it on your app for doing the wrong thing and abusing the Java
> >> heap.
>
> >> > The app worked great on the G1.  I've clearly hit a case where the
> >> > framework made some decisions that result in poorer performance on the
> >> > Droid.
>
> >> > The bitmap out of memory errors can still occur on any setLayout(res/
> >> > xml/id), after running the app for 5-30 mins.  But I did fix the
> >> > bitmap out of memory crash that occured during
>
> >> > glow.setBackgroundResource(glowDrawableIds[scale]);
>
> >> > We just don't set a new background resource anymore.
>
> >> > I had 10 animation frames, and the animation frame chosen was based
> >> > upon the volume coming from the mic.
>
> >> > Now we take what was the last frame, and vary it's drawable's
> >> > transparency depending on volume.
>
> >> > glow.getBackground().setAlpha(alpha);
>
> >> > I will now start creating additional res/xml/files, so that LESS
> >> > complex layouts are used on the Verizon Motorola Droid with firmware
> >> > 2.0 then we used on the G1.
>
> >> > The layouts, and the final resulting screens were approved by
> >> > management, so I will be trying hard not to change ANYTHING on the G1,
> >> > while adding support for the inferior memory handling on the only
> >> > Android 2.0 handset.  The one with better specs.
>
> >> > Can anyone recommend which Android debugging tool I should be using to
> >> > figure out what to optimize?
>
> >> > On Nov 25, 11:11 am, Streets Of Boston 
> >> > wrote:
> >> >> As in the comment in your bug-report by Romain, you're using too much
> >> >> memory.
> >> >> Note that you only have 16MByte total available RAM for your process,
> >> >> including your bitmaps.
>
> >> >> - Only load the bitmaps that are absolutely necessary (especially when
> >> >> they become quite large).
> >> >> - Load the bitmaps scaled to the size of your screen, if possible. Use
> >> >> BitmapFactory.decode and set the 'inSampleSize' of your bitmap-options
> >> >> to scale down the size of the bitmap to be loaded and rendered on the
> >> >> screen.
>
> >> >> On Nov 25, 12:46 pm, MattKanninen wrote:
>
> >> >> > http://code.google.com/p/android/issues/detail?id=5045";>Issue
> >> >> > 5045
&g

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-02 Thread Matt Kanninen
What did I do wrong?  I worked within the defined limitations, then a
new handset came out with stricter limitations.

I'm kind of confused how you can blame me!

On Dec 2, 5:19 pm, Romain Guy  wrote:
> The Droid has more pixels and a high display density, therefore
> bitmaps are scaled and require more memory. If your app is running out
> of memory, do not blame it on the framework and "poorer performance,"
> blame it on your app for doing the wrong thing and abusing the Java
> heap.
>
>
>
> > The app worked great on the G1.  I've clearly hit a case where the
> > framework made some decisions that result in poorer performance on the
> > Droid.
>
> > The bitmap out of memory errors can still occur on any setLayout(res/
> > xml/id), after running the app for 5-30 mins.  But I did fix the
> > bitmap out of memory crash that occured during
>
> > glow.setBackgroundResource(glowDrawableIds[scale]);
>
> > We just don't set a new background resource anymore.
>
> > I had 10 animation frames, and the animation frame chosen was based
> > upon the volume coming from the mic.
>
> > Now we take what was the last frame, and vary it's drawable's
> > transparency depending on volume.
>
> > glow.getBackground().setAlpha(alpha);
>
> > I will now start creating additional res/xml/files, so that LESS
> > complex layouts are used on the Verizon Motorola Droid with firmware
> > 2.0 then we used on the G1.
>
> > The layouts, and the final resulting screens were approved by
> > management, so I will be trying hard not to change ANYTHING on the G1,
> > while adding support for the inferior memory handling on the only
> > Android 2.0 handset.  The one with better specs.
>
> > Can anyone recommend which Android debugging tool I should be using to
> > figure out what to optimize?
>
> > On Nov 25, 11:11 am, Streets Of Boston 
> > wrote:
> >> As in the comment in your bug-report by Romain, you're using too much
> >> memory.
> >> Note that you only have 16MByte total available RAM for your process,
> >> including your bitmaps.
>
> >> - Only load the bitmaps that are absolutely necessary (especially when
> >> they become quite large).
> >> - Load the bitmaps scaled to the size of your screen, if possible. Use
> >> BitmapFactory.decode and set the 'inSampleSize' of your bitmap-options
> >> to scale down the size of the bitmap to be loaded and rendered on the
> >> screen.
>
> >> On Nov 25, 12:46 pm, MattKanninen wrote:
>
> >> > http://code.google.com/p/android/issues/detail?id=5045";>Issue
> >> > 5045
>
> >> >http://code.google.com/p/android/issues/detail?id=5045
>
> >> > On Nov 25, 9:37 am, MattKanninen wrote:
>
> >> > > This:
> >> > >         private static final int[] glowDrawableIds={
> >> > >                 R.drawable.graphic_microphoneglow_01,
> >> > >                 R.drawable.graphic_microphoneglow_02,
> >> > >                 R.drawable.graphic_microphoneglow_03,
> >> > >                 R.drawable.graphic_microphoneglow_04,
> >> > >                 R.drawable.graphic_microphoneglow_05,
> >> > >                 R.drawable.graphic_microphoneglow_06,
> >> > >                 R.drawable.graphic_microphoneglow_07,
> >> > >                 R.drawable.graphic_microphoneglow_08,
> >> > >                 R.drawable.graphic_microphoneglow_09,
> >> > >                 R.drawable.graphic_microphoneglow_10
> >> > >         };
> >> > > ...
> >> > > View glow = findViewById(R.id.glow);
> >> > > ..
>
> >> > > glow.setBackgroundResource(glowDrawableIds[scale]);
>
> >> > > is causing
>
> >> > > 11-25 09:21:02.046: WARN/UsageStats(1018): Failed to persist new stats
> >> > > 11-25 09:21:02.694: DEBUG/dalvikvm(2386): GC freed 298 objects / 15656
> >> > > bytes in 61ms
> >> > > 11-25 09:21:02.952: ERROR/dalvikvm-heap(2386): 680-byte external
> >> > > allocation too large for this process.
> >> > > 11-25 09:21:02.952: ERROR/(2386): VM won't let us allocate 680
> >> > > bytes
> >> > > 11-25 09:21:02.952: DEBUG/AndroidRuntime(2386): Shutting down VM
> >> > > 11-25 09:21:02.952: WARN/dalvikvm(2386): threadid=3: thread exiting
> >> > > with uncaught exception (group=0x4001b180)
> >> > > 11-25 09:21:02.952: ERROR/AndroidRuntime(2386): Uncaught handler:
> >> > > thread main exiting due to uncaught exception
> >> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(2386):
> >> > > java.lang.OutOfMemoryError: bitmap size exceeds VM budget
> >> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
> >> > > android.graphics.Bitmap.nativeCreate(Native Method)
> >> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
> >> > > android.graphics.Bitmap.createBitmap(Bitmap.java:468)
> >> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
> >> > > android.graphics.Bitmap.createBitmap(Bitmap.java:435)
> >> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
> >> > > android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)
> >> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
> >> > > android.graphics.BitmapFactory.finishDecode(Bi

[android-developers] Re: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

2009-12-02 Thread Matt Kanninen
The app worked great on the G1.  I've clearly hit a case where the
framework made some decisions that result in poorer performance on the
Droid.

The bitmap out of memory errors can still occur on any setLayout(res/
xml/id), after running the app for 5-30 mins.  But I did fix the
bitmap out of memory crash that occured during

glow.setBackgroundResource(glowDrawableIds[scale]);

We just don't set a new background resource anymore.

I had 10 animation frames, and the animation frame chosen was based
upon the volume coming from the mic.

Now we take what was the last frame, and vary it's drawable's
transparency depending on volume.

glow.getBackground().setAlpha(alpha);




I will now start creating additional res/xml/files, so that LESS
complex layouts are used on the Verizon Motorola Droid with firmware
2.0 then we used on the G1.

The layouts, and the final resulting screens were approved by
management, so I will be trying hard not to change ANYTHING on the G1,
while adding support for the inferior memory handling on the only
Android 2.0 handset.  The one with better specs.

Can anyone recommend which Android debugging tool I should be using to
figure out what to optimize?

On Nov 25, 11:11 am, Streets Of Boston 
wrote:
> As in the comment in your bug-report by Romain, you're using too much
> memory.
> Note that you only have 16MByte total available RAM for your process,
> including your bitmaps.
>
> - Only load the bitmaps that are absolutely necessary (especially when
> they become quite large).
> - Load the bitmaps scaled to the size of your screen, if possible. Use
> BitmapFactory.decode and set the 'inSampleSize' of your bitmap-options
> to scale down the size of the bitmap to be loaded and rendered on the
> screen.
>
> On Nov 25, 12:46 pm, MattKanninen wrote:
>
> > http://code.google.com/p/android/issues/detail?id=5045";>Issue
> > 5045
>
> >http://code.google.com/p/android/issues/detail?id=5045
>
> > On Nov 25, 9:37 am, MattKanninen wrote:
>
> > > This:
> > >         private static final int[] glowDrawableIds={
> > >                 R.drawable.graphic_microphoneglow_01,
> > >                 R.drawable.graphic_microphoneglow_02,
> > >                 R.drawable.graphic_microphoneglow_03,
> > >                 R.drawable.graphic_microphoneglow_04,
> > >                 R.drawable.graphic_microphoneglow_05,
> > >                 R.drawable.graphic_microphoneglow_06,
> > >                 R.drawable.graphic_microphoneglow_07,
> > >                 R.drawable.graphic_microphoneglow_08,
> > >                 R.drawable.graphic_microphoneglow_09,
> > >                 R.drawable.graphic_microphoneglow_10
> > >         };
> > > ...
> > > View glow = findViewById(R.id.glow);
> > > ..
>
> > > glow.setBackgroundResource(glowDrawableIds[scale]);
>
> > > is causing
>
> > > 11-25 09:21:02.046: WARN/UsageStats(1018): Failed to persist new stats
> > > 11-25 09:21:02.694: DEBUG/dalvikvm(2386): GC freed 298 objects / 15656
> > > bytes in 61ms
> > > 11-25 09:21:02.952: ERROR/dalvikvm-heap(2386): 680-byte external
> > > allocation too large for this process.
> > > 11-25 09:21:02.952: ERROR/(2386): VM won't let us allocate 680
> > > bytes
> > > 11-25 09:21:02.952: DEBUG/AndroidRuntime(2386): Shutting down VM
> > > 11-25 09:21:02.952: WARN/dalvikvm(2386): threadid=3: thread exiting
> > > with uncaught exception (group=0x4001b180)
> > > 11-25 09:21:02.952: ERROR/AndroidRuntime(2386): Uncaught handler:
> > > thread main exiting due to uncaught exception
> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(2386):
> > > java.lang.OutOfMemoryError: bitmap size exceeds VM budget
> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
> > > android.graphics.Bitmap.nativeCreate(Native Method)
> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
> > > android.graphics.Bitmap.createBitmap(Bitmap.java:468)
> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
> > > android.graphics.Bitmap.createBitmap(Bitmap.java:435)
> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
> > > android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)
> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
> > > android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)
> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
> > > android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:462)
> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
> > > android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:
> > > 323)
> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
> > > android.graphics.drawable.Drawable.createFromResourceStream
> > > (Drawable.java:697)
> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
> > > android.content.res.Resources.loadDrawable(Resources.java:1705)
> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(2386):     at
> > > android.content.res.Resources.getDrawable(Resources.java:580)
> > > 11-25 09:21:03.014: ERROR/AndroidRuntime(238

  1   2   >