[android-developers] Re: Is anyone's active install % dropping like a rock lately?

2010-09-10 Thread metal mikey
My hypothesis is that since instructions came out as to how to setup
the emulator with Android Marketplace, spammers/weirdos have used tons
of gmail accounts
to download Apps then uninstall them with the intent of throwing stats
off.


On Sep 10, 3:05 pm, dah...@gmail.com dah...@gmail.com wrote:
 Same here.

 Active install drops a lot since last update last week.

 Not any response until now. Not know what happened.

 On Aug 27, 1:05 am, niko20 nikolatesl...@yahoo.com wrote:

  My apps as well

  My main core app was at 55% and now over the last few weeks it's
  dropped down to 43% as of this writing. My second app was almost at
  60% and now is also at 45%.

  I think it may have to do with install to sdcard, I know there are
  some other bugs with that feature, such as shortcuts on the home
  screen not working right, etc.

  -niko

  On Aug 26, 9:47 am, Fabrizio Giudici fabrizio.giud...@tidalwave.it
  wrote:

   I've spotted this thread only now. It's happening to me too - in a
   week it dropped from a _steady_ 45% (held since several weeks) to 36%,
   with a single newactiveinstall out of regularly increasing new
   downloads. I even posted that on my blog - a commenter pointed out
   that when people upgrade an app the download counter might increase,
   while theactiveinstall doesn't (actually, I've released two updates
   in this month). Can you confirm?- 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] Random ClassCastException in Stress testing

2010-09-10 Thread ankita.nhst
Hello All,

I have a ListActivity with the custom ListAdapter. On clicking a
button in rowlayout of list item I get a custom dialog with a couple
of buttons. Since the Custom dialog carries same buttons and should
not be created again and again even if the user clicks on several
buttons of list items in succession, so I have maintained only one
object of the custom dialog in my custom ListAdapter. But, during
stress testing I am getting the following log:


ERROR/AndroidRuntime(7759): Uncaught handler: thread main exiting due
to uncaught exception
ERROR/AndroidRuntime(7759): java.lang.ClassCastException:
android.widget.LinearLayout
ERROR/AndroidRuntime(7759): at appln.testlist.TestListAdapter
$1.onClick(TestListAdapter.java:206)
ERROR/AndroidRuntime(7759): at
android.view.View.performClick(View.java:2364)
ERROR/AndroidRuntime(7759): at
android.view.View.onTouchEvent(View.java:4198)
ERROR/AndroidRuntime(7759): at
android.view.View.dispatchTouchEvent(View.java:3728)
ERROR/AndroidRuntime(7759): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:852)
ERROR/AndroidRuntime(7759): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
ERROR/AndroidRuntime(7759): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
ERROR/AndroidRuntime(7759): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
ERROR/AndroidRuntime(7759): at
android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
ERROR/AndroidRuntime(7759): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
ERROR/AndroidRuntime(7759): at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:
1107)
ERROR/AndroidRuntime(7759): at
android.app.Dialog.dispatchTouchEvent(Dialog.java:643)
ERROR/AndroidRuntime(7759): at
com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
ERROR/AndroidRuntime(7759): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
ERROR/AndroidRuntime(7759): at
android.os.Handler.dispatchMessage(Handler.java:99)
ERROR/AndroidRuntime(7759): at android.os.Looper.loop(Looper.java:
123)
ERROR/AndroidRuntime(7759): at
android.app.ActivityThread.main(ActivityThread.java:4363)
ERROR/AndroidRuntime(7759): at
java.lang.reflect.Method.invokeNative(Native Method)
ERROR/AndroidRuntime(7759): at
java.lang.reflect.Method.invoke(Method.java:521)
ERROR/AndroidRuntime(7759): at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
ERROR/AndroidRuntime(7759): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
ERROR/AndroidRuntime(7759): at
dalvik.system.NativeStart.main(Native Method)





I am not getting it always, or lets say it appears in very random
manner so, I have no clue about finding the solution or spoting the
problem area. Any help or suggestion regarding this is quite welcome!


Thanks and Regards,
Ankita

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] Can android support more than one sdcard?

2010-09-10 Thread Nikkea Dong
Hey Guys,

Is there anyone tell me android support more than one sdcard?
How to add one more sdcard by coding?

Thanks,

Nikki

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: Is anyone's active install % dropping like a rock lately?

2010-09-10 Thread Jonas Petersson

On 09/10/2010 08:10 AM, metal mikey wrote:

My hypothesis is that since instructions came out as to how to setup
the emulator with Android Marketplace, spammers/weirdos have used tons
of gmail accounts
to download Apps then uninstall them with the intent of throwing stats
off.


I have not clue whether you are right about that, but one thing is for 
sure: I've seen several users in that last few weeks who somehow have 
managed to download the most recent version of one of my apps and 
somehow installed it in a device running 1.1 (presumably a G1). As I've 
set minimum SDK to 1.5 there must have bit of force involved.


I have used some calls that don't exist in 1.1 so therefore the app 
crashes with a VerifyError and thanks to Mads @ nullwire I get that 
stack trace. It had me confused for a while, but I guess you have to 
expect everything, really... The IP address of the last one seems to end 
up in Madrid (where my app is pretty useless anyway).


Just my few eurocents / Jonas

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] Switching font

2010-09-10 Thread Jon mailinglists
Hi all

I want to switch font in my application, and I of course want to use
the same font in every text element. The only way I've found out how
to do it is to pull out each textview/button/edittext/... in java and
do:
TextView txt = (TextView) findViewById(R.id.custom_font);
Typeface font = Typeface.createFromAsset(getAssets(), myfont.ttf);
txt.setTypeface(font);

It makes the xml pretty much useless since I have to programaticly
change almost every view anyways. Is there a way to set the default
font in a style.xml or similar? Haven't been able to figure out how to
do it in xml.

Thanks
Jon

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] some time my Phone state receiver not receiving any broadcast message wot to do

2010-09-10 Thread A N K ! T
i have create a receiver which receive on phone state change i have register
it in xml by android.intent.action.PHONE_STATE

but some time it dont receive any broadcast message
  log mesages are:::


09-10 11:20:36.968: WARN/ActivityManager(74): Timeout of broadcast
BroadcastRecord{43347258 android.intent.action.PHONE_STATE -
receiver=android.os.binderpr...@4334ebd0

09-10 11:20:36.968: WARN/ActivityManager(74): Receiver during timeout:
ResolveInfo{432dd748 com.callHandller.PhoneStateReciever p=0 o=0 m=0x108000}

09-10 11:20:36.968: INFO/Process(74): Sending signal. PID: 2223 SIG: 9

09-10 11:20:36.988: ERROR/JavaBinder(74): !!! FAILED BINDER TRANSACTION !!!

09-10 11:20:37.008: INFO/ActivityManager(74): Process com.callHandller (pid
2223) has died.

09-10 11:20:37.008: INFO/WindowManager(74): WIN DEATH: Window{4324f470
com.callHandller/com.incallHandller.callHandler paused=false}

09-10 11:20:37.958: WARN/ActivityManager(74): Activity destroy timeout for
HistoryRecord{4321c7c0 com.callHandller/com.incallHandller.callHandler}

09-10 11:20:42.288: DEBUG/dalvikvm(136): GC freed 2543 objects / 143320
bytes in 179ms

here com.callhandller is my application package where i have Receiver...

guide me wot to do.

-- 

 A N K ! T..

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: Monkey problems -- **URGENT HELP** --

2010-09-10 Thread TreKing
On Thu, Sep 9, 2010 at 2:36 PM, DanH danhi...@ieee.org wrote:

 In the case of something like Monkey, the need to meet an internal demo
 date would be valid cause for urgent, in my opinion.


Yes - to person with the deadline, sure this would seem urgent. To the rest
of us on this volunteer list? Not so much. I think it makes the poster seem
impatient, especially when the OP does not explain what makes it so
important. He could be trying to cram in some last minute homework
assignment that he slacked off on, for all we know.

On Thu, Sep 9, 2010 at 11:37 PM, Tez earlencefe...@gmail.com wrote:

 @TrekIng - thanks for your professional opinion.


This is most definitely NOT professional opinion. I'm just telling you how
posts with urgent in the title are usually perceived on forums like this
where people ask for technical help. Most of the people on this group are
working individually on projects as a hobby - the level of urgency of
solving any given problem presented here, in the grand scheme of things, is
incredibly low.

However important this problem is for you to solve, it frankly means nothing
to the rest of us and adding urgent is not going to make us drop
everything to try to help. At best it adds nothing to the discussion about
the problem you're having and at worst it makes you seem impatient and
actually discourages people from helping you.

Believe it or not, I'm actually trying to help you. I really think you would
be best served, now and in the future, with not adding urgent to your
post. It usually hurts more than it helps - that's what I'm trying to get
at.


 You have admitted that you have not used monkey yet you make the claim that
 having trouble with it is not urgent.


Correct. I don't need to use the tool to determine this. Even if you never
solve your problem, the world will keep spinning and life will go on. You
claim this is urgent but you've still not explained what the severe
consequences of this not being solved will be, besides there being
important work depending on it - which is completely subjective to you.


 Did you base this on your previous monkey experience?


Where did I claim to have monkey experience? I'm pretty sure I clearly
stated I had not used Monkey. Or was that sarcasm?

-
TreKing http://sites.google.com/site/rezmobileapps/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] How to prevent a service from being restarted by the system...

2010-09-10 Thread sdphil
From what I can tell -- if you return START_NOT_STICKY from
Service.onStartCommand(...), the system should not restart a service
if it crashes.

However, I'm not seeing that behavior -- any ideas on what could be
restarting the service?

tia.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: GeoCoding Problems

2010-09-10 Thread Droid
I had with same problem with my App in that some geocoder returns are
empty.
I can suggest two solutions

1) Do try catch exceptions  that traps a null and then starts the
method again (which it
will do until it gets a result). Seems to work for me.

2) The results come back thick and fast so use an algorithm to examine
say 10
results and then take average whilst rejecting nulls.

Please let us know what you find out...


On Sep 9, 6:39 pm, tatebn brandonnt...@gmail.com wrote:
 I'm trying to use the GeoCoder to get the lat/lon for a couple of
 addresses.  I'm running into an error where the address list comes
 back empty sometimes.  It seems to be completely random.  I have a
 start point and an end point to draw and route.  Sometimes I can't get
 either one, sometimes I can get the start but not the end, sometimes I
 can get the end but not the start.  I never seem to be able to get
 both.  Not sure why.  Yesterday it worked fine.  Any thoughts?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] json

2010-09-10 Thread TreKing
On Fri, Sep 10, 2010 at 12:17 AM, vineeshkc kcvine...@gmail.com wrote:

 pls help for reteriving data from the webserver usin json


http://www.catb.org/esr/faqs/smart-questions.html

-
TreKing http://sites.google.com/site/rezmobileapps/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: How to handle Home Key in our Activity

2010-09-10 Thread Paul Turchenko
+1

On Sep 9, 9:58 pm, TreKing treking...@gmail.com wrote:
 On Wed, Sep 8, 2010 at 10:50 PM, AnnuDroid enigma.an...@gmail.com wrote:
  How to handle Home keyPlzz Help me out

 Plzz take two seconds to spell please correctly.

  I want the Answer.

 42.

  No one in this Blog has any idea how to handle it.

 This isn't a Blog ...

  PLUSMINUS where r u

 Try to the right side of the top row of your keyboard.

   plzzz plzz Help??

 plzzz plzz lurn 2 spell  may b ppl will take u serious lee.

 -
 TreKing http://sites.google.com/site/rezmobileapps/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: Monkey problems -- **URGENT HELP** --

2010-09-10 Thread Tez
FYI I am a scientific programmer for a european university. We are
doing work on Android security.
We have a research hypothesis that can be proved valid if we solve the
above stated problem.
This work is on a deadline. And one entire chain of work will be
regarded as discarded/valid based on this.
I hope this clears things.

-E

On Sep 10, 11:45 am, TreKing treking...@gmail.com wrote:
 On Thu, Sep 9, 2010 at 2:36 PM, DanH danhi...@ieee.org wrote:
  In the case of something like Monkey, the need to meet an internal demo
  date would be valid cause for urgent, in my opinion.

 Yes - to person with the deadline, sure this would seem urgent. To the rest
 of us on this volunteer list? Not so much. I think it makes the poster seem
 impatient, especially when the OP does not explain what makes it so
 important. He could be trying to cram in some last minute homework
 assignment that he slacked off on, for all we know.

 On Thu, Sep 9, 2010 at 11:37 PM, Tez earlencefe...@gmail.com wrote:
  @TrekIng - thanks for your professional opinion.

 This is most definitely NOT professional opinion. I'm just telling you how
 posts with urgent in the title are usually perceived on forums like this
 where people ask for technical help. Most of the people on this group are
 working individually on projects as a hobby - the level of urgency of
 solving any given problem presented here, in the grand scheme of things, is
 incredibly low.

 However important this problem is for you to solve, it frankly means nothing
 to the rest of us and adding urgent is not going to make us drop
 everything to try to help. At best it adds nothing to the discussion about
 the problem you're having and at worst it makes you seem impatient and
 actually discourages people from helping you.

 Believe it or not, I'm actually trying to help you. I really think you would
 be best served, now and in the future, with not adding urgent to your
 post. It usually hurts more than it helps - that's what I'm trying to get
 at.

  You have admitted that you have not used monkey yet you make the claim that
  having trouble with it is not urgent.

 Correct. I don't need to use the tool to determine this. Even if you never
 solve your problem, the world will keep spinning and life will go on. You
 claim this is urgent but you've still not explained what the severe
 consequences of this not being solved will be, besides there being
 important work depending on it - which is completely subjective to you.

  Did you base this on your previous monkey experience?

 Where did I claim to have monkey experience? I'm pretty sure I clearly
 stated I had not used Monkey. Or was that sarcasm?

 -
 TreKing http://sites.google.com/site/rezmobileapps/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] setPositiveButton listener is called multiple times when button is repeatedly clicked (very fast).

2010-09-10 Thread Vibhor Mahajan
Hello All,

Below code is executed on a button click in my application.
new AlertDialog.Builder()
.setTitle(Test)
.setMultiChoiceItems(items, state, new
DialogInterface.OnMultiChoiceClickListener() {
public void onClick(DialogInterface dialog, int whichButton, boolean
isChecked) {
   //ToDo: some processing
}
})
.setPositiveButton(Done, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
   //ToDo: Some operations needs to be done
}
 })
create()
.show();

I found when setPositiveButton is clicked multiple times (very fast),
OnClick call back function is called twice or thrice. But I want it to
be called only once. Subsequent clicks should be ignored.

I understand this can be accomplished, by doing some checks in OnClick
call back listener. But since this is happening at multiple places in
my application. I want to know if there is any standard way to resolve
this issue.

Thanks,
Vibhor Mahajan

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: somebody stole our app and resell it on the market.

2010-09-10 Thread Fabrizio Giudici

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 9/10/10 01:54 , William Ferguson wrote:
 OK,

 firstly deploying your app without obfuscating the code was a
 mistake. But now that its happened why do you think someone who is
 selling a paid version of your app and who will have a hard time
 maintaining the code (decompiling doesn't give you a nice base to
 work from) is going to be able to compete with a free up to date
 version from you?

 Secondly 1) I don't find Java particularly slow. But you can expect
 that its performance on a device will improve as more devices can
 access to JIT. 2) Eclipse is OK, but you don't have to use it. I
 don't, I prefer IntelliJ. Yes it costs, but not much.
There's also the NetBeans option.
 3) Yes, the emulator is slow to start up, but after that its fine.
 So don't close it between each iteration. I don't.

Indeed, the very fact that with Android one has got all these options,
while with iPhone doesn't (and you *have* to buy a mac) makes the
comparison pretty useless to me (in favour of Android). Of course,
this is partly subjective.

- -- 
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - We make Java work. Everywhere.
java.net/blog/fabriziogiudici - www.tidalwave.it/people
fabrizio.giud...@tidalwave.it
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyJ1xcACgkQeDweFqgUGxfQ9QCgkGbSBEJRkdZVMYsvXeLIj757
UVMAn06hG/DA6k73PwV46b7VWBS7/Uwu
=Yt48
-END PGP SIGNATURE-

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


[android-developers] android office document viewer apk if anyone have it.

2010-09-10 Thread Nency Robert
HI,

Looking for free android MS office document viewer application. Please
attach with reply if anyone have it.
Or share a link to download it directly to computer (not to phone, I
want apk file).

Ex: OffiViewer,K2 Document viewer... etc

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: WebView and ignoring SSL certificate

2010-09-10 Thread Indicator Veritatis
How many root certificates do you need these days? Unless origin
servers are using mom-and-pop CAs instead of real ones, six root certs
should cover all serious vendor sites. At least such was the case when
I last confronted this issue just a few years ago.

Now I realize that developers often use self-signed certs, but I never
trust those for real secure servers. Neither should anyone else.

On Sep 9, 10:57 am, DanH danhi...@ieee.org wrote:
 Because the phone doesn't have installed the necessary root
 certificate for many web sites, so it's impossible to validate their
 perfectly valid certificates.

 On Sep 9, 12:47 pm, Indicator Veritatis mej1...@yahoo.com wrote: Why would 
 you want to do this? The whole point of SSL is to provide
  security, security which you throw out the window by ignoring invalid
  SSL certificate.

  On Sep 8, 10:45 am, ls02 agal...@audible.com wrote:

   How do I ignore invalid SSL certificate issue when using WebView? I
   know how to ignore it when using HttpsConnection but have now idea how
   to implement this with embedded WebView.



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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 anyone's active install % dropping like a rock lately?

2010-09-10 Thread William Ferguson
How does the Market get informed of a new install?
How does the Market get informed of an uninstall?

Does installing an app other than via the market (on a phone that has
the android market) increment the number of installs?
Is it possible that the apps are being downloaded from a source other
than market, installed via non-market app mechanism and hence not
incrementing stats?
But on download, because market is installed (and app exists in
market, the market stats are being decremented?

There you go, 5 questions and no answers .. shit I'm on fire today :-)

William

On Sep 10, 4:26 pm, Jonas Petersson jonas.peters...@xms.se wrote:
 On 09/10/2010 08:10 AM, metal mikey wrote:

  My hypothesis is that since instructions came out as to how to setup
  the emulator with Android Marketplace, spammers/weirdos have used tons
  of gmail accounts
  to download Apps then uninstall them with the intent of throwing stats
  off.

 I have not clue whether you are right about that, but one thing is for
 sure: I've seen several users in that last few weeks who somehow have
 managed to download the most recent version of one of my apps and
 somehow installed it in a device running 1.1 (presumably a G1). As I've
 set minimum SDK to 1.5 there must have bit of force involved.

 I have used some calls that don't exist in 1.1 so therefore the app
 crashes with a VerifyError and thanks to Mads @ nullwire I get that
 stack trace. It had me confused for a while, but I guess you have to
 expect everything, really... The IP address of the last one seems to end
 up in Madrid (where my app is pretty useless anyway).

                 Just my few eurocents / Jonas

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


[android-developers] android doesn't recognize battery

2010-09-10 Thread Anand Android
Hi all,
in the presence of usb cable if i remove battery from the device and put it
back ,the device is not recognizing the battery.
but from the kernel log i can see the battery charging event at the time of
inserting the battery back and after that if the usb cable is taken out
,device will shutdown
why its happening and which part of android source supposed to handle this
behaviour?

-Anand

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: Adding checkboxes to a LinearLayout

2010-09-10 Thread Indicator Veritatis
But won't that make all the widgets in the Layout go to the bottom? So
he will need to have one LinearLayout vertically oriented for the
widgets that go at the top or middle, then start another vertically
oriented LinearLayout (with fill-parent) with android:gravity=bottom
and buttons only.

Or something like that. Like they say about Perl, there's more than
one way to do it;)

On Sep 9, 1:49 pm, Mark Murphy mmur...@commonsware.com wrote:
 2010/9/9 Kostya Vasilyev kmans...@gmail.com:

  You are right about LinearLayout being able to lay out its views vertically,
  but it does so top to bottom.

  The OP seems to want his buttons to be pushed to the bottom of the enclosing
  layout, and I think that for that case, a RelativeLayout with
  layout_alignParentBottom (specifies from code) is a better, perhaps only
  option.

 Ah, I missed that part.

 Actually, I suspect that android:gravity=bottom on the LinearLayout
 may suffice to have the buttons be at the bottom.

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

 Android Training in London:http://skillsmatter.com/go/os-mobile-server

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


Re: [android-developers] How to prevent a service from being restarted by the system...

2010-09-10 Thread Dianne Hackborn
What is in the log?  What does it say about your service in adb shell
dumpsys service?

On Thu, Sep 9, 2010 at 11:45 PM, sdphil phil.pellouch...@gmail.com wrote:

 From what I can tell -- if you return START_NOT_STICKY from
 Service.onStartCommand(...), the system should not restart a service
 if it crashes.

 However, I'm not seeing that behavior -- any ideas on what could be
 restarting the service?

 tia.

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




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

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

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

[android-developers] Re: Choosing background for Live Wallpaper.

2010-09-10 Thread Pent
 What I would like is
 for the user to be able to press a button in the Settings menu, have
 the list of options show up just like setting the wallpaper from the
 home screen, minus the Live Wallpapers options.  Once the user
 navigates the choices and picks an actually image I would load it to
 my canvas.

I would also like to be able to get a list of the static built-in
wallpapers but
I don't think it's possible ATM. I had a look at the source a while
ago
and the selection was all hardcoded, there was no PICK intent.

 I've been able to come up with a list of wallpaper providers using
 Intents.  I then get a list of live wallpaper providers also using
 Intents and remove those from my first list.  

Which intents did you use for that ?

Thanks,

Pent

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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 handle Home Key in our Activity

2010-09-10 Thread skink


On 9 Wrz, 05:50, AnnuDroid enigma.an...@gmail.com wrote:
 How to handle Home keyPlzz Help me outWe can handle Home
 button

you CAN NOT handle Home key in your Activity. Period.

How many times will you be asking that question again and again?

pskink

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: TCP Client Is sue

2010-09-10 Thread Vinod Joseph
I could change MTU using busybox. Also, init.rc provides me commands to
change TCP Window Size.

Hope that improves my throughput performance ! Any other tips for throughput
optimization is deeply appreciated.

2010/9/9 孙文杰 javenson0...@gmail.com

 @Vinod:
 AFAIK you can change the TCP window size by modificaion in kernel code, but
 I really doubt that you can do this in an application.
 @All:
 Plz correct me if something is wrong.

 在 2010-9-9 下午2:10,Vinod vinod@gmail.com编写:


 Dear All

 How can we configure TCP Window Size for FTP data transfers in
 Android ?

 Also, MTU change in Android will be very useful for my work

 Kind regards

 Vinod


 On May 19, 6:10 am, Bobbie bobbie.st...@gmail.com wrote:
  I am running aTCPclient as a service.  Every 15-20 minutes, the
  service just dies.  I don't get a force close or anything, the app
  just closes.  The app launches a main view and theTCPclient is
  started as a service by clicking a button using this code:
 
  Intent TCPstart = new Intent();
  TCPstart.setClassName(com.package.STIX,com.package.STIX.TCPClient);
   startService(TCPstart);
 
  Here is what I get from debug:
 
  05-18 17:03:25.418: ERROR/dalvikvm(24664): VM aborting
  05-18 17:03:25.637: INFO/WindowManager(1029): WIN DEATH:Window{446f43b8
 com.package.STIX/com.package.STIX.STIX paused=false}
  05-18 17:03:25.645: INFO/ActivityManager(1029): Process
  com.package.STIX (pid 24664) has died.
  05-18 17:03:25.645: WARN/ActivityManager(1029): Scheduling restart of
  crashed service com.package.STIX/.TCPClient in 5000ms
  05-18 17:03:25.668: INFO/UsageStats(1029): Unexpected resume of
  com.android.launcher while already resumed in com.package.STIX
  05-18 17:03:26.043: WARN/InputManagerService(1029): Got
  RemoteException sending setActive(false) notification to pid 24664 uid
  10062
  05-18 17:03:26.864: INFO/DEBUG(14738): debuggerd committing suicide to
  free the zombie!
  05-18 17:03:26.864: DEBUG/Zygote(992): Process 24664 terminated by
  signal (11)
  05-18 17:03:26.879: INFO/DEBUG(25807): debuggerd: Mar 22 2010 17:31:05
  05-18 17:03:30.661: INFO/ActivityManager(1029): Start proc
  com.package.STIX for service com.package.STIX/.TCPClient: pid=25808
  uid=10062 gids={3003}
  05-18 17:03:30.731: INFO/dalvikvm(25808): Debugger thread not active,
  ignoring DDM send (t=0x41504e4d l=38)
  05-18 17:03:30.739: INFO/dalvikvm(25808): Debugger thread not active,
  ignoring DDM send (t=0x41504e4d l=40)
 
  Could someone help me out here?
 
  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.comandroid-developers%2bunsubscr...@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.comandroid-developers%2bunsubscr...@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

Re: [android-developers] Widget Layout Help Please

2010-09-10 Thread Kostya Vasilyev

 If your widget is too large, check these:

- Android UI guidelines has standard widget sizes, as well as shows the 
grid on which widgets are laid out:


http://developer.android.com/guide/practices/ui_guidelines/widget_design.html#sizes

- Check your appwidget-provider XML file (usually 
res/xml/widget_info.xml), specifically, android:minWidth and 
android:minHeight. I use 70dp and 72dp for these, but my widgets are a 
little larger than the standard ones (trying to match HTC Sense), 
although they still fit the standard grid.


- Check the widget's layout file, specifically, its width and height. If 
necessary, specify explicit width and height to match the 
appwidget-provider and a solid background color to see which elements 
of your widget layout do not fit.


-- Kostya

10.09.2010 7:36, Tommy Hartz пишет:
Right I under stand that its a grid layout but my Icon is taking up 2 
- 3 grid spacesHTC Aria shows you the grid space and mine is massive


2010/9/9 Kostya Vasilyev kmans...@gmail.com mailto:kmans...@gmail.com

Home screen Widgets are laid out on a grid, so no matter how
compact you make your layout, it won't get any closer to other
widgets.

Also, you should not be using pixel dimensions in the layout - use
device-independent do units.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com


09.09.2010 23:42 пользователь Tommy droi...@gmail.com
mailto:droi...@gmail.com написал:


Hi everyone,

I am trying to make a widget to show on the home screen(s). My
problem
is lets say I set my icon to 30x30 when I load the widget on the
screen the Icon is the correct size BUT the layout itself takes up a
lot more space than what is actually needed. This means that I can't
really place my widget next to other icons on the screen. Its
like the
bounding box is 3 times bigger than the content that fills it. How do
I fix this? Here is my XML

?xml version=1.0 encoding=utf-8?
RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
android
   android:id=@+id/widget
   android:layout_width=30px
   android:layout_height=30px
   android:focusable=true


ImageView android:id=@+id/widgWeatherIcon
   android:layout_width=30px
   android:layout_height=30px
   android:src=@drawable/asdf_widgettester



/ImageView
TextView android:id=@+id/widgCurrTemp
   android:layout_width=wrap_content
   android:layout_height=wrap_content
   android:text=100
   android:layout_below=@id/widgWeatherIcon
/TextView
/RelativeLayout


I have tried wrap_content and other width/height settings but nothing
seems to reduce the Box around my widget content. Im super
confused. I clicked on my ATK widget and started to drag it around on
my HTC Aria and it shows the bounding box around the widget and that
one is the same size of the content inside same with all the other
widgets on my screens.

Thanks so much for the help and advice!

Tommy

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to
android-developers@googlegroups.com
mailto:android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
mailto:android-developers%2bunsubscr...@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
mailto:android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
mailto:android-developers%2bunsubscr...@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 



--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.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

Re: [android-developers] Re: Adding checkboxes to a LinearLayout

2010-09-10 Thread Kostya Vasilyev
 That's why I was suggesting RelativeLayout. With it, some items can be 
pushed to the bottom, while others positioned in other ways.


Your suggestion for nested LinearLayout would work, too. It's just that 
I really like using RelativeLayout (I think it's really nice, once you 
get the hang of it). But yes, there are many ways to skin this cat.


A key point, perhaps, is this: the OP wants to do this from code, and 
for that, the LayoutParams class that needs to match the the enclosing 
layout of the view that's being created.


So when adding views to a LinearLayout, use LinearLayout.LayoutParams. 
When adding to a RelativeLayout, use RelativeLayout.LayoutParams, and so on.


-- Kostya

10.09.2010 11:27, Indicator Veritatis пишет:

But won't that make all the widgets in the Layout go to the bottom? So
he will need to have one LinearLayout vertically oriented for the
widgets that go at the top or middle, then start another vertically
oriented LinearLayout (with fill-parent) with android:gravity=bottom
and buttons only.

Or something like that. Like they say about Perl, there's more than
one way to do it;)

On Sep 9, 1:49 pm, Mark Murphymmur...@commonsware.com  wrote:

2010/9/9 Kostya Vasilyevkmans...@gmail.com:


You are right about LinearLayout being able to lay out its views vertically,
but it does so top to bottom.
The OP seems to want his buttons to be pushed to the bottom of the enclosing
layout, and I think that for that case, a RelativeLayout with
layout_alignParentBottom (specifies from code) is a better, perhaps only
option.

Ah, I missed that part.

Actually, I suspect that android:gravity=bottom on the LinearLayout
may suffice to have the buttons be at the bottom.

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

Android Training in London:http://skillsmatter.com/go/os-mobile-server



--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.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


Re: 回复: [android-developers] Re: TCP Client Is sue

2010-09-10 Thread Kostya Vasilyev
 10.09.2010 11:56, Vinod Joseph пишет:
 Hope that improves my throughput performance ! Any other tips for
 throughput optimization is deeply appreciated.

Yes, use Channel.transferTo() to send data to the network (this requires
that you use NIO).

With this, I am able to send about 8 Mbit / seconds on a Motorola
Milestone over Wifi. I think it's pretty good for a modest device like that.

-- 
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

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


[android-developers] How I get Command in Home Screen In Android

2010-09-10 Thread Animesh Sinha

I mean to say that i want a notification(Command) same as when we
type *#06# in home screen it will show a IMEI no. in the same way when
i press a certain code (eg: *#12345#) then it will notify to my
service which is running in background.

Plz solve my problem and reply me soon.



Waiting

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] AsyncTask doesn't run sometimes despite state returning RUNNING?

2010-09-10 Thread draf...@gmail.com
In my application I use an AsyncTask on start up of my Activity to
fetch the ringtone of a particular contact.

It works normally but I have noticed that if the application is
stopped twice before the AsyncTask gets to the doInBackground method
then when the Activity starts again the AsyncTask fails to run
properly, only getting to the onPreExecute() method.

Here is my code:

The AsyncTask itself:

---

private class SelectRingtoneTask extends AsyncTaskString, Void,
Void {

  // can use UI thread here
  protected void onPreExecute() {
  Log.d(cda, Into selectRingToneTask - 
onPreExecute() -  +
selectRingtoneFinished);
  }

  // automatically done on worker thread (separate from UI
thread)
  protected Void doInBackground(final String... args) {
  Log.d(cda, Into selectRingToneTask - 
!!!);
 getRingTone();
 return null;
  }

  // can use UI thread here
  protected void onPostExecute(final Void unused) {
   selectRingtoneFinished = true;
   Log.d(cda, Into selectRingToneTask - onPostExecute - 
 +
selectRingtoneFinished);
  }
   }

---

Where I call the AsyncTask on start up:

---

if(srtt == null){
srtt = new SelectRingtoneTask();
Log.d(cda, RingTone -  + srtt.getStatus());
}
srtt.execute();

---

The problem occur's when I start the activity and close the Activity
before the AsyncTask finishes, if this happens once, it seems to be
fine but after it happens a second time the AsyncTask will only ever
get to the onPreExecute() method and will never complete again until
the application is force stopped and restarted.

Has anybody got any idea why this would be happening?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: Know if my Alarm is active

2010-09-10 Thread Albert
Anyone? No hidden code to achieve the above?

Thanks

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


Re: [android-developers] AsyncTask doesn't run sometimes despite state returning RUNNING?

2010-09-10 Thread Shawn Brown
 Has anybody got any idea why this would be happening?

Well...  from 
http://brainflush.wordpress.com/2009/11/16/introducing-droid-fu-for-android-betteractivity-betterservice-and-betterasynctask/

So the basic idea is: launch an AsyncTask making your service call,
show a nifty progress dialog while the task thread is running, and
have the task’s result be posted back to your activity once it
completes. Cool, but what if the user decides to rotate the screen
while your task is running? Or a phone call comes in, interrupting
your app, and Android decides to kill it? Both these actions will
effectively terminateyour activity, and recreate it when resuming
(yes, a screen rotation kills your activity, very clever, isn’t it?).
Unfortunately, any AsyncTask that was still running now holds a stale
reference to your activity, because the restarted activity will be an
entirely different object in memory (and it will go through
onCreate(), as if the activity had started for the first time). I’m
not entirely sure whether AsyncTask will actually post back the data
to the old activity object (if it was a weak reference, it may already
have been garbage collected), but in any case, your “new” activity
will never see it, because it’s a different instance.

Now, one could argue: well, just do all the work again, like, re-send
the request or whatever job was running. Yes, you could do that. But
that’s wasteful and, really, makes you feel stupid, no? Plus, if the
user triggers a web service request, then flips the screen, decides
that this wasn’t helpful, and flips it back, then your request is
being sent 3 times in parallel. Is that what you want? Probably not.

BetterAsyncTask to the Rescue

Thanks to Droid-Fu, there’s a solution to this: BetterAsyncTask! (I’m
a lazy person, and I couldn’t come up with a better name). It behaves
exactly like AsyncTask (in fact, it is an AsyncTask), but it does some
extra work for you: first and foremost, it keeps track of the active
instance of the context that launched it, and if that instance should
change, it will post the data back to the new instance. In other
words, you can dispatch your task, flip the screen back and forth
mentally, and BetterAsyncTask will still post the task’s result back
to whatever activity instance is alive at the time it finishes. In
other words, the task is only ever run once, regardless whether the
context in which it was launched died while it was running or not.

http://github.com/kaeppler/droid-fu

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


[android-developers] I am getting the PVMFInfoUnderflow while playing the video from youtube

2010-09-10 Thread manoj
Hi all,

while I am playing the video from browser (youtube.com), I am getting
the PVMFInfoUnderflow event. Could some one explain why I am getting?
in which scenarios we get this error. and if possible try to provide
the solution also.

Thanks,
IIIanoj.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: Adding checkboxes to a LinearLayout

2010-09-10 Thread Zsolt Vasvari

 Actually, I suspect that android:gravity=bottom on the LinearLayout
 may suffice to have the buttons be at the bottom.

I think you have to use layout_gravity, as only TextFields support
android:gravity.  You also have to use wrap_content for the
LinearLayout's height and pray that its parent will honor
layout_gravity, which it may or may not.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] AsyncTask doesn't run sometimes despite state returning RUNNING?

2010-09-10 Thread Donal Rafferty
Thanks for that Shawn, but I'm looking for a solution that doesn't involve
external libraries.

On Fri, Sep 10, 2010 at 10:45 AM, Shawn Brown big.coffee.lo...@gmail.comwrote:

  Has anybody got any idea why this would be happening?

 Well...  from
 http://brainflush.wordpress.com/2009/11/16/introducing-droid-fu-for-android-betteractivity-betterservice-and-betterasynctask/

 So the basic idea is: launch an AsyncTask making your service call,
 show a nifty progress dialog while the task thread is running, and
 have the task’s result be posted back to your activity once it
 completes. Cool, but what if the user decides to rotate the screen
 while your task is running? Or a phone call comes in, interrupting
 your app, and Android decides to kill it? Both these actions will
 effectively terminateyour activity, and recreate it when resuming
 (yes, a screen rotation kills your activity, very clever, isn’t it?).
 Unfortunately, any AsyncTask that was still running now holds a stale
 reference to your activity, because the restarted activity will be an
 entirely different object in memory (and it will go through
 onCreate(), as if the activity had started for the first time). I’m
 not entirely sure whether AsyncTask will actually post back the data
 to the old activity object (if it was a weak reference, it may already
 have been garbage collected), but in any case, your “new” activity
 will never see it, because it’s a different instance.

 Now, one could argue: well, just do all the work again, like, re-send
 the request or whatever job was running. Yes, you could do that. But
 that’s wasteful and, really, makes you feel stupid, no? Plus, if the
 user triggers a web service request, then flips the screen, decides
 that this wasn’t helpful, and flips it back, then your request is
 being sent 3 times in parallel. Is that what you want? Probably not.

 BetterAsyncTask to the Rescue

 Thanks to Droid-Fu, there’s a solution to this: BetterAsyncTask! (I’m
 a lazy person, and I couldn’t come up with a better name). It behaves
 exactly like AsyncTask (in fact, it is an AsyncTask), but it does some
 extra work for you: first and foremost, it keeps track of the active
 instance of the context that launched it, and if that instance should
 change, it will post the data back to the new instance. In other
 words, you can dispatch your task, flip the screen back and forth
 mentally, and BetterAsyncTask will still post the task’s result back
 to whatever activity instance is alive at the time it finishes. In
 other words, the task is only ever run once, regardless whether the
 context in which it was launched died while it was running or not.

 http://github.com/kaeppler/droid-fu

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

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: AsyncTask doesn't run sometimes despite state returning RUNNING?

2010-09-10 Thread Federico Paolinelli
You could probably move the async task to a service, and broadcast all
your stuff when you finish.
If your activity listens for the broadcast, it won't matter if the
activity itself started the service, or if it was started by another
activity (of the same kind).

Federico

On Sep 10, 12:14 pm, Donal Rafferty draf...@gmail.com wrote:
 Thanks for that Shawn, but I'm looking for a solution that doesn't involve
 external libraries.

 On Fri, Sep 10, 2010 at 10:45 AM, Shawn Brown 
 big.coffee.lo...@gmail.comwrote:

   Has anybody got any idea why this would be happening?

  Well...  from
 http://brainflush.wordpress.com/2009/11/16/introducing-droid-fu-for-a...

  So the basic idea is: launch an AsyncTask making your service call,
  show a nifty progress dialog while the task thread is running, and
  have the task’s result be posted back to your activity once it
  completes. Cool, but what if the user decides to rotate the screen
  while your task is running? Or a phone call comes in, interrupting
  your app, and Android decides to kill it? Both these actions will
  effectively terminateyour activity, and recreate it when resuming
  (yes, a screen rotation kills your activity, very clever, isn’t it?).
  Unfortunately, any AsyncTask that was still running now holds a stale
  reference to your activity, because the restarted activity will be an
  entirely different object in memory (and it will go through
  onCreate(), as if the activity had started for the first time). I’m
  not entirely sure whether AsyncTask will actually post back the data
  to the old activity object (if it was a weak reference, it may already
  have been garbage collected), but in any case, your “new” activity
  will never see it, because it’s a different instance.

  Now, one could argue: well, just do all the work again, like, re-send
  the request or whatever job was running. Yes, you could do that. But
  that’s wasteful and, really, makes you feel stupid, no? Plus, if the
  user triggers a web service request, then flips the screen, decides
  that this wasn’t helpful, and flips it back, then your request is
  being sent 3 times in parallel. Is that what you want? Probably not.

  BetterAsyncTask to the Rescue

  Thanks to Droid-Fu, there’s a solution to this: BetterAsyncTask! (I’m
  a lazy person, and I couldn’t come up with a better name). It behaves
  exactly like AsyncTask (in fact, it is an AsyncTask), but it does some
  extra work for you: first and foremost, it keeps track of the active
  instance of the context that launched it, and if that instance should
  change, it will post the data back to the new instance. In other
  words, you can dispatch your task, flip the screen back and forth
  mentally, and BetterAsyncTask will still post the task’s result back
  to whatever activity instance is alive at the time it finishes. In
  other words, the task is only ever run once, regardless whether the
  context in which it was launched died while it was running or not.

 http://github.com/kaeppler/droid-fu

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

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: Know if my Alarm is active

2010-09-10 Thread Kostya Vasilyev
Setting an alarm cancels any previous alarms set with the same pending
intent, where same has a certain definition.

This means that it's OK to set your alarm if it's already set - this will
not result in extraneous events.

For initializing the alarm in the first place, implement a broadcast
receiver for BOOT_COMPLETED.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

10.09.2010 13:39 пользователь Albert albert8...@googlemail.com написал:

Anyone? No hidden code to achieve the above?

Thanks


-- 
You received this message because you are subscribed to the Google
Groups Android Developers ...

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: Know if my Alarm is active

2010-09-10 Thread Albert
Thanks for your reply.

I have all that set up. The thing is that if an user kills my app/
service with a task killer app, then my alarm would go away.

I would like to be able to do a check about whether I have a alarm
ready to go off at some point in the future. I do not want to re-set
the alarm if I know that one is already in place.

Something like:
AlarmManager mgr
=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
if (mgr(with my pending intent).isActive()) {
//all is good
}

Thanks,

Alberto


On Sep 10, 11:38 am, Kostya Vasilyev kmans...@gmail.com wrote:
 Setting an alarm cancels any previous alarms set with the same pending
 intent, where same has a certain definition.

 This means that it's OK to set your alarm if it's already set - this will
 not result in extraneous events.

 For initializing the alarm in the first place, implement a broadcast
 receiver for BOOT_COMPLETED.

 --
 Kostya Vasilyev --http://kmansoft.wordpress.com

 10.09.2010 13:39 пользователь Albert albert8...@googlemail.com написал:

 Anyone? No hidden code to achieve the above?

 Thanks

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers ...

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


Re: [android-developers] How I get Command in Home Screen In Android

2010-09-10 Thread Mark Murphy
On Fri, Sep 10, 2010 at 4:57 AM, Animesh Sinha
animesh.andr...@gmail.com wrote:
 I mean to say that i want a notification(Command) same as when we
 type *#06# in home screen it will show a IMEI no. in the same way when
 i press a certain code (eg: *#12345#) then it will notify to my
 service which is running in background.

 Plz solve my problem and reply me soon.

You can write your own home screen.

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

Android Training in London: http://skillsmatter.com/go/os-mobile-server

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: Know if my Alarm is active

2010-09-10 Thread Mark Murphy
2010/9/10 Albert albert8...@googlemail.com:
 I have all that set up. The thing is that if an user kills my app/
 service with a task killer app, then my alarm would go away.

If they did that, then they do not want your alarm. And, starting with
Android 2.2, they can't do this anyway.

Hence, I would not worry much about it. Keep a log of work you do in
the alarm handler, and if the user starts your activity and you
determine, via the log, that your alarm had been stopped, restart it
and perhaps pop a dialog to tell the user the ramifications of them
having attacked you with a task killer.

 I would like to be able to do a check about whether I have a alarm
 ready to go off at some point in the future.

Sorry, there's no API for that.

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

Android Training in London: http://skillsmatter.com/go/os-mobile-server

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: Samsung Galaxy S and Bluetooth Issues

2010-09-10 Thread snedex
Hi Don,

Thanks for responding, Sorry about the slow response.
OK at least that gives me more information on trying to circumvent
this issue, still having no joy with it.
Have you had any luck at all?

Thanks!


On Aug 12, 7:47 pm, DonFrench dcfre...@gmail.com wrote:
 I also have aBluetoothapp that I developed using a Nexus One and I
 am finding that some carriers have disabledBluetoothserial in their
 phones, presumably to prevent tethering.  I don't know if this is the
 case with the phone you tested with or not but this might be the way
 they are preventing the BT connection.  With the Verizon Droid, it
 makes the connection and then immediately drops it.

 On Aug 10, 2:48 pm, snedex sne...@gmail.com wrote:




-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: Know if my Alarm is active

2010-09-10 Thread Albert


 If they did that, then they do not want your alarm. And, starting with
 Android 2.2, they can't do this anyway.

Yes I noticed that it doesn't happen in 2.2, users can easily switch
the alarm off by going to the app settings and unchecking the
notifications.


  I would like to be able to do a check about whether I have a alarm
  ready to go off at some point in the future.

 Sorry, there's no API for that.

Thanks for answering. At least I know now that I can't do more than
what I'm doing already.

Alberto

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


[android-developers] How to run adb commands from within the applications.

2010-09-10 Thread Prince
Hi All,

I want to run adb commands like
adb install application.apk or adb uinstall application.apk
from my android application.

Kindly help me out in this or provide some directions to perform this
task.

Thanks  Regards,
Pranjal

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: AsyncTask doesn't run sometimes despite state returning RUNNING?

2010-09-10 Thread Donal Rafferty
Excellent idea Federico, However my AsyncTask fetches a RingTone object
(com.android.RingTone) and I have no way of passing this object from my
Service to my Activity?


On Fri, Sep 10, 2010 at 11:36 AM, Federico Paolinelli fedep...@gmail.comwrote:

 You could probably move the async task to a service, and broadcast all
 your stuff when you finish.
 If your activity listens for the broadcast, it won't matter if the
 activity itself started the service, or if it was started by another
 activity (of the same kind).

 Federico

 On Sep 10, 12:14 pm, Donal Rafferty draf...@gmail.com wrote:
  Thanks for that Shawn, but I'm looking for a solution that doesn't
 involve
  external libraries.
 
  On Fri, Sep 10, 2010 at 10:45 AM, Shawn Brown 
 big.coffee.lo...@gmail.comwrote:
 
Has anybody got any idea why this would be happening?
 
   Well...  from
  http://brainflush.wordpress.com/2009/11/16/introducing-droid-fu-for-a.
 ..
 
   So the basic idea is: launch an AsyncTask making your service call,
   show a nifty progress dialog while the task thread is running, and
   have the task’s result be posted back to your activity once it
   completes. Cool, but what if the user decides to rotate the screen
   while your task is running? Or a phone call comes in, interrupting
   your app, and Android decides to kill it? Both these actions will
   effectively terminateyour activity, and recreate it when resuming
   (yes, a screen rotation kills your activity, very clever, isn’t it?).
   Unfortunately, any AsyncTask that was still running now holds a stale
   reference to your activity, because the restarted activity will be an
   entirely different object in memory (and it will go through
   onCreate(), as if the activity had started for the first time). I’m
   not entirely sure whether AsyncTask will actually post back the data
   to the old activity object (if it was a weak reference, it may already
   have been garbage collected), but in any case, your “new” activity
   will never see it, because it’s a different instance.
 
   Now, one could argue: well, just do all the work again, like, re-send
   the request or whatever job was running. Yes, you could do that. But
   that’s wasteful and, really, makes you feel stupid, no? Plus, if the
   user triggers a web service request, then flips the screen, decides
   that this wasn’t helpful, and flips it back, then your request is
   being sent 3 times in parallel. Is that what you want? Probably not.
 
   BetterAsyncTask to the Rescue
 
   Thanks to Droid-Fu, there’s a solution to this: BetterAsyncTask! (I’m
   a lazy person, and I couldn’t come up with a better name). It behaves
   exactly like AsyncTask (in fact, it is an AsyncTask), but it does some
   extra work for you: first and foremost, it keeps track of the active
   instance of the context that launched it, and if that instance should
   change, it will post the data back to the new instance. In other
   words, you can dispatch your task, flip the screen back and forth
   mentally, and BetterAsyncTask will still post the task’s result back
   to whatever activity instance is alive at the time it finishes. In
   other words, the task is only ever run once, regardless whether the
   context in which it was launched died while it was running or not.
 
  http://github.com/kaeppler/droid-fu
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@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.comandroid-developers%2bunsubscr...@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

Re: [android-developers] How to run adb commands from within the applications.

2010-09-10 Thread Mark Murphy
On Fri, Sep 10, 2010 at 7:29 AM, Prince pranjal.andr...@gmail.com wrote:
 I want to run adb commands like
 adb install application.apk or adb uinstall application.apk
 from my android application.

 Kindly help me out in this or provide some directions to perform this
 task.

You can't run adb install or adb uninstall from your Android application.

You can trigger the install process of an APK by calling
startActivity() an ACTION_VIEW (?) Intent, with a Uri pointing to your
APK file and the appropriate MIME type. This will give the user much
the same experience as if they had downloaded the app off the Web --
it will prompt them to validate the permissions, then will install the
app.

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

Android Training in London: http://skillsmatter.com/go/os-mobile-server

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: Monkey problems -- **URGENT HELP** --

2010-09-10 Thread DanH
 Yes - to person with the deadline, sure this would seem urgent. To the rest
 of us on this volunteer list? Not so much. I think it makes the poster seem
 impatient, especially when the OP does not explain what makes it so
 important. He could be trying to cram in some last minute homework
 assignment that he slacked off on, for all we know.

So in other words, it's only validly urgent if it interests YOU, and
everyone must get clearance from YOU before labeling anything
urgent.

On Sep 10, 1:45 am, TreKing treking...@gmail.com wrote:
 On Thu, Sep 9, 2010 at 2:36 PM, DanH danhi...@ieee.org wrote:
  In the case of something like Monkey, the need to meet an internal demo
  date would be valid cause for urgent, in my opinion.

 Yes - to person with the deadline, sure this would seem urgent. To the rest
 of us on this volunteer list? Not so much. I think it makes the poster seem
 impatient, especially when the OP does not explain what makes it so
 important. He could be trying to cram in some last minute homework
 assignment that he slacked off on, for all we know.

 On Thu, Sep 9, 2010 at 11:37 PM, Tez earlencefe...@gmail.com wrote:
  @TrekIng - thanks for your professional opinion.

 This is most definitely NOT professional opinion. I'm just telling you how
 posts with urgent in the title are usually perceived on forums like this
 where people ask for technical help. Most of the people on this group are
 working individually on projects as a hobby - the level of urgency of
 solving any given problem presented here, in the grand scheme of things, is
 incredibly low.

 However important this problem is for you to solve, it frankly means nothing
 to the rest of us and adding urgent is not going to make us drop
 everything to try to help. At best it adds nothing to the discussion about
 the problem you're having and at worst it makes you seem impatient and
 actually discourages people from helping you.

 Believe it or not, I'm actually trying to help you. I really think you would
 be best served, now and in the future, with not adding urgent to your
 post. It usually hurts more than it helps - that's what I'm trying to get
 at.

  You have admitted that you have not used monkey yet you make the claim that
  having trouble with it is not urgent.

 Correct. I don't need to use the tool to determine this. Even if you never
 solve your problem, the world will keep spinning and life will go on. You
 claim this is urgent but you've still not explained what the severe
 consequences of this not being solved will be, besides there being
 important work depending on it - which is completely subjective to you.

  Did you base this on your previous monkey experience?

 Where did I claim to have monkey experience? I'm pretty sure I clearly
 stated I had not used Monkey. Or was that sarcasm?

 -
 TreKing http://sites.google.com/site/rezmobileapps/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


Re: [android-developers] Re: Monkey problems -- **URGENT HELP** --

2010-09-10 Thread { Devdroid }
On 10 September 2010 13:59, DanH danhi...@ieee.org wrote:
 Yes - to person with the deadline, sure this would seem urgent. To the rest
 of us on this volunteer list? Not so much. I think it makes the poster seem
 impatient, especially when the OP does not explain what makes it so
 important. He could be trying to cram in some last minute homework
 assignment that he slacked off on, for all we know.

 So in other words, it's only validly urgent if it interests YOU, and
 everyone must get clearance from YOU before labeling anything
 urgent.

Please stop ranting. It was pretty clearly said by others but maybe
some needs in simplier words - nobody cares your urgency. It's
you who have deadline, not us. Flagging urgent, answer now
and reposting withing next hours with nobody? or so usually annoys
people (I simply delete such post without even bothering its content).
If that's what you want, then keep going that way. BTW: if it's so urgent
for one's business then s/he shall *hire* someone to help urgently. If s/he
want free help, it's recommended to follow common rules here and wait
kindly in the line.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] Monkey problems -- **URGENT HELP** --

2010-09-10 Thread Mark Murphy
On Wed, Sep 8, 2010 at 11:00 AM, Tez earlencefe...@gmail.com wrote:
 I start monkey like this:

 monkey -p MY PACKAGE --port 4321

There is no documented --port switch on the monkey command:

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

Hence, you are probably going to have to hunt through the source code
to figure out the cause of your difficulty.

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

Android Training in London: http://skillsmatter.com/go/os-mobile-server

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] Working Around Samsung Double-SD Problem

2010-09-10 Thread Pent
My thinking was:

if ( android.os.Build.MODEL contains-case-insensitive Vibrant /
Incredible / Galaxy ) {
   if ( dirExists( /sdcard/sd ) )
// use that one
   else if ( dirExists( /emmc ) )
// use that one
}
else {
   // usual procedure
   getExternal...
}

Does that look right ? I don't have any talkative users for testing
yet.

Thanks,

Pent

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] Content Providers implementation and closing of DB

2010-09-10 Thread Arpit
I am extending the ContentProvider class and writing content provider
for my app. Some what similar to the tutorial given here http://goo.gl/91WV

What I want to know is, we create a ReadableDatabase or
WriteableDatabase instance in the overridden query method which
returns a cursor.

Now from the android documentation it states that the Database create
is cached when called getReadableDatabase or getWriteableDatabase  on
a SQLiteDatabase instance but it should be closed also.

Now in the query method of ContentProvider extended class, I get the
cursor and that is returned. If I close the DB instance my cursor is
also closed, so if I had fetched some data it vanishes. I can't close
the cursor object also (don't know whether such thing is possible).

So how is the SQLiteDatabase instance is closed finally in such a
design? Can it become problem if I have frequent db queries... like 10
calls per min...?

Please guide me if I have misunderstood the concept somehow?

Regards,
Arpit

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: AsyncTask doesn't run sometimes despite state returning RUNNING?

2010-09-10 Thread Federico Paolinelli
One way I would try is to bind your activity to the service and give
the service a callback to be called when you asynctask has finished
its dirty job. (I've never done this, but it may work).
You can provide your ringtone object as argument of the callback.



On 10 Set, 13:38, Donal Rafferty draf...@gmail.com wrote:
 Excellent idea Federico, However my AsyncTask fetches a RingTone object
 (com.android.RingTone) and I have no way of passing this object from my
 Service to my Activity?

 On Fri, Sep 10, 2010 at 11:36 AM, Federico Paolinelli 
 fedep...@gmail.comwrote:

  You could probably move the async task to a service, and broadcast all
  your stuff when you finish.
  If your activity listens for the broadcast, it won't matter if the
  activity itself started the service, or if it was started by another
  activity (of the same kind).

  Federico

  On Sep 10, 12:14 pm, Donal Rafferty draf...@gmail.com wrote:
   Thanks for that Shawn, but I'm looking for a solution that doesn't
  involve
   external libraries.

   On Fri, Sep 10, 2010 at 10:45 AM, Shawn Brown 
  big.coffee.lo...@gmail.comwrote:

 Has anybody got any idea why this would be happening?

Well...  from
   http://brainflush.wordpress.com/2009/11/16/introducing-droid-fu-for-a.
  ..

So the basic idea is: launch an AsyncTask making your service call,
show a nifty progress dialog while the task thread is running, and
have the task’s result be posted back to your activity once it
completes. Cool, but what if the user decides to rotate the screen
while your task is running? Or a phone call comes in, interrupting
your app, and Android decides to kill it? Both these actions will
effectively terminateyour activity, and recreate it when resuming
(yes, a screen rotation kills your activity, very clever, isn’t it?).
Unfortunately, any AsyncTask that was still running now holds a stale
reference to your activity, because the restarted activity will be an
entirely different object in memory (and it will go through
onCreate(), as if the activity had started for the first time). I’m
not entirely sure whether AsyncTask will actually post back the data
to the old activity object (if it was a weak reference, it may already
have been garbage collected), but in any case, your “new” activity
will never see it, because it’s a different instance.

Now, one could argue: well, just do all the work again, like, re-send
the request or whatever job was running. Yes, you could do that. But
that’s wasteful and, really, makes you feel stupid, no? Plus, if the
user triggers a web service request, then flips the screen, decides
that this wasn’t helpful, and flips it back, then your request is
being sent 3 times in parallel. Is that what you want? Probably not.

BetterAsyncTask to the Rescue

Thanks to Droid-Fu, there’s a solution to this: BetterAsyncTask! (I’m
a lazy person, and I couldn’t come up with a better name). It behaves
exactly like AsyncTask (in fact, it is an AsyncTask), but it does some
extra work for you: first and foremost, it keeps track of the active
instance of the context that launched it, and if that instance should
change, it will post the data back to the new instance. In other
words, you can dispatch your task, flip the screen back and forth
mentally, and BetterAsyncTask will still post the task’s result back
to whatever activity instance is alive at the time it finishes. In
other words, the task is only ever run once, regardless whether the
context in which it was launched died while it was running or not.

   http://github.com/kaeppler/droid-fu

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to
  android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@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.comandroid-developers%2bunsubscr...@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

[android-developers] Re: some time my Phone state receiver not receiving any broadcast message wot to do

2010-09-10 Thread A N K ! T
no one know how to resolve this

On Fri, Sep 10, 2010 at 12:10 PM, A N K ! T ankit.awasth...@gmail.comwrote:

 i have create a receiver which receive on phone state change i have
 register it in xml by android.intent.action.PHONE_STATE

 but some time it dont receive any broadcast message
   log mesages are:::


 09-10 11:20:36.968: WARN/ActivityManager(74): Timeout of broadcast
 BroadcastRecord{43347258 android.intent.action.PHONE_STATE -
 receiver=android.os.binderpr...@4334ebd0

 09-10 11:20:36.968: WARN/ActivityManager(74): Receiver during timeout:
 ResolveInfo{432dd748 com.callHandller.PhoneStateReciever p=0 o=0 m=0x108000}

 09-10 11:20:36.968: INFO/Process(74): Sending signal. PID: 2223 SIG: 9

 09-10 11:20:36.988: ERROR/JavaBinder(74): !!! FAILED BINDER TRANSACTION !!!

 09-10 11:20:37.008: INFO/ActivityManager(74): Process com.callHandller (pid
 2223) has died.

 09-10 11:20:37.008: INFO/WindowManager(74): WIN DEATH: Window{4324f470
 com.callHandller/com.incallHandller.callHandler paused=false}

 09-10 11:20:37.958: WARN/ActivityManager(74): Activity destroy timeout for
 HistoryRecord{4321c7c0 com.callHandller/com.incallHandller.callHandler}

 09-10 11:20:42.288: DEBUG/dalvikvm(136): GC freed 2543 objects / 143320
 bytes in 179ms

 here com.callhandller is my application package where i have Receiver...

 guide me wot to do.

 --

  A N K ! T..





-- 

 A N K ! T..

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: some time my Phone state receiver not receiving any broadcast message wot to do

2010-09-10 Thread Mark Murphy
On Fri, Sep 10, 2010 at 8:42 AM, A N K ! T ankit.awasth...@gmail.com wrote:
 no one know how to resolve this

Perhaps you are spending too much time in onReceive() of the
BroadcastReceiver, which is triggering the timeout.

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

Android Training in London: http://skillsmatter.com/go/os-mobile-server

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: Monkey problems -- **URGENT HELP** --

2010-09-10 Thread TreKing
On Fri, Sep 10, 2010 at 1:53 AM, Tez earlencefe...@gmail.com wrote:

 I hope this clears things.


It explains why you feel you need help urgently - it does not explain why
the rest of the people on this group would find it urgent to help you.
That's a very important difference.

Please understand I'm not trying to belittle the severity of your problem as
it pertains to you - I'm trying to, very frankly, explain to you that this
manner of posting hurts you more than it helps. I hope you can see that.

On Fri, Sep 10, 2010 at 6:59 AM, DanH danhi...@ieee.org wrote:

 So in other words, it's only validly urgent if it interests YOU, and
 everyone must get clearance from YOU before labeling anything urgent.


No. Please don't twist my words - read what I posted, not what you want to
see. If you want to put what I said in other words, it's more like it's
only validly urgent to the person posting and everyone else really doesn't
give a damn. (Do YOU care about the OP's problem? What are YOU doing to
help with his urgent problem?)

The simple point is that labeling anything urgent doesn't help one get
help - in fact it usually has the opposite effect.

-
TreKing http://sites.google.com/site/rezmobileapps/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] Hi All

2010-09-10 Thread lokesh gupta
Hi

-- 
Thanks  Regards
Lokesh Gupta

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] Working Around Samsung Double-SD Problem

2010-09-10 Thread Kostya Vasilyev

 Pent,

Looks close for the Galaxy S, but on my retail Euro version Build.MODEL 
is GT-I9000.


Build.PRODUCT and Build.DEVICE have the same value, as well.

Also, /sdcard/sd exists even when the external memory card is not 
installed, in that case, writing to /sdcard/sd places files on the 
internal memory card (the usual rule with a mount point that has not 
been mounted).


-- Kostya

10.09.2010 16:28, Pent пишет:

My thinking was:

if ( android.os.Build.MODEL contains-case-insensitive Vibrant /
Incredible / Galaxy ) {
if ( dirExists( /sdcard/sd ) )
 // use that one
else if ( dirExists( /emmc ) )
 // use that one
}
else {
// usual procedure
getExternal...
}

Does that look right ? I don't have any talkative users for testing
yet.

Thanks,

Pent




--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.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] is there a way to implement screenshot functionality in android

2010-09-10 Thread dadada
hi all,

question as above!

thanks
bryan

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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 prevent a service from being restarted by the system...

2010-09-10 Thread sdphil
C:\dev\testApp adb shell dumpsys service
Can't find service: service

C:\dev\testApp adb shell dumpsys MyService
Can't find service: MyService

On Sep 10, 12:28 am, Dianne Hackborn hack...@android.com wrote:
 What is in the log?  What does it say about your service in adb shell
 dumpsys service?



 On Thu, Sep 9, 2010 at 11:45 PM, sdphil phil.pellouch...@gmail.com wrote:
  From what I can tell -- if you return START_NOT_STICKY from
  Service.onStartCommand(...), the system should not restart a service
  if it crashes.

  However, I'm not seeing that behavior -- any ideas on what could be
  restarting the service?

  tia.

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

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

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

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


[android-developers] Re: How to prevent a service from being restarted by the system...

2010-09-10 Thread sdphil
i am running my app in the debugger.  when I hit the red square (in
eclipse) on the debug tab -- to stop debugging, I get this in the
logcat window:

09-10 06:55:52.248: WARN/ActivityManager(83): Scheduling restart of
crashed service com.testapp/MyApp/com.testapp.service.MyService in
5000ms

and then it attaches the debugger to another instance of my app...
this is a local service.

On Sep 10, 6:55 am, sdphil phil.pellouch...@gmail.com wrote:
 C:\dev\testApp adb shell dumpsys service
 Can't find service: service

 C:\dev\testApp adb shell dumpsys MyService
 Can't find service: MyService

 On Sep 10, 12:28 am, Dianne Hackborn hack...@android.com wrote:

  What is in the log?  What does it say about your service in adb shell
  dumpsys service?

  On Thu, Sep 9, 2010 at 11:45 PM, sdphil phil.pellouch...@gmail.com wrote:
   From what I can tell -- if you return START_NOT_STICKY from
   Service.onStartCommand(...), the system should not restart a service
   if it crashes.

   However, I'm not seeing that behavior -- any ideas on what could be
   restarting the service?

   tia.

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

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

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



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


Re: [android-developers] is there a way to implement screenshot functionality in android

2010-09-10 Thread Mark Murphy
On Fri, Sep 10, 2010 at 9:53 AM, dadada ytbr...@gmail.com wrote:
 question as above!

This is not supported, for security reasons. There are apparently ways
you can get something to work if you root your phone. And, of course,
you can do screenshots from outside your phone using DDMS.

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

Android Training in London: http://skillsmatter.com/go/os-mobile-server

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] Versioning and common code-bases with Eclipse

2010-09-10 Thread MobDev
Hi there,
I'd like to bring out an app in the near future, so I was wondering
how to support a couple of funcitonalities I have got used whilst
developing for J2ME and iPhone

- first the versioning. With J2ME (using NetBeans as IDE) I had the
option to auto-increment the softwwares version every time I compiled
it. I was wondering if something like this is available for Eclipse
and if so how to use it ?
- secondly a common code base. Is it possible to have a common code
base for several projects ? For example I might have a game which
actually uses the same code but needs different graphic resources. I'd
hate to have a different project for every game/app and have to
manually edit every project's source every time I want to submit a new
code-change. Any solution for  this ?

Thanks in advance for every kind of help/hints/tips !

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: Working Around Samsung Double-SD Problem

2010-09-10 Thread Pent
 Looks close for the Galaxy S, but on my retail Euro version Build.MODEL
 is GT-I9000.

Sugar.

 Build.PRODUCT and Build.DEVICE have the same value, as well.

Double sugar.

 Also, /sdcard/sd exists even when the external memory card is not
 installed, in that case, writing to /sdcard/sd places files on the
 internal memory card

1kg bag of sugar.

 (the usual rule with a mount point that has not
 been mounted).

The usual rule where ? Default linux it should be an empty directory.

So any solution to this is going to be extremely messy in other words.

In any case thanks for course for the info.

Pent

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: J2ME to Android

2010-09-10 Thread kypriakos

I found out that ConnectionNotFound exception thrown when opening a
stream-based socket could be thrown when the protocol indicated in
the Connection class is not supported - does Android support all
of the following?

http, comm, datagram, file, socket etc? I think yes but the exception
does not seem to make sense. Thanks.


On Sep 2, 11:58 pm, kypriakos demet...@ece.neu.edu wrote:
 Hey Kostya,

 are you referring to the apache http API included in Android? I will
 give it
 a shot. I downloaded and included the J2ME-polish that actually does
 run
 under Android but I am getting a Connection Not Found exception thrown
 when I run that piece of code in the emulator. I can actually connect
 to
 the location using the browser directly so something is not getting
 set
 right in that config ...

 Thanks

 On Sep 1, 3:34 pm, Kostya Vasilyev kmans...@gmail.com wrote:   The code 
 seems to be really simple, establishing an HTTP connection,
  and getting raw streams for reading and writing.

  Replace javax.microedition classes with those included with Android.

  -- Kostya

  01.09.2010 23:26, kypriakos пишет:

   Hi all - trying this one again .. any ideas? If the Connector class
   was not
   created in the original Android Java, what else can be used in its
   place?
   3rd Party software or any other part of the API? Thanks.

   On Aug 26, 4:47 pm, kypriakosdemet...@ece.neu.edu  wrote:
   I am pretty much trying to solve these issues:

                import javax.microedition.io.Connector;
                socketCon = (SocketConnection) Connector.open(strURL,
   Connector.READ_WRITE);

   and

                import javax.microedition.io.StreamConnection;

                    streamCon = (SocketConnection) Connector.open(strURL,
   Connector.READ);
                    streamCon = (HttpConnection) Connector.open(strURL,
   Connector.READ);

   Any ideas would be greatly appreciated.

   Thanks

  --
  Kostya Vasilyev -- WiFi Manager + pretty widget 
  --http://kmansoft.wordpress.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] problem with AsyncTask

2010-09-10 Thread André
Hi,
I was wondering if someone could help me with my asynctask? I have a
problem with onPostExecute and onCancelled. onPostExecute seems to be
skipped everytime I run the asynctask, the file downloads, no problem,
but the dialog is still there. As for the cancel button, it doesn't
seem to reach onCancelled. Can anyone wee what I'm doing wrong?

/André

protected class DownloadTask extends AsyncTaskContext, Integer,
Void{

private Dialog dialogD;
private ProgressBar downloadBar;
private ImageButton cancel;

OnClickListener listen = new OnClickListener() {
@Override
public void onClick(View v) {
if(v == cancel) {
downloadTask.cancel(true);
}
}
};

@Override
protected void onPreExecute() {
super.onPreExecute();
//  Context mContext = getApplicationContext();
dialogD = new Dialog(SilverFTP.this);
dialogD.setContentView(R.layout.silver_ftp_downloading);
dialogD.setTitle(Downloading...);
TextView info = (TextView)
dialogD.findViewById(R.id.download_info);
info.setText(fileName);
downloadBar = (ProgressBar)
dialogD.findViewById(R.id.download_bar);
cancel = (ImageButton) 
dialogD.findViewById(R.id.cancel_download);
cancel.setOnClickListener((OnClickListener) this);
dialogD.show();
logg.append(onPreExecute + \n);
Log.i(makemachine, onPreExecute());
}

@Override
protected Void doInBackground(final Context... params) {
try {
InputStream stO = new
BufferedInputStream(client.retrieveFileStream(fileToUse),
client.getBufferSize());
OutputStream stD = new FileOutputStream(placeToPaste);
while (ftpTotal  ftpSize) {
Util.copyStream(stO, stD, client.getBufferSize(),
CopyStreamEvent.UNKNOWN_STREAM_SIZE, new CopyStreamAdapter(){
public void bytesTransferred(long
totalBytesTransferred, int bytesTransferred, long streamSize) {
double tempProgress =
(((double)totalBytesTransferred / (double)ftpSize) * 100.0);
int progress = (int) tempProgress;
publishProgress(progress);
}
});
}
client.completePendingCommand();
} catch (IOException e) {
logg.append(Download IOExc, download() + 
\n);
e.printStackTrace();
}
return null;
}

protected void onProgressUpdate(final Integer... values) {
downloadBar.setProgress(values[0]);
Log.i(makemachine, onProgressUpdate():  +
String.valueOf(values[0]));
}

@Override
protected void onCancelled() {
super.onCancelled();
downloadTask.dialogD.dismiss();
}

@Override
protected void onPostExecute(Void v) {
logg.append(onPostExecute + \n);
downloadTask.dialogD.dismiss();

}

}

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] Twitter4j 2.1.4 HttpClietImpl calls wrong Scheme Constructor

2010-09-10 Thread Jakob Sachse
Hi,
I was looking for a good twitter lib. Twitter4J claims to be Android
platform and Google APP Engine ready.
I liked how the  website came up with just the example code one needs
to jump right into development.
I have the twitter4j properties file on my classpath and am using the -
core and the -http-client-support libs.

But instead of working I got a NoSuchMethodException.

Looking into the source I found that the
twitter4j.internal.http.alternative.HttpClientImpl calls
-
new Scheme(http, 80, PlainSocketFactory.getSocketFactory())
-
in its constructor. Yet the parameter order is incorrect.
http://developer.android.com/reference/org/apache/http/conn/scheme/Scheme.html
says the order must be like so:
-
new Scheme(http, PlainSocketFactory.getSocketFactory(), 80)
-
I don't see how Twitter4J is working with that kind of bug.

Can anybody give me a hind of how to curretly use twitter4j on
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


[android-developers] Re: Working Around Samsung Double-SD Problem

2010-09-10 Thread Chris Stratton
How about reading /proc/self/mounts or /proc/partitions ...and of
course falling back to default if none of that works.

You could also bury a user modifiable path string somewhere in a
config menu


Pent wrote:
  Looks close for the Galaxy S, but on my retail Euro version Build.MODEL
  is GT-I9000.

 Sugar.

  Build.PRODUCT and Build.DEVICE have the same value, as well.

 Double sugar.

  Also, /sdcard/sd exists even when the external memory card is not
  installed, in that case, writing to /sdcard/sd places files on the
  internal memory card

 1kg bag of sugar.

  (the usual rule with a mount point that has not
  been mounted).

 The usual rule where ? Default linux it should be an empty directory.

 So any solution to this is going to be extremely messy in other words.

 In any case thanks for course for the info.

 Pent

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] registerForContextMenu not working

2010-09-10 Thread JasonMP
Hi everyone, My context menus are not registering when called.  In
addition setOnItemClickListener is also not working.  Any ideas why
this is happening?

@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.armory_header);

  TabHost mTabHost = getTabHost();


mTabHost.addTab(mTabHost.newTabSpec(1).setIndicator(Weapons).setContent(R.id.page1));

mTabHost.addTab(mTabHost.newTabSpec(2).setIndicator(Armor).setContent(R.id.page2));

mTabHost.addTab(mTabHost.newTabSpec(3).setIndicator(Accessories).setContent(R.id.page3));

  weapons = (ListView) findViewById(R.id.weaponlist);
  registerForContextMenu(weapons);
  weapons.setOnItemClickListener(new OnItemClickListener(){

@Override
public void onItemClick(AdapterView? arg0, 
View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
listId = weapons.getId();
position = arg2;
showDialog(DIALOG);
}

  });

  armor = (ListView) findViewById(R.id.armorlist);
  registerForContextMenu(armor);
  armor.setOnItemClickListener(new OnItemClickListener(){

@Override
public void onItemClick(AdapterView? arg0, 
View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
listId = armor.getId();
position = arg2;
showDialog(DIALOG);
}

  });
}

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: Monkey problems -- **URGENT HELP** --

2010-09-10 Thread Tez
@Devdroid - Its only written urgent I have not reposted nobody?
and things like that. Please read before you speak.
I was patiently waiting for replies.

@Mark, thanks for the reply. Yes --port is a new thing. it allows
network control of the monkey, looks like i'll have to dig thru the
code to see why its not working as documented.

@Treking
You should really write your replies with finesse. Your statements can
put off a lot of people.

-E

On Sep 10, 6:02 pm, TreKing treking...@gmail.com wrote:
 On Fri, Sep 10, 2010 at 1:53 AM, Tez earlencefe...@gmail.com wrote:
  I hope this clears things.

 It explains why you feel you need help urgently - it does not explain why
 the rest of the people on this group would find it urgent to help you.
 That's a very important difference.

 Please understand I'm not trying to belittle the severity of your problem as
 it pertains to you - I'm trying to, very frankly, explain to you that this
 manner of posting hurts you more than it helps. I hope you can see that.

 On Fri, Sep 10, 2010 at 6:59 AM, DanH danhi...@ieee.org wrote:
  So in other words, it's only validly urgent if it interests YOU, and
  everyone must get clearance from YOU before labeling anything urgent.

 No. Please don't twist my words - read what I posted, not what you want to
 see. If you want to put what I said in other words, it's more like it's
 only validly urgent to the person posting and everyone else really doesn't
 give a damn. (Do YOU care about the OP's problem? What are YOU doing to
 help with his urgent problem?)

 The simple point is that labeling anything urgent doesn't help one get
 help - in fact it usually has the opposite effect.

 -
 TreKing http://sites.google.com/site/rezmobileapps/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] AsyncTask and screen rotation

2010-09-10 Thread Bret Foreman
Is there a standard pattern for handling a running AsyncTask with
screen rotation? My AsyncTask runs for about 10 seconds. I could call
AsyncTask.cancel in the Activity's onDestroy method and restart the
task in onCreate but that would waste cycles, bandwidth, and user
time. I'm guessing there is a better way.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: Adding checkboxes to a LinearLayout

2010-09-10 Thread Robert Nekic
Aside from the gravity discussion that has started, I'm not sure
addContentView is what you want.   I think the approach you are taking
now is simply stacking the CheckBoxes on top of the LinearLayout...not
putting them inside it.  You say you already have a vertically
oriented LinearLayout?  Is it defined in a layout XML file you you are
setting during onCreate?  Grab the LinearLayout and use addView:

LinearLayout linearLayout =
(LinearLayout)this.findViewById(R.id.yourLinearLayoutID);
CheckBox box = new CheckBox(this);
linearLayout.addView(box);
CheckBox box2 = new CheckBox(this);
linearLayout.addView(box2);
(etc etc)






On Sep 9, 2:42 pm, Bret Foreman bret.fore...@gmail.com wrote:
 I want to add some checkboxes to a LinearLayout at runtime. The
 orientation is vertical and I want the checkboxes to appear at the
 bottom. I create each checkbox like this:

 CheckBox box = new CheckBox(this);

 Then I add the box to the current view like this:

 addContentView( box , params );

 What should be the params to get the effect I want? So far, everything
 I've tried ends up overlaying the new checkboxes on top of each other
 and on top of the other items in the layout. I want everything stacked
 in a column with the new checkboxes at the bottom.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: Working Around Samsung Double-SD Problem

2010-09-10 Thread Alessandro Pellizzari
Il Fri, 10 Sep 2010 05:28:17 -0700, Pent ha scritto:

 if ( android.os.Build.MODEL contains-case-insensitive Vibrant /
 Incredible / Galaxy ) {
if ( dirExists( /sdcard/sd ) )
 // use that one
else if ( dirExists( /emmc ) )
 // use that one

Hardcoding paths is always bad.

Put an advanced settings entry (with a disclaimer) in your menu and ask 
the user where he wants to save the data. Else save them in getExternal...

On Android 2.2 (GAOSP for Samsung Galaxy) those paths changed to
/mnt/sdcard/ and /mnt/sdcard/sd/ and some apps stopped working. The same 
could happen on official GalaxyS Froyo update.

Bye.


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] Tiled Bitmap sometimes doesn't tile...

2010-09-10 Thread Andrew n marshall


I'm trying to use the following layered drawable:

?xml version=1.0 encoding=utf-8?
layer-list xmlns:android=http://schemas.android.com/apk/res/android;
item
bitmap android:src=@drawable/bluestar_tile
android:tileMode=repeat
/
/item
item
bitmap android:src=@drawable/bluestar_grad
android:gravity=fill
/
/item
/layer-list


It is a semi-transparent gradient over a tile.  However, on some 
occasions the tile layer doesn't tile.  Instead I see the gradient image 
streched over the designated space, a single tile block, and the 
background showing through elsewhere.


It seems only related to my animated components of which the layered 
bitmap is a background of.  Orientation changes seem to trigger it more 
often, but I've seen the error without an orientation change or even an 
activity switch.  I believe the background always shows up successfully 
at least once.  However, once it fails on one animated background, it 
will fail on all other animated backgrounds, while other components with 
that background continue to render correctly.  Further, I can only clear 
the error by restarting the process (something I can't ship with).


Any thoughts on what might be the error, or suggested tests I could run 
to narrow down the possibilities?



Anm

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] AsyncTask and screen rotation

2010-09-10 Thread Mark Murphy
On Fri, Sep 10, 2010 at 11:13 AM, Bret Foreman bret.fore...@gmail.com wrote:
 Is there a standard pattern for handling a running AsyncTask with
 screen rotation? My AsyncTask runs for about 10 seconds. I could call
 AsyncTask.cancel in the Activity's onDestroy method and restart the
 task in onCreate but that would waste cycles, bandwidth, and user
 time. I'm guessing there is a better way.

Option #1: Don't have Android do the normal destroy/recreate cycle.
Add an android:configChanges attribute to your manifest for this
activity, and override onConfigurationChanged() to fix up your UI.
This keeps the same Activity instance, and so your AsyncTask should be
fairly happy. Here is a project that has this setup, though it does
not use an AsyncTask:

http://github.com/commonsguy/cw-android/tree/master/Rotation/RotationThree/

Option #2: Make the AsyncTask either a public top-level Java class
(not an inner class) or static inner class of the Activity. Manually
associate the Activity with the AsyncTask via a constructor parameter
in your AsyncTask instance. Associate the new Activity instance with
the AsyncTask after the rotation. You can see an example of this
technique here:

http://github.com/commonsguy/cw-android/tree/master/Rotation/RotationAsync/

Option #3: I think droid-fu may have some stuff related to this in
their library.

Personally, I'd use option #1.

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

Android Training in London: http://skillsmatter.com/go/os-mobile-server

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: AsyncTask and screen rotation

2010-09-10 Thread Maps.Huge.Info (Maps API Guru)
You can handle screen rotation yourself or block it from restarting
your app by adding this (along with other code) in the manifest:

android:configChanges=orientation

Search the docs for that.

-John Coryat

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: UriMatcher match not working properly

2010-09-10 Thread Arpit
I had not copied the code here, but re-wrote it in the post. This miss
was because I made mistake while typing.

And I got -1 cause my content provider was getting registered. It was
not a problem

Now I will write the test case as you said and it will also help me
fix the code properly.

Basically, we have code base which I have is written in Donut and I am
helping my customer update it with few new features and run it in both
Eclair and Froyo. And also move it to Gingerbread once it is out...
Providing ContentProvider is a big requirement as app never shared the
data and had local app db.

Regards,
Arpit

On Sep 10, 12:19 am, A. Elk lancaster.dambust...@gmail.com wrote:
 I missed the mismatch as well; it's subtle. In your manifest, you set
 the authority to com.arpit.providers.MyContentProvider, while in the
 code you set it to com.arpit.provider.MyContentProvider. Note the
 missing s for provider in the code. The ContentResolver shouldn't be
 able to resolve your provider, so you should always get back null when
 you call it. This rouses my curiosity; how do you know that UriMatcher
 is always returning -1?

 On the whole, it would be better in this case to do some debugging
 first. If you provide values to a function, but it doesn't act as you
 expect, then either you passed in the wrong values or misunderstood
 the requirements. Check the values for correctness before you assume
 you misunderstood something.

 Content provider users should also consider writing unit tests for
 their providers. ProviderTestCase2 is a good, comprehensive way to
 test a provider in isolation.

 elk.

 On Sep 9, 11:15 am, Brion Emde brione2...@gmail.com wrote:



  You should not hijack existing threads with new questions that do not
  correspond to the original thread. That makes it very difficult for
  people to find the original thread. Instead, you should start a new
  thread with your question.

  That said, I see that the value of the AUTHORITY that you declare in
  your ContentProvider do not match with the android:authority that you
  declare in your AndroidManifest.xml. You should check that they match.

  Finally, rather than giving snippets of code that you think might be
  useful, it is actually more useful if you give a full example.

  On Sep 9, 1:21 am, Arpit robin.ca...@gmail.com wrote:

   Somehow my UriMatcher is not working properly and because of that I am
   not able to do the CRUD operations on my tables.

   I have the following structure of packages and classes:

   com.arpit.provider : This has a class MyContentProvider which extends
   ContentProvider class
   com.arpit.tables :
           DatabaseHelper extends SQLiteOpenHelper
           KeyTable implements BaseColumns
           ParticipantTable implements BaseColumns

   Now in MyContentProvider, I have done the following:

   ...
   public static final String AUTHORITY =
   com.arpit.provider.MyContentProvider;
   ...
   static{
           UriMatcher uriM = new UriMatcher(UriMatcher.NO_MATCH);
           uriM.addUri(AUTHORITY, key, 0);
           uriM.addUri(AUTHORITY, participant, 1);}

   ...
   public Cursor query(Uri uri, String[] projection, String selection,
                           String[] selectionArgs, String sortOrder) {
                   SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
                   switch(uriM.match(uri)){
                           case 0:
                                   qb.setTables(key);
                                   break;
                           case 1:
                                   qb.setTables(participant);
                                   break;
                   }
   }

   ...

   In my KeyTable class, CONTENT_URI = content:// +
   MyContentProvider.AUTHORITY + /key;
   In my ParticipantTable class CONTENT_URI = content:// +
   MyContentProvider.AUTHORITY + /participant;

   In my AndroidManifest.xml file I have registered the provider as:

   provider android:name=com.arpit.providers.MyContentProvider
           android:authorities=com.arpit.providers.MyContentProvider/
   provider

   Now I make the query call with the following statement in my
   HomeActivity:

   Cursor cursor = getContentResolver().query(KeyTable.CONTENT_URI, new
   String[] { KeyTable.col1 }, _id='1', null,  null);

   My problem is when the Query Method is called and the Switch block is
   executed the uriM.match returns always -1 (irrespective of whether it
   is KeyTable.CONTENT_URI or ParticipantTable.CONTENT_URI).

   Could you let me know what wrong am I doing because of which it is not
   working.

   From the note pad example I see during debug the only difference is
   they call managedQuery instead of getContentReslover().query(...). I
   tried firing managedQuery(...) in my HomeActivity class, but that also
   result in uriM.match(uri) to return -1.

   It will be great if you could help me out.

   Thanks  Regards,
   Arpit

   On Aug 25, 10:20 pm, A. Elk lancaster.dambust...@gmail.com 

Re: [android-developers] Re: Working Around Samsung Double-SD Problem

2010-09-10 Thread Kostya Vasilyev

 10.09.2010 18:46, Pent пишет:

(the usual rule with a mount point that has not
  been mounted).

The usual rule where ? Default linux it should be an empty directory.

So any solution to this is going to be extremely messy in other words.

In any case thanks for course for the info.

Pent

I believe so.

Just because some directory (e.g. /sdcard/sd) is listed in /etc/fstab 
(or whatever file Android uses) as a directory where something might be 
mounted in the future, doesn't mean that until then, this directory 
can't have any content.


Mounting a device at a directory location hides whatever was in that 
directory before (in the parent file system).


What I actually saw is that My Backup Pro writes its data to 
/sdcard/sd/rerware/., even though I don't have an external memory 
card in this phone.


--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.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


Re: [android-developers] Re: J2ME to Android

2010-09-10 Thread Kostya Vasilyev

 Don't know off hand, sorry.

Your code, however, appears to expect http protocol at least in one case 
out of the two:


streamCon = (HttpConnection) Connector.open(strURL, Connector.READ);

Note that cast to HttpConnection.

-- Kostya

10.09.2010 18:56, kypriakos пишет:

I found out that ConnectionNotFound exception thrown when opening a
stream-based socket could be thrown when the protocol indicated in
the Connection class is not supported - does Android support all
of the following?

http, comm, datagram, file, socket etc? I think yes but the exception
does not seem to make sense. Thanks.


On Sep 2, 11:58 pm, kypriakosdemet...@ece.neu.edu  wrote:

Hey Kostya,

are you referring to the apache http API included in Android? I will
give it
a shot. I downloaded and included the J2ME-polish that actually does
run
under Android but I am getting a Connection Not Found exception thrown
when I run that piece of code in the emulator. I can actually connect
to
the location using the browser directly so something is not getting
set
right in that config ...

Thanks

On Sep 1, 3:34 pm, Kostya Vasilyevkmans...@gmail.com  wrote: The code 
seems to be really simple, establishing an HTTP connection,

and getting raw streams for reading and writing.
Replace javax.microedition classes with those included with Android.
-- Kostya
01.09.2010 23:26, kypriakos пишет:

Hi all - trying this one again .. any ideas? If the Connector class
was not
created in the original Android Java, what else can be used in its
place?
3rd Party software or any other part of the API? Thanks.
On Aug 26, 4:47 pm, kypriakosdemet...@ece.neu.eduwrote:

I am pretty much trying to solve these issues:
  import javax.microedition.io.Connector;
  socketCon = (SocketConnection) Connector.open(strURL,
Connector.READ_WRITE);
and
  import javax.microedition.io.StreamConnection;
  streamCon = (SocketConnection) Connector.open(strURL,
Connector.READ);
  streamCon = (HttpConnection) Connector.open(strURL,
Connector.READ);
Any ideas would be greatly appreciated.
Thanks

--
Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com



--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.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: registerForContextMenu not working

2010-09-10 Thread Robert Nekic
Why do you say your context menu registration is failing?  It looks
like you are registering it OK but I don't see any code that creates
the context menu (onCreateContextMenu).  Check out the ContextMemnu
docs here:  http://developer.android.com/guide/topics/ui/menus.html




On Sep 10, 11:05 am, JasonMP hyperje...@gmail.com wrote:
 Hi everyone, My context menus are not registering when called.  In
 addition setOnItemClickListener is also not working.  Any ideas why
 this is happening?

 @Override
         public void onCreate(Bundle savedInstanceState) {
                   super.onCreate(savedInstanceState);
                   setContentView(R.layout.armory_header);

                   TabHost mTabHost = getTabHost();

 mTabHost.addTab(mTabHost.newTabSpec(1).setIndicator(Weapons).setContent 
 (R.id.page1));

 mTabHost.addTab(mTabHost.newTabSpec(2).setIndicator(Armor).setContent(R 
 .id.page2));

 mTabHost.addTab(mTabHost.newTabSpec(3).setIndicator(Accessories).setCon 
 tent(R.id.page3));

                   weapons = (ListView) findViewById(R.id.weaponlist);
                   registerForContextMenu(weapons);
                   weapons.setOnItemClickListener(new OnItemClickListener(){

                                 @Override
                                 public void onItemClick(AdapterView? arg0, 
 View arg1, int arg2,
                                                 long arg3) {
                                         // TODO Auto-generated method stub
                                         listId = weapons.getId();
                                         position = arg2;
                                         showDialog(DIALOG);
                                 }

                           });

                   armor = (ListView) findViewById(R.id.armorlist);
                   registerForContextMenu(armor);
                   armor.setOnItemClickListener(new OnItemClickListener(){

                                 @Override
                                 public void onItemClick(AdapterView? arg0, 
 View arg1, int arg2,
                                                 long arg3) {
                                         // TODO Auto-generated method stub
                                         listId = armor.getId();
                                         position = arg2;
                                         showDialog(DIALOG);
                                 }

                           });
         }

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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 maintain consistent UI over multiple versions of Android OS skinned by carriers and hardware manufacturers

2010-09-10 Thread NewB
thank you for the quick reply. I see the same dimension changes more
often in HTC sense that others. The rating bar seems more compact in
HTC sense than in stock skin or Samsung skin.
Just to note, sometimes even if the dimensions of the widget don't
change, the widget view appears cropped, i.e. missing a few pixels
from the start or end of it, depending on the padding/margin. I've
only noticed this on the rating bar which appears to have certain bugs
(based on other forums I've read).

On Sep 10, 1:15 am, Dianne Hackborn hack...@android.com wrote:
 Sorry, no, if you use platform widgets you will get widgets that match the
 platform.  That is generally what you want.

 That said, the *dimensions* of the widgets should not change.  If a
 manufacturer does that, they should fix it.





 On Thu, Sep 9, 2010 at 3:00 PM, NewB chait...@gmail.com wrote:
  Hello All!

  I would like to know if its possible to prevent my application from
  looking different every time I run it on a different android phone.
  For example, on stock 2.2, my seek bar (with default values and theme)
  has an orange color for the selected portion, whereas on a Samsung
  Galaxy S (with 2.1), it is green. Also the tab background is grey in
  stock 2.2, but blue in Galaxy S. On a similar note, my rating bar
  changes size too.

  I do not implement multiple screen resolutions and all my drawables
  are located in the drawables folder under res. I donot specify a
  minimum sdk requirement, and I

  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.comandroid-developers%2Bunsubs 
  cr...@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] problem with accented letters

2010-09-10 Thread Simone
I fill a TextView like this:

TextView instructions=(TextView)
findViewById(R.id.batteryInstructionsText);

try {
InputStream instrStr=res.openRawResource(R.raw.instructionsfile);
byte [] text=new byte[580];
int i=instrStr.read(text);
instructions.setText(new String(text).substring(0, i));
} catch (Exception e) {
instructions.setText(res.getString(R.string.instrerror));
}

The problem is that instead of accented letters (à, è, é, ù, ò..) a
question mark is displayed.
How can I solve this?
Simone

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] Adding native Binder service permission error when not root

2010-09-10 Thread masrepus
What is the best way to add a new native service that uses Binder and
can get past the service_manager.cpp restrictions on what users can
add services?

I have created a new native service that is similar to the
MediaPlayer. I make the addService() calls to add the Binder service
to the system. This worked fine when the service was started as root.

I moved the new service to be started as the media user. Then I
receive permission errors because of the table in service_manager.cpp
where there is a check for users and allowed Binder services.

Do I have to add my service to the table or is there some other way?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: AsyncTask and screen rotation

2010-09-10 Thread Bret Foreman
Yeah, Mark's option 1 looks like the best approach for my application.
Android should provide more infrastructure for this sort of thing
because async web services are becoming almost universal and they
always require something like this when they interact with the UI.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] problem with accented letters

2010-09-10 Thread Kostya Vasilyev

 Simone,

You are using a byte array to read your data. When converting a byte 
array to a String, you should specify encoding.


My guess is it's Western European, so you'd do:

new String(someByteArray, iso-8859-1)


Also your code tries to convert the entire byte array to String and then 
extracts a substring. You really should not pass garbage (unread) bytes 
at the end of the array to the String constructor. Convert just the 
bytes that actually came from the file:


byte[] byte_buffer = new byte[some length here, sufficient for read to succeed];

int actual_read = instrStr.read(byte_buffer);

String s = new String(byte_buffer, 0, actual_read, iso-8859-1);


-- Kostya

10.09.2010 19:48, Simone пишет:

I fill a TextView like this:

TextView instructions=(TextView)
findViewById(R.id.batteryInstructionsText);

try {
 InputStream instrStr=res.openRawResource(R.raw.instructionsfile);
 byte [] text=new byte[580];
 int i=instrStr.read(text);
 instructions.setText(new String(text).substring(0, i));
} catch (Exception e) {
 instructions.setText(res.getString(R.string.instrerror));
}

The problem is that instead of accented letters (à, è, é, ù, ò..) a
question mark is displayed.
How can I solve this?
Simone




--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.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: Monkey problems -- **URGENT HELP** --

2010-09-10 Thread DanH
 it's
 only validly urgent to the person posting and everyone else really doesn't
 give a damn.

Then why respond to anything?  Just so you can prove how smart you
are?

On Sep 10, 8:02 am, TreKing treking...@gmail.com wrote:
 On Fri, Sep 10, 2010 at 1:53 AM, Tez earlencefe...@gmail.com wrote:
  I hope this clears things.

 It explains why you feel you need help urgently - it does not explain why
 the rest of the people on this group would find it urgent to help you.
 That's a very important difference.

 Please understand I'm not trying to belittle the severity of your problem as
 it pertains to you - I'm trying to, very frankly, explain to you that this
 manner of posting hurts you more than it helps. I hope you can see that.

 On Fri, Sep 10, 2010 at 6:59 AM, DanH danhi...@ieee.org wrote:
  So in other words, it's only validly urgent if it interests YOU, and
  everyone must get clearance from YOU before labeling anything urgent.

 No. Please don't twist my words - read what I posted, not what you want to
 see. If you want to put what I said in other words, it's more like it's
 only validly urgent to the person posting and everyone else really doesn't
 give a damn. (Do YOU care about the OP's problem? What are YOU doing to
 help with his urgent problem?)

 The simple point is that labeling anything urgent doesn't help one get
 help - in fact it usually has the opposite effect.

 -
 TreKing http://sites.google.com/site/rezmobileapps/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] Libraries STILL not working

2010-09-10 Thread Robert Schmid
I was really excited today when I saw the Tools r7 and ADT 0.9.8 were
available and the latter had this note;

Fixes problems with handling of library project names that contain
characters that are incompatible with the Eclipse path variable. Now
properly sets up the link between the main project and the library
project.


Uh, no.

I create the library (foolib - no spaces, no caps, no punctuation).
So far so good.
I go to the main project, go to preferences -- Android.  In the
library box I add the new library.  It appears.  I press Apply. I
press OK.

Nothing happens.

I return to the preferences, the library is no longer there JUST LIKE
BEFORE.

Has anybody made this work?

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


[android-developers] How to use custom fonts all over your app

2010-09-10 Thread thilo.haged...@googlemail.com
Is there another way to use custom fonts than use setTypeface
directly on your view like in the following code lines?

typeface = Typeface.createFromAsset(context.getAssets(), fonts/
xyz.TTF);
textview.setTypeface(typeface);

The best way to use a custom font I can imagine is by setting it
globally in your theme style. But it seems to be impossible to define
your settings in xml.
To avoid an exessive usage of the findViewById method, which is also
told to be quite expensive, the next preferred way would be to
override your View classes and use them in your xml (reduces the
amount of java code).

I tried to override TextView and set the font in the constructor. This
is working quite good but textstyles like bold or italic got lost
this way although I tried to keep it by mappig the constructor
Parameter AttributeSet attr by setTypeface(typeface,
attr.textStyle); or by overriding the method setTypeface (Typeface
tf); by setTypeface(typeface, tf.getStyle());
That was not working.

So has somebody figured out a way to solve this issue? 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] Re: AsyncTask doesn't run sometimes despite state returning RUNNING?

2010-09-10 Thread Donal Rafferty
Is that possible?

I have a bind between my Service and the Activity at the minute but when I
try to change to aidl file to allow me pass the RingTone object it wont
compile for me, saying RingTone and com.android.RingTone cannot be
resolved/found

On Fri, Sep 10, 2010 at 1:34 PM, Federico Paolinelli fedep...@gmail.comwrote:

 One way I would try is to bind your activity to the service and give
 the service a callback to be called when you asynctask has finished
 its dirty job. (I've never done this, but it may work).
 You can provide your ringtone object as argument of the callback.



 On 10 Set, 13:38, Donal Rafferty draf...@gmail.com wrote:
  Excellent idea Federico, However my AsyncTask fetches a RingTone object
  (com.android.RingTone) and I have no way of passing this object from my
  Service to my Activity?
 
  On Fri, Sep 10, 2010 at 11:36 AM, Federico Paolinelli 
 fedep...@gmail.comwrote:
 
   You could probably move the async task to a service, and broadcast all
   your stuff when you finish.
   If your activity listens for the broadcast, it won't matter if the
   activity itself started the service, or if it was started by another
   activity (of the same kind).
 
   Federico
 
   On Sep 10, 12:14 pm, Donal Rafferty draf...@gmail.com wrote:
Thanks for that Shawn, but I'm looking for a solution that doesn't
   involve
external libraries.
 
On Fri, Sep 10, 2010 at 10:45 AM, Shawn Brown 
   big.coffee.lo...@gmail.comwrote:
 
  Has anybody got any idea why this would be happening?
 
 Well...  from

 http://brainflush.wordpress.com/2009/11/16/introducing-droid-fu-for-a.
   ..
 
 So the basic idea is: launch an AsyncTask making your service call,
 show a nifty progress dialog while the task thread is running, and
 have the task’s result be posted back to your activity once it
 completes. Cool, but what if the user decides to rotate the screen
 while your task is running? Or a phone call comes in, interrupting
 your app, and Android decides to kill it? Both these actions will
 effectively terminateyour activity, and recreate it when resuming
 (yes, a screen rotation kills your activity, very clever, isn’t
 it?).
 Unfortunately, any AsyncTask that was still running now holds a
 stale
 reference to your activity, because the restarted activity will be
 an
 entirely different object in memory (and it will go through
 onCreate(), as if the activity had started for the first time). I’m
 not entirely sure whether AsyncTask will actually post back the
 data
 to the old activity object (if it was a weak reference, it may
 already
 have been garbage collected), but in any case, your “new” activity
 will never see it, because it’s a different instance.
 
 Now, one could argue: well, just do all the work again, like,
 re-send
 the request or whatever job was running. Yes, you could do that.
 But
 that’s wasteful and, really, makes you feel stupid, no? Plus, if
 the
 user triggers a web service request, then flips the screen, decides
 that this wasn’t helpful, and flips it back, then your request is
 being sent 3 times in parallel. Is that what you want? Probably
 not.
 
 BetterAsyncTask to the Rescue
 
 Thanks to Droid-Fu, there’s a solution to this: BetterAsyncTask!
 (I’m
 a lazy person, and I couldn’t come up with a better name). It
 behaves
 exactly like AsyncTask (in fact, it is an AsyncTask), but it does
 some
 extra work for you: first and foremost, it keeps track of the
 active
 instance of the context that launched it, and if that instance
 should
 change, it will post the data back to the new instance. In other
 words, you can dispatch your task, flip the screen back and forth
 mentally, and BetterAsyncTask will still post the task’s result
 back
 to whatever activity instance is alive at the time it finishes. In
 other words, the task is only ever run once, regardless whether the
 context in which it was launched died while it was running or not.
 
http://github.com/kaeppler/droid-fu
 
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to
   android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@googlegroups.com
 
   android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@googlegroups.com
 android-developers%252bunsubscr...@googlegroups.comandroid-developers%25252bunsubscr...@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 

[android-developers] info

2010-09-10 Thread dashman

can a kind soul point me to a documentation
on valid layout attribute key and values.

specifically - valid values for e.g. android:paddingRight etc

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


[android-developers] Re: problem with accented letters

2010-09-10 Thread Simone
Thank you so much, that helped a lot.
The substring() call was just temporary, but thanks anyway ;)
Simone
p.s. the language was Italian :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


RE: [android-developers] Widget Layout Help Please

2010-09-10 Thread Tommy
O SNAP!! Im an idiot I forgot about the app widget provider XML file.I
left the width/height the same from the tutorial 150 x 150 lol 

 

spasiba my friend

 

From: android-developers@googlegroups.com
[mailto:android-develop...@googlegroups.com] On Behalf Of Kostya Vasilyev
Sent: Friday, September 10, 2010 4:32 AM
To: android-developers@googlegroups.com
Subject: Re: [android-developers] Widget Layout Help Please

 

If your widget is too large, check these:

- Android UI guidelines has standard widget sizes, as well as shows the grid
on which widgets are laid out:

http://developer.android.com/guide/practices/ui_guidelines/widget_design.htm
l#sizes

- Check your appwidget-provider XML file (usually
res/xml/widget_info.xml), specifically, android:minWidth and
android:minHeight. I use 70dp and 72dp for these, but my widgets are a
little larger than the standard ones (trying to match HTC Sense), although
they still fit the standard grid.

- Check the widget's layout file, specifically, its width and height. If
necessary, specify explicit width and height to match the
appwidget-provider and a solid background color to see which elements of
your widget layout do not fit.

-- Kostya

10.09.2010 7:36, Tommy Hartz пишет: 

Right I under stand that its a grid layout but my Icon is taking up 2 - 3
grid spacesHTC Aria shows you the grid space and mine is massive

2010/9/9 Kostya Vasilyev kmans...@gmail.com

Home screen Widgets are laid out on a grid, so no matter how compact you
make your layout, it won't get any closer to other widgets.

Also, you should not be using pixel dimensions in the layout - use
device-independent do units.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

09.09.2010 23:42 пользователь Tommy droi...@gmail.com написал: 



Hi everyone,

I am trying to make a widget to show on the home screen(s). My problem
is lets say I set my icon to 30x30 when I load the widget on the
screen the Icon is the correct size BUT the layout itself takes up a
lot more space than what is actually needed. This means that I can't
really place my widget next to other icons on the screen. Its like the
bounding box is 3 times bigger than the content that fills it. How do
I fix this? Here is my XML

?xml version=1.0 encoding=utf-8?
RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
android
   android:id=@+id/widget
   android:layout_width=30px
   android:layout_height=30px
   android:focusable=true

   
   ImageView android:id=@+id/widgWeatherIcon
   android:layout_width=30px
   android:layout_height=30px
   android:src=@drawable/asdf_widgettester


   
   /ImageView
   TextView android:id=@+id/widgCurrTemp
   android:layout_width=wrap_content
   android:layout_height=wrap_content
   android:text=100
   android:layout_below=@id/widgWeatherIcon
   /TextView
/RelativeLayout


I have tried wrap_content and other width/height settings but nothing
seems to reduce the Box around my widget content. Im super
confused. I clicked on my ATK widget and started to drag it around on
my HTC Aria and it shows the bounding box around the widget and that
one is the same size of the content inside same with all the other
widgets on my screens.

Thanks so much for the help and advice!

Tommy

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
mailto:android-developers%2bunsubscr...@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
mailto:android-developers%2bunsubscr...@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 






-- 
Kostya Vasilyev -- WiFi Manager + pretty widget --
http://kmansoft.wordpress.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

-- 
You received this message 

Re: [android-developers] info

2010-09-10 Thread Mark Murphy
On Fri, Sep 10, 2010 at 12:36 PM, dashman erjdri...@gmail.com wrote:
 can a kind soul point me to a documentation
 on valid layout attribute key and values.

 specifically - valid values for e.g. android:paddingRight etc

Generally, they are in the documentation for the class. So,
paddingRight is a property on all views, so you will find it in
android.view.View:

http://developer.android.com/reference/android/view/View.html#attr_android:paddingRight

In the specific case of paddingRight, that takes a dimension, either
inline (e.g., 20dip) or as a dimension resource:

http://developer.android.com/guide/topics/resources/more-resources.html#Dimension

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

Android Training in London: http://skillsmatter.com/go/os-mobile-server

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: AsyncTask doesn't run sometimes despite state returning RUNNING?

2010-09-10 Thread Mark Murphy
On Fri, Sep 10, 2010 at 12:28 PM, Donal Rafferty draf...@gmail.com wrote:
 Is that possible?

 I have a bind between my Service and the Activity at the minute but when I
 try to change to aidl file to allow me pass the RingTone object it wont
 compile for me, saying RingTone and com.android.RingTone cannot be
 resolved/found

Try android.media.Ringtone.

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

Android Training in London: http://skillsmatter.com/go/os-mobile-server

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: AsyncTask and screen rotation

2010-09-10 Thread Romain Guy
Option #1 is a lot more intrusive. You lose the ability to
automatically switch layouts, drawables, etc. It might be fine now but
it might come back to bite you in the future. It should always be your
last resort. Saving and restoring an AsyncTask is not difficult.

On Fri, Sep 10, 2010 at 8:56 AM, Bret Foreman bret.fore...@gmail.com wrote:
 Yeah, Mark's option 1 looks like the best approach for my application.
 Android should provide more infrastructure for this sort of thing
 because async web services are becoming almost universal and they
 always require something like this when they interact with the UI.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To 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




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

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

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


Re: [android-developers] Re: AsyncTask and screen rotation

2010-09-10 Thread Dianne Hackborn
On Fri, Sep 10, 2010 at 9:46 AM, Romain Guy romain...@android.com wrote:

 Option #1 is a lot more intrusive. You lose the ability to
 automatically switch layouts, drawables, etc. It might be fine now but
 it might come back to bite you in the future. It should always be your
 last resort. Saving and restoring an AsyncTask is not difficult.


For example, I was just answering a StackOverflow question where someone's
app was breaking when the device was inserted into a dock, because in 2.2
there is a new dock configuration that changes at that point.

You should *always* write your app to work correctly across a
destroy/create.  android:configChanges is only for optimization of certain
very special cases; it is not an excuse to have a broken app.

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

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

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

Re: [android-developers] Adding native Binder service permission error when not root

2010-09-10 Thread Dianne Hackborn
This is not available to either the SDK or NDK.  The question would be
better asked on android-porting or android-platform.

On Fri, Sep 10, 2010 at 8:53 AM, masrepus sha...@gmail.com wrote:

 What is the best way to add a new native service that uses Binder and
 can get past the service_manager.cpp restrictions on what users can
 add services?

 I have created a new native service that is similar to the
 MediaPlayer. I make the addService() calls to add the Binder service
 to the system. This worked fine when the service was started as root.

 I moved the new service to be started as the media user. Then I
 receive permission errors because of the table in service_manager.cpp
 where there is a check for users and allowed Binder services.

 Do I have to add my service to the table or is there some other way?

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




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

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

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

[android-developers] AudioManager request/abandon focus messages

2010-09-10 Thread Steve Hugg
We have an app which requests and abandons audio focus several times
over the course of its lifetime. When the process exits, these
messages appear several (30+) times in the log:

W/AudioService( 1086):   AudioFocus   audio focus client died
W/AudioService( 1086):   AudioFocus   audio focus client died
W/AudioService( 1086):   AudioFocus   audio focus client died
...

We are just using requestAudioFocus() and abandonAudioFocus() with a
single listener object and as far as I can tell the calls are paired
up properly. It seems from the AudioService code that a new
AudioFocusDeathHandler is created for each call, will this lead to
memory leaks or other problems or is this benign?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: AsyncTask and screen rotation

2010-09-10 Thread Maps.Huge.Info (Maps API Guru)
 Option #1 is a lot more intrusive. You lose the ability to
 automatically switch layouts, drawables, etc. It might be fine now but
 it might come back to bite you in the future. It should always be your
 last resort. Saving and restoring an AsyncTask is not difficult.


What if that AsyncTask is downloading a file? Interrupting it,
regardless of how nicely done, would be a bad thing wouldn't it?

-John Coryat

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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] EditText in a simple Activity

2010-09-10 Thread Simone
I've got a simple activity layout wich contains a couple of EditText
elements.
Everything works ok, but the only problem is that when I open this
activity, the Android keyboard is opened automatically as well, ready
to take input for the first of the two EditTexts.
Is there a way to avoid this?
Thanks,
Simone

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: AsyncTask doesn't run sometimes despite state returning RUNNING?

2010-09-10 Thread Donal Rafferty
No luck :(

---

package com.xxx.phone.ui;

import android.media.Ringtone;

interface ICallDialogActivity{
void sendRingTone(in RingTone aRingTone);
}

---

I get the red x beside the import and coundn't find import for class
android.media.Ringtone;

On Fri, Sep 10, 2010 at 5:45 PM, Mark Murphy mmur...@commonsware.comwrote:

 On Fri, Sep 10, 2010 at 12:28 PM, Donal Rafferty draf...@gmail.com
 wrote:
  Is that possible?
 
  I have a bind between my Service and the Activity at the minute but when
 I
  try to change to aidl file to allow me pass the RingTone object it wont
  compile for me, saying RingTone and com.android.RingTone cannot be
  resolved/found

 Try android.media.Ringtone.

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

 Android Training in London: http://skillsmatter.com/go/os-mobile-server

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


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To 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: AsyncTask and screen rotation

2010-09-10 Thread Mark Murphy
On Fri, Sep 10, 2010 at 12:46 PM, Romain Guy romain...@android.com wrote:
 Option #1 is a lot more intrusive. You lose the ability to
 automatically switch layouts, drawables, etc.

Worst-case scenario:

Step #1: Take your UI setup that is in onCreate() and move it to a
separate method (e.g., setupViews())

Step #2: Call setupViews() from onCreate()

Step #3: Call setupViews() from onConfigurationChanged()

Done. ~4 lines of code. And it's the exact same code path that a
destroy/recreate will go down, so it's not like this adds unusual
performance overhead. There are certain circumstances where this may
not work (e.g., GLSurfaceView and a game), but you needed to do extra
work for those cases, anyway, to handle the destroy/recreate cycle.

 Saving and restoring an AsyncTask is not difficult.

No, it's not. The question is: is it reliable?

None of the AsyncTask documentation (class, article, etc.) covers this
case. It *appears* that you can write an AsyncTask such that
onPostExecute() or onProgressUpdate() will not be called in the middle
of the activity transition. However, that's not documented and hence
not guaranteed, and so while I'll describe a pattern that seems to
work, I personally don't trust it any further than I can throw your
large Froyo lawn ornament. If somebody could give us the recipe that
is guaranteed to work (i.e., works today, and is going to work in
Android 2.3/3.0/Turbo System 5000), that'd be *wonderful*.

Actually, I lied earlier. I'd choose Option #4:

Option #4: Don't do the AsyncTask in an activity. Use a Service and
have it do the AsyncTask, or use an IntentService if the sole purpose
of the service is to do stuff in a background thread. In particular,
an IntentService would be good for a download that you want to happen
regardless of what may go on with an activity (e.g., Android Market
downloading an APK), and so you don't need to worry about canceling
it.

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

Android Training in London: http://skillsmatter.com/go/os-mobile-server

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


[android-developers] How to zoom in/out image with webkit

2010-09-10 Thread Ghetto Bill Gates
I have an app where its a website wrapped with webview/webkit but when
I load images via linkes, you can use basic functions to zoom in/out.
I thought this was standard throughout  using Android?

http://pastie.org/1144392

Thanks

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


Re: [android-developers] Re: AsyncTask and screen rotation

2010-09-10 Thread Dianne Hackborn
On Fri, Sep 10, 2010 at 9:53 AM, Maps.Huge.Info (Maps API Guru) 
cor...@gmail.com wrote:

 What if that AsyncTask is downloading a file? Interrupting it,
 regardless of how nicely done, would be a bad thing wouldn't it?


You don't need to interrupt it.  See Mark's option 2.  Just don't have it
tied to a specific activity instance.

If you want to have it associated logically with the activity, you can use
onRetainNonInstanceState() to transfer it between instances.  (Though this
is intended as an optimization, and if you rely on this then you likely
won't get the proper semantics in other cases -- for example if the user
leaves your app and returns to it later it could easily get killed while in
the background and thus lose the active download.  In fact you would also
have this same problem if you use android:configChanges for many of the same
reasons.)

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

  1   2   3   >