Re: [android-developers] Does all Android Devices support Map API

2010-08-07 Thread Alex Xin
The answer is NO.

For example, Lenovo LePhone is an Android 1.6 based device, but it doesn't
support any of Google APIs, it even doesn't support Google search, the
default search engine on this phone is Baidu not Google, you cannot install
GTalk/GMail/Market and other Google apps on this phone.

On Tue, Aug 3, 2010 at 12:06 PM, Jingwen Xiong jeanie_...@hotmail.comwrote:

 Hi all,

 I am currently developing an android application that uses android
 google map API.
 I am wondering does all android devices support this add-on api??
 If not, how could I detect wheter the device support or doesn't
 support map API programatically.

 Any comments and suggestion are welcome.

 Thanks very much!

 Jingwen

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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] Please help! Hebrew support on Motorola Milestone XT701 and other devices

2010-08-07 Thread EvgenyV
Hi all,

I want to develop aplication supports hebrew font.
Does anyone know how to install hebrew fonts my android as development
phone? And also how make the application displaying hebrew properly on
other devices?

Thanks in advance,
Evgeny

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Does all Android Devices support Map API

2010-08-07 Thread Dianne Hackborn
Once a device doesn't have Market on it, any and all bets are off.  Android
is open source.  People can do anything in the world they want with it and
nobody can stop them.  There are, however, strict compatibility requirements
in order to be able to include Market.  That said, including Google's maps
API is not one of those requirements...  on the other hand, if a
manufacturer is taking the step of getting Market on their device, not at
that point also including maps should be pretty unusual.

On Fri, Aug 6, 2010 at 11:24 PM, Alex Xin xinxi...@gmail.com wrote:

 The answer is NO.

 For example, Lenovo LePhone is an Android 1.6 based device, but it doesn't
 support any of Google APIs, it even doesn't support Google search, the
 default search engine on this phone is Baidu not Google, you cannot install
 GTalk/GMail/Market and other Google apps on this phone.


 On Tue, Aug 3, 2010 at 12:06 PM, Jingwen Xiong jeanie_...@hotmail.comwrote:

 Hi all,

 I am currently developing an android application that uses android
 google map API.
 I am wondering does all android devices support this add-on api??
 If not, how could I detect wheter the device support or doesn't
 support map API programatically.

 Any comments and suggestion are welcome.

 Thanks very much!

 Jingwen

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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.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] Call to onDestroy() method of Service does not take place immediately from inside Activity

2010-08-07 Thread Dianne Hackborn
If nothing else, your thread needs to return to the event loop for it to be
able to dispatch the next operation to do -- which may be to call
onDestroy() of the service.  You definitely don't want the framework
callings these things from arbitrary random points within your own calls to
the framework.

On Fri, Aug 6, 2010 at 5:04 PM, TreKing treking...@gmail.com wrote:

 On Fri, Aug 6, 2010 at 6:18 PM, Rajesh Bachani 
 rajesh.bach...@gmail.comwrote:

 Now when I call the stopService() method from A, the onDestroy() method in
 S is not called immediately.


 The doc for stopServices says: Request that a given application service
 be stopped. Key words being request and stopped.

 From the Service doc:

 A service can be both started and have connections bound to it. In such a
 case, the system will keep the service running as long as either it is
 started or there are one or more connections to it with the
 Context.BIND_AUTO_CREATEhttp://developer.android.com/reference/android/content/Context.html#BIND_AUTO_CREATE
  flag.
 Once neither of these situations hold, the service's 
 onDestroy()http://developer.android.com/reference/android/app/Service.html#onDestroy()
  method
 is called and the service is effectively terminated.


 My understanding: You're asking the system to stop the service, not to
 destroy it. That will happen automatically, later, when it determines the
 Service is no longer being used. For example, you could have another
 activity that is bound to the service, so although it can be stopped, it
 wouldn't be destroyed.

 Why is this causing you a problem?


 -
 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.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] Can't make restartPackage() / killBackgroundProcesses() to work

2010-08-07 Thread Fabrizio Giudici

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello.

I'm trying to have restartPackage() work - please note that I'm aware
of all the discussions related to APIs for restarting another
application; I'm not trying to do this in production, but during
functional tests in order to be sure to have the application under
test to start clean every time (without it, I'm currently forced to
run one functional test at a time with adb, which is an annoyance). I
know that restartPackage() has been deprecated in 2.2 and now is
equivalent to   killBackgroundProcesses(), which is perfectly fine for
me.

This is the code I'm trying (from setUp() of an
ActivityInstrumentationTestCase2):

private void resetApplication()
  {
logger.info( RESTARTING APP);
final Context context = getInstrumentation().getContext(); //
also tried with getTargetContext(), even though I suppose getContext()
is correct
final ActivityManager manager =
(ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
manager.restartPackage(it.tidalwave.bluebill.mobile.android);
  }

but I constantly get:

W/ActivityManager( 1280): Permission Denial: restartPackage() from
pid=6014, uid=10071 requires android.permission.RESTART_PACKAGES
I/TestRunner( 6014): failed:
testRun(it.tidalwave.bluebill.mobile.android.test.functional.InsertOneObservationFromScratch)
I/TestRunner( 6014): - begin exception -
I/TestRunner( 6014):
I/TestRunner( 6014): java.lang.SecurityException: Permission Denial:
restartPackage() from pid=6014, uid=10071 requires
android.permission.RESTART_PACKAGES
I/TestRunner( 6014): at
android.os.Parcel.readException(Parcel.java:1218)
I/TestRunner( 6014): at
android.os.Parcel.readException(Parcel.java:1206)
I/TestRunner( 6014): at
android.app.ActivityManagerProxy.restartPackage(ActivityManagerNative.java:2383)
I/TestRunner( 6014): at
android.app.ActivityManager.restartPackage(ActivityManager.java:910)
I/TestRunner( 6014): at
it.tidalwave.bluebill.mobile.android.ScenarioTestSupport.resetApplication(ScenarioTestSupport.java:183)
I/TestRunner( 6014): at
it.tidalwave.bluebill.mobile.android.ScenarioTestSupport.setUp(ScenarioTestSupport.java:87)
I/TestRunner( 6014): at
it.tidalwave.bluebill.mobile.android.test.functional.ObservationScenarioTestSupport.setUp(ObservationScenarioTestSupport.java:48)
I/TestRunner( 6014): at
junit.framework.TestCase.runBare(TestCase.java:125)
I/TestRunner( 6014): at
junit.framework.TestResult$1.protect(TestResult.java:106)
I/TestRunner( 6014): at
junit.framework.TestResult.runProtected(TestResult.java:124)
I/TestRunner( 6014): at
junit.framework.TestResult.run(TestResult.java:109)
I/TestRunner( 6014): at
junit.framework.TestCase.run(TestCase.java:118)
I/TestRunner( 6014): at
android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
I/TestRunner( 6014): at
android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
I/TestRunner( 6014): at
android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:430)
I/TestRunner( 6014): at
android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)
I/TestRunner( 6014): - end exception -


Of course I put the required permission in the AndroidManifest.xml:

?xml version=1.0 encoding=UTF-8?
manifest package=it.tidalwave.bluebill.mobile.android.tests
android:versionCode=1545
xmlns:android=http://schemas.android.com/apk/res/android;
android:versionName=0.14.0-SNAPSHOT
  uses-sdk android:minSdkVersion=3/
  uses-permission android:name=android.permission.INJECT_EVENT/
  uses-permission android:name=android.permission.RESTART_PACKAGES/
  application android:label=blueBill Mobile Functional Tests
uses-library android:name=android.test.runner/
  /application
  instrumentation
android:name=android.test.InstrumentationTestRunner
android:targetPackage=it.tidalwave.bluebill.mobile.android
android:label=Tests for blueBill Mobile for Android./
/manifest

The app with tests is signed with the same signature of the app under
test (the debug key). It happens both with the emulator (1.5 and 2.2)
and a Motorola Droid (2.1). Of course the 2.2 with the variant that
the required permission is android.permission.KILL_BACKGROUND_PROCESSES.


Why am I still getting the error? Thanks.

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

iEYEARECAAYFAkxdDr4ACgkQeDweFqgUGxcRFgCgkkyp8VcxyqPCfUkqs7U6HQ5R
s5YAn3V2dETNVU7Lga6vHhf7JQB1WQEm
=kRZ5
-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 

Re: [android-developers] Re: eclipse HELIOS (3.6) Code Assist very slow

2010-08-07 Thread Tauno Talimaa
It's super slow for me also - sometimes the content assist window will 
hang for up to ~30s (in Eclipse 3.5, it takes just a few hundred ms max) 
meaning that 3.6 is not usable for Android development at the moment (if 
there are no workarounds..).
I've found the following bug for Eclipse regarding this: 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=317979 but I have no idea 
if it's an Eclipse bug or an ADT  bug that just happens to be triggered 
by Eclipse 3.6 for some reason. Maybe Xavier wants to enlighten us ? :)



On 7.08.2010 2:16, Zsolt Vasvari wrote:

This happens with me also, only sometimes.  I don't know if this is
Helios or the Android stuff, but developing with Helios has more
nagging issues than Galileo has.

On Aug 6, 10:00 pm, Evan Ruffevan.r...@gmail.com  wrote:
   

After upgrading to Helios, my code assist is dog slow as well.

I am currently experimenting with the location of Eclipse (was on D,
moving to C) as well as the memory args...

E

On Jul 8, 7:27 am, gDevsab...@gmail.com  wrote:



 

CodeAssistveryslow
   
 

any soluation for that?- 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] Html data parsing

2010-08-07 Thread Andy Best
Hi guys suddenly I have no experience with java and html parsing and I
really need it...(possibly from 
http://www.uefa.com/teamsandplayers/teams/club=52280/domestic/index.html)

I want a simple way to convert an html website to xml
document(fetch,convert,parse) or an easy alternative way to do it...

ps:if you know any alternative FREE resource of football(soccer) data
tell it...

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


[android-developers] unable to playback dumped h264 stream

2010-08-07 Thread paul linto
Hi All,

Can you please help me on some doubts regarding h264 encoder header.

I am trying to dump h264 encoded bitstream to a file(video recording
usecase). I had added the code for the file dump in the OMX FillBufferDone
() callback.
[Fillbufferdoneprocessing() function in pvmf_omx_enc_node.cpp]
 In the dump, what I observed is that the start code is not present and I
think the SPS and PPS sequences are getting dumped. I am unable to playback
the dumped stream. I am using 'ffplay' player.

Do i need to dump the header info seperately..?or else what could be the
problem ..?

Regards,
Linto

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Application icon for wallpapers missing

2010-08-07 Thread Peter Webb
When I fire up an emulator using Eclipse and have a look at live
wallpapers, the two default wallpapers - Cube and Cube Resources -
show as grayed-out icons that look like the image is missing.

The wallpaper I have written is exactly the same, the proper image
doesn't show. Doesn't work on my phone either.

Howeever, if I go into manage services in the settings screen in the
emulator, the proper icon is showing. Its showing as the service icon
but not the application icon.

Ive got:

application
android:label=@string/wallpapers
android:debuggable=true android:icon=@drawable/foo

with foo.pmg, foo.jpg in drawable all being accepted by the IDE but
not showing as the application icon.

As I say, the default cube live wallpaper doesn't show its correct
icon either - I downloaded the source and recompiled, same thing.

Any ideas?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: License Verification Library: ServerManagedPolicy, no connectivity = dontAllow?

2010-08-07 Thread String
On Aug 7, 12:04 am, Trevor Johns tjo...@google.com wrote:

 You're probably seeing that because you're using a test response. The server
 sends a policy for test responses that disables caching.

Ah, that makes sense. Retesting the scenario with an ordinary account
(not in my profile's test list), I do get a cached allow when
offline. Thanks for clearing that up.

Might be nice if that was documented somewhere. Also, FWIW, it's
somewhat problematic that test responses don't behave like real
responses... Given that a dev can't purchase their own app, it makes
it difficult to test the behavior of real responses.

String

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: License Verification Library: ServerManagedPolicy, no connectivity = dontAllow?

2010-08-07 Thread String
On Aug 6, 9:55 pm, BoD bodl...@gmail.com wrote:

 Isn't it strange that if the device is offline, this gives the same
 reply as if the application is not authorized?!
 And the code can't distinct these two cases?

The Policy code does get distinct responses, it just boils it down to
either allow or disallow before it gets to your callback. If the
device is offline, and no response has been cached, it's really a
matter of opinion if that user should be allowed or not. My opinion is
that disallow makes sense in this case.

String

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: License Verification Library: ServerManagedPolicy, no connectivity = dontAllow?

2010-08-07 Thread BoD
Thanks a lot for your reply.
I'm going to implement my own Policy then.
Issue starred.

BoD


On Aug 7, 1:03 am, Trevor Johns tjo...@google.com wrote:
 Yes, with the default policy implementations, this is what happens.

 You can write a custom policy that behaves differently if you want, but we
 currently don't provide any indicator to the application as to the cause of
 the license failure.

 Probably a good thing, I opened a feature request for you 
 here:http://code.google.com/p/marketlicensing/issues/detail?id=12

 For now, the recommend behavior is to just have a retry button when the
 license check fails.

 --
 Trevor Johns
 Google Developer Programs, Androidhttp://developer.android.com

 On Fri, Aug 6, 2010 at 1:55 PM, BoD bodl...@gmail.com wrote:
  Isn't it strange that if the device is offline, this gives the same
  reply as if the application is not authorized?!
  And the code can't distinct these two cases?

  In effect I don't see how you are supposed to use this policy. If you
  receive dontAllow the first time, what are you supposed to do?

  BoD

  On Aug 6, 6:32 pm, String sterling.ud...@googlemail.com wrote:
   My experience so far is the same. It's not what's described in the
   docs: ServerManagedPolicy is a flexible Policy that uses settings
   provided by the licensing server to manage response caching and access
   to the application while the device is offline (such as when the user
   is on an airplane).

   I can see why the initial license check would return disallowed if
   the device is offline. But after a successful check, my understanding
   is that the result be cached for a while, producing an allowed
   response. Which isn't what I'm seeing either.

   String

   On Aug 5, 11:18 pm, BoD bodl...@gmail.com wrote:

Hi,

I'm still experimenting with the LVL and I noticed that, with the
recommended strategy (ServerManagedPolicy), in case of no
connectivity, the callback's dontAllow() method is called.

This seems a bit odd to me and I wanted to make sure this is the
expected behavior, and not a bug on my side.

Thanks a lot for your help,

BoD

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  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: License Verification Library: ServerManagedPolicy, no connectivity = dontAllow?

2010-08-07 Thread BoD
Ok I understand now.
Maybe this behavior should be made a bit more explicit in the
documentation since this is the recommended policy and I guess most
developers will use it without trying to implement their own -
resulting in false negatives for the users.

Thanks,

BoD

On Aug 7, 1:25 pm, String sterling.ud...@googlemail.com wrote:
 On Aug 6, 9:55 pm, BoD bodl...@gmail.com wrote:

  Isn't it strange that if the device is offline, this gives the same
  reply as if the application is not authorized?!
  And the code can't distinct these two cases?

 The Policy code does get distinct responses, it just boils it down to
 either allow or disallow before it gets to your callback. If the
 device is offline, and no response has been cached, it's really a
 matter of opinion if that user should be allowed or not. My opinion is
 that disallow makes sense in this case.

 String

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Call to onDestroy() method of Service does not take place immediately from inside Activity

2010-08-07 Thread Rajesh Bachani
Hi TreKing and Dianne,
Thanks for the responses.

What I really need is to get some data back from the Service, once the
stopService() is called. SharedPreferences is being used for this.

I am updating the data from Service only in the onDestroy().

So, before I call stopService() - then maybe I can throw an Intent
object, with some parameter asking the service to return the data
right now. And then the stopService() can be called.

I guess I thought onDestroy() is called when the service stops. But I
am wrong clearly.
But, if there was a method in the Service itself - like onStop() -
wouldn't that add more value ?

Thanks,
Rajesh.

Dianne Hackborn wrote:
 If nothing else, your thread needs to return to the event loop for it to be
 able to dispatch the next operation to do -- which may be to call
 onDestroy() of the service.  You definitely don't want the framework
 callings these things from arbitrary random points within your own calls to
 the framework.

 On Fri, Aug 6, 2010 at 5:04 PM, TreKing treking...@gmail.com wrote:

  On Fri, Aug 6, 2010 at 6:18 PM, Rajesh Bachani 
  rajesh.bach...@gmail.comwrote:
 
  Now when I call the stopService() method from A, the onDestroy() method in
  S is not called immediately.
 
 
  The doc for stopServices says: Request that a given application service
  be stopped. Key words being request and stopped.
 
  From the Service doc:
 
  A service can be both started and have connections bound to it. In such a
  case, the system will keep the service running as long as either it is
  started or there are one or more connections to it with the
  Context.BIND_AUTO_CREATEhttp://developer.android.com/reference/android/content/Context.html#BIND_AUTO_CREATE
   flag.
  Once neither of these situations hold, the service's 
  onDestroy()http://developer.android.com/reference/android/app/Service.html#onDestroy()
   method
  is called and the service is effectively terminated.
 
 
  My understanding: You're asking the system to stop the service, not to
  destroy it. That will happen automatically, later, when it determines the
  Service is no longer being used. For example, you could have another
  activity that is bound to the service, so although it can be stopped, it
  wouldn't be destroyed.
 
  Why is this causing you a problem?
 
 
  -
  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.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] PV MediaRecorder native video recording error

2010-08-07 Thread Kerr
Dear PV engineer:
I have try several days for this. We want to add video conference
function in PV opencore, so we need to create video capture node in
native mode, I try the following code to capture video,  My code is
like this:
   spSurfaceComposerClient videoClient = new SurfaceComposerClient;
   SurfaceComposerClient* videoClient2 = videoClient.get();

   int x = atoi(argv[2]);
   int y = atoi(argv[3]);
// printf(press any key to do after new SurfaceComposerClient
\n);
// getchar();

   spSurfaceControl vsurCtrl(videoClient-createSurface(pid, 0, x,
y, PIXEL_FORMAT_OPAQUE, ISurfaceComposer::eFXSurfaceNormal|
ISurfaceComposer::ePushBuffers));
   SurfaceControl* vsurCtrl2 = vsurCtrl.get();
   videoClient-openTransaction();
   nState = vsurCtrl-setSize(x, y);
   nState = vsurCtrl-setPosition(10, 10);
   nState = vsurCtrl-setLayer(INT_MAX);
   nState = vsurCtrl-show();
   videoClient-closeTransaction();

   mRecorder = new PVMediaRecorder();
   mRecorder-init();
   mRecorder-setAudioSource(AUDIO_SOURCE_CAMCORDER);
   mRecorder-setVideoSource(VIDEO_SOURCE_CAMERA);
   //sleep(1);
   mRecorder-setOutputFormat(OUTPUT_FORMAT_THREE_GPP);

   /
   mRecorder-setAudioEncoder(AUDIO_ENCODER_AMR_NB);
   mRecorder-setVideoEncoder(VIDEO_ENCODER_H263);
   mRecorder-setVideoSize(x, y);
   mRecorder-setVideoFrameRate(10);

   mRecorder-setOutputFile(argv[1]);
   mRecorder-setPreviewSurface(vsurCtrl-getSurface()-
getISurface2());

   status_t retCode = mRecorder-prepare();

   if(retCode  0)
   {
   printf(prepare failed: %d\n, retCode);
   IPCThreadState::self()-stopProcess();
   return -1;
   };

   printf(press any key to start\n);
   getchar();
   mRecorder-start();

sleep(10);
mRecorder-stop();
mRecorder-reset();
//videoClient-destroySurface(vsurCtrl-getSurface()-ID());
videoClient-dispose();

Could anyone give me some guide on this?

Regards!




the result is
1, when run after prepare(), the screen could see preview movie,
everything seems well.
2, but when run start(), the surface created freeze.
3, after stop, I check the recorded file, there is only audio, no
video.
4, from the logcat, the following function is not called, here I past
some normal output of Camera recording.

I/CameraInput(  508): postDataTimestamp called!
I/CameraInput(  508): postWriteAsync

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


[android-developers] Re: Html data parsing

2010-08-07 Thread DanH
Well, you're in luck in that it claims to be strict, so you MIGHT be
able to read it in with an XML parser.  (HTML validator at 
http://validator.w3.org/
reports only one minor violation.)

But it's not going to be simple.

Better might be a screen scraper such as jsoup -- http://jsoup.org/
-- but I've never tried to use such a tool.

On Aug 7, 3:58 am, Andy Best andy...@gmail.com wrote:
 Hi guys suddenly I have no experience with java and html parsing and I
 really need it...(possibly 
 fromhttp://www.uefa.com/teamsandplayers/teams/club=52280/domestic/index.html)

 I want a simple way to convert an html website to xml
 document(fetch,convert,parse) or an easy alternative way to do it...

 ps:if you know any alternative FREE resource of football(soccer) data
 tell it...

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


[android-developers] Re: Largest Android application?

2010-08-07 Thread DanH
By buy-it-for-this-purpose app I mean the phone would be purchased
specifically to run the app.

On Aug 5, 9:00 am, TreKing treking...@gmail.com wrote:
 On Thu, Aug 5, 2010 at 7:59 AM, DanH danhi...@ieee.org wrote:
  Well, this is something of a buy-it-for-this-purpose app, so some of your
  objections are maybe not relevant.

 What does buy-it-for-this-purpose app mean?

  But I guess I've not yet looked at the available mass storage on typical
  Android phones -- what's the range?

 If you mean SD storage, the range is whatever is sold for SD cards. If you
 mean internal phone storage, I have no idea. I'm sure you could find a chart
 or something if you looked hard enough.

 And what enables/disables an app for being installed on an SD chip?



 Android 2.2 and the developer enabling a manifest option.

 -
 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] PV MediaRecorder native video recording error

2010-08-07 Thread nagaraj attimani
You are getting data callback from the camera
check further flow..Is it going till video encoder ?



On Sat, Aug 7, 2010 at 6:03 PM, Kerr yuanda...@gmail.com wrote:

 Dear PV engineer:
 I have try several days for this. We want to add video conference
 function in PV opencore, so we need to create video capture node in
 native mode, I try the following code to capture video,  My code is
 like this:
   spSurfaceComposerClient videoClient = new
 SurfaceComposerClient;
   SurfaceComposerClient* videoClient2 = videoClient.get();

   int x = atoi(argv[2]);
   int y = atoi(argv[3]);
 // printf(press any key to do after new SurfaceComposerClient
 \n);
 // getchar();

   spSurfaceControl vsurCtrl(videoClient-createSurface(pid, 0, x,
 y, PIXEL_FORMAT_OPAQUE, ISurfaceComposer::eFXSurfaceNormal|
 ISurfaceComposer::ePushBuffers));
   SurfaceControl* vsurCtrl2 = vsurCtrl.get();
   videoClient-openTransaction();
   nState = vsurCtrl-setSize(x, y);
   nState = vsurCtrl-setPosition(10, 10);
   nState = vsurCtrl-setLayer(INT_MAX);
   nState = vsurCtrl-show();
   videoClient-closeTransaction();

   mRecorder = new PVMediaRecorder();
   mRecorder-init();
   mRecorder-setAudioSource(AUDIO_SOURCE_CAMCORDER);
   mRecorder-setVideoSource(VIDEO_SOURCE_CAMERA);
   //sleep(1);
   mRecorder-setOutputFormat(OUTPUT_FORMAT_THREE_GPP);

   /
   mRecorder-setAudioEncoder(AUDIO_ENCODER_AMR_NB);
   mRecorder-setVideoEncoder(VIDEO_ENCODER_H263);
   mRecorder-setVideoSize(x, y);
   mRecorder-setVideoFrameRate(10);

   mRecorder-setOutputFile(argv[1]);
   mRecorder-setPreviewSurface(vsurCtrl-getSurface()-
 getISurface2());

   status_t retCode = mRecorder-prepare();

   if(retCode  0)
   {
   printf(prepare failed: %d\n, retCode);
   IPCThreadState::self()-stopProcess();
   return -1;
   };

   printf(press any key to start\n);
   getchar();
   mRecorder-start();

sleep(10);
mRecorder-stop();
mRecorder-reset();
//videoClient-destroySurface(vsurCtrl-getSurface()-ID());
videoClient-dispose();

 Could anyone give me some guide on this?

 Regards!




 the result is
 1, when run after prepare(), the screen could see preview movie,
 everything seems well.
 2, but when run start(), the surface created freeze.
 3, after stop, I check the recorded file, there is only audio, no
 video.
 4, from the logcat, the following function is not called, here I past
 some normal output of Camera recording.
 
 I/CameraInput(  508): postDataTimestamp called!
 I/CameraInput(  508): postWriteAsync

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




-- 
Warm Regards,
Nagaraj

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 know the home launcher app packagename through programming?

2010-08-07 Thread manoj
Hi all,

I have a some strange issue. I would like to get the package name of
the current home screen.

lets say we have two home screens : 1. default android home theme
   2. 3rd party
home theme.

Assume both are installed and current home theme is 3rd party home
theme.

Now I would like to get the package package name of the current home
theme (3rd party). Is there any api which can give the current home
screen package name?

I can get the package name in ddms. But I want it programmatically.

Regards,
Manoj.

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


[android-developers] OpenGL dropping triangles

2010-08-07 Thread Warren
I am doing some very basic drawing of triangles in OpenGL, but I am
seeing strange rendering errors. When I draw a textured square (two
triangles) part of the square is missing or the texture is stretched
or corrupted. When I draw a square with no texture, part of the square
is missing sometimes.

I do not see a pattern to when it works and when it doesn't. It might
be broken one run, then after a back button and rerun, it works the
next.

The triangle that's missing is not one of the triangles used to draw
the square. Rather it is part of the first triangle and part of the
second triangle. The triangles are the bottom right half and the top
left half of the square, but the part missing is the bottom left half
of the square.

The problem occurs on both the Droid and on the emulator.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Ant Build increment Version number

2010-08-07 Thread samspade79
Hi,

Does anyone know a way I can have my ant build automatically increment
the version number in the AndroidManifest.xml file ?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 unload image from memory?

2010-08-07 Thread Alex Xin
Hi,

Are there any ways that I can unload unused images from memory? For example
I want to unload background pictures in order to save memory when my
activity is going to background?

I want to this because my app will force close on Nexus One, from the logcat
I found it was caused due to out of memory.

Thanks

Alex

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

[android-developers] Identify Application from Input Method?

2010-08-07 Thread objectuser
Is there a way for an InputMethod or InputMethodService to identify
the application for which it is providing input?

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: Largest Android application?

2010-08-07 Thread Maps.Huge.Info (Maps API Guru)
You have hundreds of html pages? Have you considered loading them on
demand from a server? That would lower the space requirement to
install the app, the rest would lie in the browser cache, which can
easily be cleared without damaging the app. You'd need to add internet
to your permissions...

-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: renaming a image file on sd card

2010-08-07 Thread Teo [GD API Guru]
Hi, have you found a solution to this problem? Strangely i have it a
bit different: can rename without remounting anything (only with the
renameTo function) on the sdcard but can't rename in the local
storage.

On Jun 17, 9:49 am, focode programarun...@gmail.com wrote:
 i have to change the name of a jpgfile, for that i have written the
 following code

 sdcard = Environment.getExternalStorageDirectory();
 from = newFile(sdcard,imagePath.substring(8).toString());
 to = newFile(sdcard,/DCIM/RoseVille_+Info.getText()
 +_+Amount.getText()+_+timeStampFormat.format(n ew Date())+.jpg);

 if(from.renameTo(to)==true)
 {
 /// if renamming is successfull;

 }

 this code creates a newfilewith the required name while thefile
 which i wanted to change is still their on sd card , if i remount the
 sd card then the oldfilegets deleted and the renamedfileremains
 their.

 so my problem is how torenamethefilewithout remounting the sd card

 thanks and regards
 focode

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] jni armeabi code compatibility

2010-08-07 Thread radiodee1
Hi. I'm writing a jni library for a game. I have java code that I want
to replace with functions from the library. Is it true that most of
the devices out there are compatible with my code if I compile it for
the default arm processor, or will I find that there are many devices
out there that my library won't run on? What I'm asking is, should I
maintain java code that does the same thing as my jni library for
compatibility purposes, or is it safe to have jni libraries alone
-- ?? How large is the group of devices that CAN'T use the libraries I
write? Where are there stats regarding what population is using
processors other than the arm processors? 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] renaming a image file on sd card

2010-08-07 Thread Alex Xin
That what I used in my code:

public static boolean rename(String orig_name, String new_name, String path)
{
File Operator1 = new File(path, orig_name);
File Operator2 = new File(path, new_name);
if (Operator1.exists() == false) {
return false;
}
if (Operator2.exists() == true) {
return false;
}
try {
boolean r = Operator1.renameTo(Operator2);
return r;
} catch (Exception e) {
return false;
}
}


On Thu, Jun 17, 2010 at 2:49 PM, focode programarun...@gmail.com wrote:

 i have to change the name of a jpg file , for that i have written the
 following code

 sdcard = Environment.getExternalStorageDirectory();
 from = new File(sdcard,imagePath.substring(8).toString());
 to = new File(sdcard,/DCIM/RoseVille_+Info.getText()
 +_+Amount.getText()+_+timeStampFormat.format(n ew Date())+.jpg);

 if(from.renameTo(to)==true)
 {
 /// if renamming is successfull;
 }

 this code creates a new file with the required name while the file
 which i wanted to change is still their on sd card , if i remount the
 sd card then the old file gets deleted and the renamed file remains
 their.

 so my problem is how to rename the file without remounting the sd card

 thanks and regards
 focode

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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: How does Android handle Simplified vs. Traditional Chinese localization?

2010-08-07 Thread Mark Carter
Thanks for your response.

When a user selects a Chinese Locale they can choose either 中文 (简体)
(Simplified Chinese) or 中文 (繁�w) (Traditional Chinese). At least those are
the options on my device.

What I would really like to know is how exactly does Android take the user's
Locale and use it to select the appropriate resources. For example, there
might be some logic which says User's Locale is 中文 (简体) = select
values-zh-rCN (if exists), otherwise values-zh (if exists) otherwise
values. This requires a certain amount of hard-coding within Android. In
future, there may be a Malaysian Chinese Locale etc. Is that already allowed
for?

My understanding of 中文 (繁�w) is Traditional Chinese. Indeed 中文 covers both
Mandarin and Cantonese but that doesn't make sense because one user will
want to set a Cantonese locale (e.g. zh-rHK) and another will want to set
Traditional Mandarin locale (e.g. zh-rTW).

Anyone got an HK Android device? What are the Chinese locales specified on
that?

On 7 August 2010 01:36, Zsolt Vasvari zvasv...@gmail.com wrote:

 Couple of issues:

 - In Hong Kong, most people speak Cantonese, while in Hong Kong, they
 speak Mandarin.  Even though they both use Traditional Chinese
 characters, they won't understand each other's writing.  You need two
 sets of localization to support both.

 - Singapore is a bad example as no app is localized into Chinese as
 the official language is English and you are not required or expected
 to provide Chinese translation of anything.  Other than in Chinatown,
 you essentially see no Chinese signage in Singapore.  I live in
 Singapore.  And when there is Chinese signage, like on public
 transportation, it's always alongside Bahasa Malay and Tamil signage.
 Also, most native Chinese speakers here are not Mandarin speakers, but
 other Chinese dialects.  No idea if the other dialects use Simplified
 or Traditonal characters.

 Back to your example, I would put Simplified Chinese Mandarin
 resources into zh and Traditional Chinese Mandarin resources zh-
 rTW and Cantonese resources (Traditional characters) into zh-rHK,
 if zh-HK is supported on Android.  If not, I'd pick one of the
 countries where you think you will get more users from and put that
 into zh-rTW.





 On Aug 6, 9:09 pm, Mark Carter mjc1...@googlemail.com wrote:
  I've configured my app with both Simplified and Traditional Chinese
  localization by using values-zh-rCN and values-zh-rTW folders.
 
  How does Android use that region component?  For example, what about
  users living in, say, Singapore (where Simplified is used) and Hong
  Kong (where Traditional is used)?
 
  I'm guessing zh-rCN and zh-rTW are treated in combination. So that
  in Singapore the locale will be set to zh-rCN and in Hong Kong, the
  locale will be set to zh-rTW. Is this correct?
 
  Is it a safer strategy to place Simplified localization in values-zh
  and Traditional localization in values-zh-rTW?

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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 know the home launcher app packagename through programming?

2010-08-07 Thread Mark Murphy
Create an Intent that brings up the HOME screen, then use
PackageManager and resolveActivity().

On Sat, Aug 7, 2010 at 9:40 AM, manoj manojkumar.m...@gmail.com wrote:
 Hi all,

 I have a some strange issue. I would like to get the package name of
 the current home screen.

 lets say we have two home screens : 1. default android home theme
                                                       2. 3rd party
 home theme.

 Assume both are installed and current home theme is 3rd party home
 theme.

 Now I would like to get the package package name of the current home
 theme (3rd party). Is there any api which can give the current home
 screen package name?

 I can get the package name in ddms. But I want it programmatically.

 Regards,
 Manoj.

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




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

_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
Available!

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


Re: [android-developers] Call to onDestroy() method of Service does not take place immediately from inside Activity

2010-08-07 Thread Mark Murphy
On Sat, Aug 7, 2010 at 8:17 AM, Rajesh Bachani rajesh.bach...@gmail.com wrote:
 What I really need is to get some data back from the Service, once the
 stopService() is called.

I would not recommend that.

 SharedPreferences is being used for this.

I would not recommend that.

 I am updating the data from Service only in the onDestroy().

I would not recommend that.

Step #1: Replace your stopService() calls with something else (e.g.,
startService() with a particular Intent indicating it is time for the
service to stop) that passes control to the service.

Step #2: Do your get some data back from the Service logic in the
service as a result of Step #1, though I would recommend you use a
better data store (e.g., database).

Step #3: Have your service call stopSelf() after doing the work from Step #2.

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

_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
Available!

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


Re: [android-developers] Identify Application from Input Method?

2010-08-07 Thread Dianne Hackborn
In the editor info:

http://developer.android.com/reference/android/view/inputmethod/EditorInfo.html#packageName

http://developer.android.com/reference/android/view/inputmethod/EditorInfo.html#packageNameAlso
information about the specific field in the app:

http://developer.android.com/reference/android/view/inputmethod/EditorInfo.html#fieldId

On Sat, Aug 7, 2010 at 8:38 AM, objectuser kevin.k.le...@gmail.com wrote:

 Is there a way for an InputMethod or InputMethodService to identify
 the application for which it is providing input?

 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 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] Can't make restartPackage() / killBackgroundProcesses() to work

2010-08-07 Thread Dianne Hackborn
Sorry you can't do this.  Apps now can only kill processes of other apps
that are in the background.

On Sat, Aug 7, 2010 at 12:43 AM, Fabrizio Giudici 
fabrizio.giud...@tidalwave.it wrote:


 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hello.

 I'm trying to have restartPackage() work - please note that I'm aware
 of all the discussions related to APIs for restarting another
 application; I'm not trying to do this in production, but during
 functional tests in order to be sure to have the application under
 test to start clean every time (without it, I'm currently forced to
 run one functional test at a time with adb, which is an annoyance). I
 know that restartPackage() has been deprecated in 2.2 and now is
 equivalent to   killBackgroundProcesses(), which is perfectly fine for
 me.

 This is the code I'm trying (from setUp() of an
 ActivityInstrumentationTestCase2):

private void resetApplication()
  {
logger.info( RESTARTING APP);
final Context context = getInstrumentation().getContext(); //
 also tried with getTargetContext(), even though I suppose getContext()
 is correct
final ActivityManager manager =
 (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
manager.restartPackage(it.tidalwave.bluebill.mobile.android);
  }

 but I constantly get:

 W/ActivityManager( 1280): Permission Denial: restartPackage() from
 pid=6014, uid=10071 requires android.permission.RESTART_PACKAGES
 I/TestRunner( 6014): failed:

 testRun(it.tidalwave.bluebill.mobile.android.test.functional.InsertOneObservationFromScratch)
 I/TestRunner( 6014): - begin exception -
 I/TestRunner( 6014):
 I/TestRunner( 6014): java.lang.SecurityException: Permission Denial:
 restartPackage() from pid=6014, uid=10071 requires
 android.permission.RESTART_PACKAGES
 I/TestRunner( 6014): at
 android.os.Parcel.readException(Parcel.java:1218)
 I/TestRunner( 6014): at
 android.os.Parcel.readException(Parcel.java:1206)
 I/TestRunner( 6014): at

 android.app.ActivityManagerProxy.restartPackage(ActivityManagerNative.java:2383)
 I/TestRunner( 6014): at
 android.app.ActivityManager.restartPackage(ActivityManager.java:910)
 I/TestRunner( 6014): at

 it.tidalwave.bluebill.mobile.android.ScenarioTestSupport.resetApplication(ScenarioTestSupport.java:183)
 I/TestRunner( 6014): at

 it.tidalwave.bluebill.mobile.android.ScenarioTestSupport.setUp(ScenarioTestSupport.java:87)
 I/TestRunner( 6014): at

 it.tidalwave.bluebill.mobile.android.test.functional.ObservationScenarioTestSupport.setUp(ObservationScenarioTestSupport.java:48)
 I/TestRunner( 6014): at
 junit.framework.TestCase.runBare(TestCase.java:125)
 I/TestRunner( 6014): at
 junit.framework.TestResult$1.protect(TestResult.java:106)
 I/TestRunner( 6014): at
 junit.framework.TestResult.runProtected(TestResult.java:124)
 I/TestRunner( 6014): at
 junit.framework.TestResult.run(TestResult.java:109)
 I/TestRunner( 6014): at
 junit.framework.TestCase.run(TestCase.java:118)
 I/TestRunner( 6014): at
 android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
 I/TestRunner( 6014): at
 android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
 I/TestRunner( 6014): at

 android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:430)
 I/TestRunner( 6014): at

 android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)
 I/TestRunner( 6014): - end exception -


 Of course I put the required permission in the AndroidManifest.xml:

 ?xml version=1.0 encoding=UTF-8?
 manifest package=it.tidalwave.bluebill.mobile.android.tests
 android:versionCode=1545
 xmlns:android=http://schemas.android.com/apk/res/android;
 android:versionName=0.14.0-SNAPSHOT
  uses-sdk android:minSdkVersion=3/
  uses-permission android:name=android.permission.INJECT_EVENT/
  uses-permission android:name=android.permission.RESTART_PACKAGES/
  application android:label=blueBill Mobile Functional Tests
uses-library android:name=android.test.runner/
  /application
  instrumentation
 android:name=android.test.InstrumentationTestRunner
 android:targetPackage=it.tidalwave.bluebill.mobile.android
 android:label=Tests for blueBill Mobile for Android./
 /manifest

 The app with tests is signed with the same signature of the app under
 test (the debug key). It happens both with the emulator (1.5 and 2.2)
 and a Motorola Droid (2.1). Of course the 2.2 with the variant that
 the required permission is android.permission.KILL_BACKGROUND_PROCESSES.


 Why am I still getting the error? Thanks.

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

 

Re: [android-developers] Application icon for wallpapers missing

2010-08-07 Thread Dianne Hackborn
The live wallpaper picker doesn't show icons; it shows thumbnails declared
by the wallpaper in its wallpaper meta-data XML:

http://developer.android.com/reference/android/R.styleable.html#Wallpaper

On Sat, Aug 7, 2010 at 4:22 AM, Peter Webb r.peter.w...@gmail.com wrote:

 When I fire up an emulator using Eclipse and have a look at live
 wallpapers, the two default wallpapers - Cube and Cube Resources -
 show as grayed-out icons that look like the image is missing.

 The wallpaper I have written is exactly the same, the proper image
 doesn't show. Doesn't work on my phone either.

 Howeever, if I go into manage services in the settings screen in the
 emulator, the proper icon is showing. Its showing as the service icon
 but not the application icon.

 Ive got:

 application
android:label=@string/wallpapers
android:debuggable=true android:icon=@drawable/foo

 with foo.pmg, foo.jpg in drawable all being accepted by the IDE but
 not showing as the application icon.

 As I say, the default cube live wallpaper doesn't show its correct
 icon either - I downloaded the source and recompiled, same thing.

 Any ideas?

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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] BitmapFactory.decodeResource, Multiple Resolution Support and SurfaceViews

2010-08-07 Thread Greg
I am having an issue understanding how to get Bitmaps from resources
in density specific directories to scale properly when drawing them to
a Surface View.  If I have a resource in folder drawable I expect it
to be scaled up when run on hdpi screens and scaled down on ldpi
screens and left as is on mdpi or 1.5 screens.  Likewise I expect
anything found in hdpi when run on an hdpi screen to remain unscaled.

However, there is some combination of settings that I am not getting
right to do this seemingly simple thing.  I am not running
compatibility mode so my manifest supports all screen sizes with
anydensity=true.  I do not understand the BitmapFactory.Options fields
of inScaled, inTargetDensity, and inDensity that I am thinking have to
be set appropriately and slightly different for each resource decoded
depending on which directory they were found in and what screen they
are currently run on.

All I have been able to find is that if either inTargetDensity and
inDensity are 0, no scaling occurs, but if not, scaling occurs such
that inDensity matches inTargetDensity.  Is this correct?  I have no
idea what valid settings are for these fields from the documentation
other than ints.  What are the integer values for LDPI, MDPI, and
HDPI?  And how do I determine the density of a resource in order to
set this before I decode it?  Am I way off base in my approach for
drawing bitmaps from various resource directories on various screen
sizes?

Any help would be much appreciated!
Thanks,
-Greg

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Airplane mode

2010-08-07 Thread Webgenius
Hi,

In AirplaneModEnabler.java present in ..\packages\apps\Settings\src\com
\android\settings, the handler looks for EVENT_SERVICE_STATE_CHANGED
to toggle the state of the checkbox and to display the summary.

When and from where is EVENT_SERVICE_STATE_CHANGED triggered?
Currently the airplane mode functionality is very weird. I need to
debug from the point where this event is triggered.

Any help is greatly appreciated. Thanks in advance.

-Webgenius

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Identify Application from Input Method?

2010-08-07 Thread objectuser
Thanks!  That's exactly what I was looking for.

On Aug 7, 12:56 pm, Dianne Hackborn hack...@android.com wrote:
 In the editor info:

 http://developer.android.com/reference/android/view/inputmethod/Edito...

 http://developer.android.com/reference/android/view/inputmethod/Edito...Also
 information about the specific field in the app:

 http://developer.android.com/reference/android/view/inputmethod/Edito...

 On Sat, Aug 7, 2010 at 8:38 AM, objectuser kevin.k.le...@gmail.com wrote:
  Is there a way for an InputMethod or InputMethodService to identify
  the application for which it is providing input?

  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 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: OpenGL dropping triangles

2010-08-07 Thread Robert Green
Warren,

It's something you're doing.  Could you give more details, perhaps
code snippets?

What projection are you using?
What are the coordinates?
What other things do you have set?
Do you have the rendering hint nicest on?
etc..

On Aug 7, 9:53 am, Warren warrenba...@gmail.com wrote:
 I am doing some very basic drawing of triangles in OpenGL, but I am
 seeing strange rendering errors. When I draw a textured square (two
 triangles) part of the square is missing or the texture is stretched
 or corrupted. When I draw a square with no texture, part of the square
 is missing sometimes.

 I do not see a pattern to when it works and when it doesn't. It might
 be broken one run, then after a back button and rerun, it works the
 next.

 The triangle that's missing is not one of the triangles used to draw
 the square. Rather it is part of the first triangle and part of the
 second triangle. The triangles are the bottom right half and the top
 left half of the square, but the part missing is the bottom left half
 of the square.

 The problem occurs on both the Droid and on the emulator.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Website for your app, how important do you feel it is?

2010-08-07 Thread Chris Stewart
Here's my entry into an external site for my apps:
http://chriswstewart.com/android-applications/  While it's not the best
thing in the world, it's certainly better than the Android Market
descriptions.  I'll toss up some screenshots and likely QA from email
questions I've received recently.

Regards,
Chris Stewart

Fantasy 
Footballhttp://chriswstewart.com/android-applications/fantasy-football/-
Android app for fantasy football fanatics and MFL owners
Social Updaterhttp://chriswstewart.com/android-applications/social-updater/-
An easy way to send your status blast to multiple social networks



On Sat, Aug 7, 2010 at 12:33 AM, TreKing treking...@gmail.com wrote:

 On Fri, Aug 6, 2010 at 10:10 PM, Chris Stewart cstewart...@gmail.comwrote:

 How do you add a signature to your Google Groups profile?  I've looked and
 couldn't see anything specific to Groups.  I can add it to my Gmail
 signature but would like to be more specific if I can.


 I don't think you can, so I switched to always replying through Gmail long
 ago.


 -
 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.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: How to quit the app?

2010-08-07 Thread Indicator Veritatis
Unfortunately, no. It is not simple. If I were running only my own
apps, THEN I could expect everything to work well because I trust the
OS to do its job, and write good code. But in real life, we all have
to use apps written by others, and I know they do not follow the
rules.

This lack of trust in apps written by others is one of the reason Task
Killers are still on the market. But don't get me wrong: by no means
do I think it is an excuse for developers to ignore the rules.
Developers, except when writing Task Killers, really should read both
Dianne's article and the reference to Process Lifecycle in it, reading
both carefully, and more than once. Then, make sure that all the
process lifecycle events are properly handled by overriding (as
needed) callbacks, and don't bother quitting the app. If the user
really needs to do that, he can use a Task Killer.

On Aug 4, 2:56 pm, IcedNet d...@icednet.info wrote:
 I believe what they are getting at is that quitting an app in
 Android is not usually necessary (if ever).
 My favorite link for this subject (quoted words from Herself):

 http://android-developers.blogspot.com/2010/04/multitasking-android-w...

 It is a different world from the way Some OS's behave (no finger
 pointing)...  trust the OS to do it's job, and write good code...
 Simple, right?

 Peace,
 Dan

 On Aug 4, 1:12 pm, Frank Weiss fewe...@gmail.com wrote:



  On Wed, Aug 4, 2010 at 9:54 AM, ls02 agal...@audible.com wrote:
   I want to terminate the Linux process, the same way Pandora app does.

  I'm not being cheeky, but just want to understand your thinking. If
  the Android app's host linux process is NOT terminated, what is the
  consequence, if any?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 Captivate sdcard issues.

2010-08-07 Thread Jeremiah Sellars
I'm not particularly concerned with how users get game data on their
media... I suppose if that ended up really being a problem I could put
up a walk through of some kind.

The primary concern is if I give out directions and say... put these
files in a folder call game on your external sd card, just for
example, incredible users would be fine and captivate users would not.
getExternalStorageDirectory() is returning the Captivates internal sd
storage, plain and simple.

I guess it really isn't all that big of a deal... I throw up
instructions that say what to do and then list instructions for the
exceptions...

On Aug 4, 10:02 am, Mark Murphy mmur...@commonsware.com wrote:
 On Wed, Aug 4, 2010 at 12:11 PM, Jeremiah Sellars

 sylus.mcf...@gmail.com wrote:
  Are there any talks of how this can be addressed?

 What specifically is the problem you are facing?

 For example, if getExternalStorageDirectory() does not give you
 something you can write to, that would be a problem.

 From your description, the only thing that seems different is that
 getExternalStorageDirectory() does not point to removable storage.

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

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

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


[android-developers] Error after publishing

2010-08-07 Thread HIRAK
My application runs fine when locally testing.
But after publishing it, i am seeing the following error in my
developer console page.
Could somebody please help me?

java.lang.NullPointerException:
  at android.app.ActivityThread.handleStopActivity(ActivityThread.java:
3269)
  at android.app.ActivityThread.access$2500(ActivityThread.java:119)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
1880)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:123)
  at android.app.ActivityThread.main(ActivityThread.java:4363)
  at java.lang.reflect.Method.invokeNative(Method.java:-2)
  at java.lang.reflect.Method.invoke(Method.java:521)
  at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
  at dalvik.system.NativeStart.main(NativeStart.java:-2)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Samsung Captivate sdcard issues.

2010-08-07 Thread Mark Murphy
On Sat, Aug 7, 2010 at 6:11 PM, Jeremiah Sellars sylus.mcf...@gmail.com wrote:
 The primary concern is if I give out directions and say... put these
 files in a folder call game on your external sd card, just for
 example, incredible users would be fine and captivate users would not.
 getExternalStorageDirectory() is returning the Captivates internal sd
 storage, plain and simple.

Yup. The CDD does not require that external storage be removable.

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

_The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9
Available!

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


[android-developers] Re: Problem in SimpleDateFormat MMM return month number

2010-08-07 Thread Tim Su
I had one of my users perform the following tests. They have an HTC
Desire running Froyo and have the locale set to French.

new SimpleDateFormat(, d ).format(new Date())
new SimpleDateFormat(, d , Locale.FRENCH).format(new Date())
new SimpleDateFormat(, d , Locale.getDefault()).format(new
Date())
new SimpleDateFormat(, d ,
getResources().getConfiguration().locale).format(new Date())

Each time, the return string is the same: 7, 7 8

Both Locale.getDefault() and the configuration locale are set to
French (France) (fr_FR)

Pretty busted, if you ask me... does anyone know of a workaround that
doesn't involve manually sticking days/weekdays into strings.xml?

On Aug 6, 5:08 am, DanH danhi...@ieee.org wrote:
 Right.  What I was suggesting was to try setting locale in order to
 test the hypothesis that lack of a locale is causing the symptoms, vs,
 eg, something broken in the date formatter logic.  And it would
 provide a circumvention for those who need one.

 On Aug 6, 4:37 am, { Devdroid } webnet.andr...@gmail.com wrote:



  On 5 August 2010 14:53, DanH danhi...@ieee.org wrote:

   Has anyone tried doing Locale.setDefault to circumvent thisproblem?

  Theproblemis when you do not care what locale are set and simply
  want to use system-wide, not any particular one.
  Calling setDefault is same like passing locale to SimpleDateFormater
  constructor - you need to either specify locale or read system
  settings and pass that in hope it works. Since this is like blind fix
  it may or may not work but you still do not know what the culprit is.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 reflection for the new Froyo requestAudioFocus and abandonAudioFocus methods

2010-08-07 Thread skyhigh
I have implemented support in my application for the new audio
features provided in the Froyo methods:

registerMediaButtonEventReceiver
unregisterMediaButtonEventReceiver

requestAudioFocus
abandonAudioFocus

These are all working fine when running on an Android 2.2 (Froyo)
device.

I have successfully used reflection for the methods:

registerMediaButtonEventReceiver
unregisterMediaButtonEventReceiver

so that the same application can run on any Android version from 1.5
to 2.2 when using these methods.

However, I am having trouble trying to use reflection for the methods:

requestAudioFocus
abandonAudioFocus

because these methods require an OnAudioFocusChangeListener parameter
which is unknown on Android devices running 1.5 to 2.1.  Because the
parameter type that must be passed into these methods is unknown and
also because my application has to have an instance of the
OnAudioFocusChangeListener object I am having trouble making
reflection work.

I can't figure out how to use the AudioManager.class.getMethod call
when it needs a parameter of type OnAudioFocusChangeListener.  I also
can't figure out how to define my instance of
OnAudioFocusChangeListener so that the application can be loaded on a
device running Android 1.5 through 2.1 without getting a Force Close
message while it is loading.

I have searched a lot of forums and haven't found any examples of how
to get reflection to work with these new Froyo audio APIs.

Can someone who better understands the use of reflection for
supporting new APIs without breaking the application's ability to
continue to run on older Android versions help me with some examples
for how to do this?

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


Re: [android-developers] How to use reflection for the new Froyo requestAudioFocus and abandonAudioFocus methods

2010-08-07 Thread Mark Murphy
On Sat, Aug 7, 2010 at 8:50 PM, skyhigh skyhigh1...@gmail.com wrote:
 However, I am having trouble trying to use reflection for the methods:

 requestAudioFocus
 abandonAudioFocus

 because these methods require an OnAudioFocusChangeListener parameter
 which is unknown on Android devices running 1.5 to 2.1.  Because the
 parameter type that must be passed into these methods is unknown and
 also because my application has to have an instance of the
 OnAudioFocusChangeListener object I am having trouble making
 reflection work.

Use conditional class loading instead. This blog post refers to it as
using a wrapper class:

http://developer.android.com/resources/articles/backward-compatibility.html

Here is a sample project demonstrating the concept with a somewhat
different implementation:

http://github.com/commonsguy/cw-advandroid/tree/master/Contacts/Spinners/

 I also
 can't figure out how to define my instance of
 OnAudioFocusChangeListener so that the application can be loaded on a
 device running Android 1.5 through 2.1 without getting a Force Close
 message while it is loading.

Just don't load the class that has the OnAudioFocusChangeListener
except on a 2.2 device. In other words, don't go down a code path that
refers to OnAudioFocusChangeListener, except on a 2.2 device.

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

Android App Developer Books: http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 unload image from memory?

2010-08-07 Thread samspade79
Bitmap.recycle() ?

On Aug 7, 10:12 am, Alex Xin xinxi...@gmail.com wrote:
 Hi,

 Are there any ways that I can unload unused images from memory? For example
 I want to unload background pictures in order to save memory when my
 activity is going to background?

 I want to this because my app will force close on Nexus One, from the logcat
 I found it was caused due to out of memory.

 Thanks

 Alex

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


[android-developers] Having problems referencing a library project from an application

2010-08-07 Thread Christopher Perry
I've been trying to do this now for 2 whole days, and am about to give
up. I followed the instructions here:

http://developer.android.com/guide/developing/eclipse-adt.html

but it is not working. I can see the library project is added to my
application but I cannot reference anything in it. Also the R.java
file from the lib was NOT added to my application, so the lib project
contains tons of errors, everywhere it tries to reference it's own
R.java file (most likely the cause of the former).

Also, in the console there are messages stating that the there is No
resource identifier found for attribute 'X' in package 'Lib Package'.
The library builds just fine, and I don't get those messages in the
console until I hook the library to my application.

You would think that creating and referencing a library would be a
simple thing to do, as it is in most other projects, but this is
turning into a real nightmare. Thanks Google!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Website for your app, how important do you feel it is?

2010-08-07 Thread Brad
Also consider making a Facebook page.  I've done this for my Zen Timer
app and it's been pretty successful:

http://www.facebook.com/zentimer

I'm finding it more and more difficult to balance the demands of
marketing + development + customer support (development is suffering -
and it's the only thing that I do well!).  So I'm scaling back my
website and focusing more on Facebook for now - we'll see how it goes.

Oh and why oh why oh why can't someone at Google bump up the 325 char
limit?  It would probably take all of 5 keystrokes to change this.
As it is, it takes away much of the incentive to add new features to
an app since you won't be able to explain (or even mention) it to
potential customers via the market.

Brad

On Aug 5, 8:01 pm, Chris Stewart cstewart...@gmail.com wrote:
 With my first paid application available now, I'm debating how I should go
 about handling support and a more thorough explanation of what my app does.
  What really got me considering it was that someone just emailed me asking
 for more information about what my app does.  The description we can provide
 in the Market is just not enough really.

 I do like what TreKing has out there for his software 
 (http://sites.google.com/site/rezmobileapps/treking) as I think it does add
 something to the purchase for someone.  I'm curious how you all look at this
 topic and if you have a support/info site for your app, how do you think it
 helps in your journey to sell apps?

 Chris Stewart
 cstewart...@gmail.comhttp://www.androidsdkforum.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: Website for your app, how important do you feel it is?

2010-08-07 Thread Shane Isbell
On Sat, Aug 7, 2010 at 7:33 PM, Brad bradfull...@gmail.com wrote:

 Also consider making a Facebook page.  I've done this for my Zen Timer
 app and it's been pretty successful:


From what I've seen with AppFriend, people on Facebook are mostly sharing
information about utilities, social apps and music. So something like
ZenTimer would likely do well there.


-- 
Shane Isbell (Founder of ZappMarket)
http://apps.facebook.com/zappmarket/

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 in SimpleDateFormat MMM return month number

2010-08-07 Thread DanH
Interesting.  This suggests that something is broken in the actual
Java JDK stuff.

On Aug 7, 6:32 pm, Tim Su t...@todoroo.com wrote:
 I had one of my users perform the following tests. They have an HTC
 Desire running Froyo and have the locale set to French.

 new SimpleDateFormat(, d ).format(new Date())
 new SimpleDateFormat(, d , Locale.FRENCH).format(new Date())
 new SimpleDateFormat(, d , Locale.getDefault()).format(new
 Date())
 new SimpleDateFormat(, d ,
 getResources().getConfiguration().locale).format(new Date())

 Each time, the return string is the same: 7, 7 8

 Both Locale.getDefault() and the configuration locale are set to
 French (France) (fr_FR)

 Pretty busted, if you ask me... does anyone know of a workaround that
 doesn't involve manually sticking days/weekdays into strings.xml?

 On Aug 6, 5:08 am, DanH danhi...@ieee.org wrote:

  Right.  What I was suggesting was to try setting locale in order to
  test the hypothesis that lack of a locale is causing the symptoms, vs,
  eg, something broken in the date formatter logic.  And it would
  provide a circumvention for those who need one.

  On Aug 6, 4:37 am, { Devdroid } webnet.andr...@gmail.com wrote:

   On 5 August 2010 14:53, DanH danhi...@ieee.org wrote:

Has anyone tried doing Locale.setDefault to circumvent thisproblem?

   Theproblemis when you do not care what locale are set and simply
   want to use system-wide, not any particular one.
   Calling setDefault is same like passing locale to SimpleDateFormater
   constructor - you need to either specify locale or read system
   settings and pass that in hope it works. Since this is like blind fix
   it may or may not work but you still do not know what the culprit is.

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

2010-08-07 Thread DanH
Well, first off we'd have to explain to TPTB why the app can run stand-
alone on iPhone and Symbian, but not Android.  And I think there'd be
concern about not having WLAN connectivity and running up phone
charges, or not having any connectivity at all and having the app
fail.

On Aug 7, 10:54 am, Maps.Huge.Info (Maps API Guru)
cor...@gmail.com wrote:
 You have hundreds of html pages? Have you considered loading them on
 demand from a server? That would lower the space requirement to
 install the app, the rest would lie in the browser cache, which can
 easily be cleared without damaging the app. You'd need to add internet
 to your permissions...

 -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: Android Library Project

2010-08-07 Thread Christopher Perry
I'm having this exact problem right now. Did you figure it out?

On Jul 7, 11:58 am, Vladimir Lebedev-Schmidthof dair@gmail.com
wrote:
 Hello Mark,

 I faced the same problem with attrs.xml in Library Project. Have you
 finally found the solution?

 On 23 май, 23:22, Mark Carter mjc1...@googlemail.com wrote:



  I'm sure that thelibrary.apk file error was because I had added 
  thelibraryprojectto my appprojectbuild path.

  The other problem, where appprojectclasses could not 
  seelibraryprojectclasses was due to something else.

  For some strange reason, even when the androidlibrarycompiles by
  itself (I mean, does not show any errors in eclipse), it can give
  compiler errors when used as alibraryin anotherproject. In that
  situation, it does not show up like LibProject in your png file.

  In my situation, this was caused by a problem with a custom widgets I
  had defined in mylibrary. The attrs.xml file was being ignored for
  some reason. Everything worked fine (i.e. the LibProject showed up as
  in your png file) when I removed those custom widget (I'm not talking
  about homescreen widgets)attributesfrom the relevant layout xml in
  thelibraryproject.

  Sorry all this is a bit vague. I'll try and come up with a clearer
  scenario but I'm right in the middle of something now.

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

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


[android-developers] Re: Fwd: Image flicker

2010-08-07 Thread Sarwar Erfan
Hi,
May be this can help you...
http://stackoverflow.com/questions/1938031/how-to-detect-a-two-finger-flick

Regards
Sarwar Erfan


On Aug 7, 7:58 pm, pawan nimje pawanni...@gmail.com wrote:
 Hi All,

 May be my previous question wasnt clear last time.

 I'll try to explain it once again.

 Updated Image( landscape view)

 [image: sample.JPG]

 What i want to have is a background image, 2 buttons above it, and some
 text.

 Now when i flick at red spot (from right to left) .. i want a new bg image
 and new text above it.

 So far what i have figured out is i can have a listview (in scrollview)

 But when i scroll it i want next item ( i.e new image and new text)

 Suggest how can this be done.

 Thanks,
 Pawan







 -- Forwarded message --
 From: pawan nimje pawanni...@gmail.com
 Date: Sat, Aug 7, 2010 at 1:15 AM
 Subject: Image flicker
 To: android-developers@googlegroups.com

 Hello All,

 What i want to develop is something like shown below in the image

 [image: sample.JPG]

 I have a background image, some text above it.

 Now when i flick-to-scroll gesture of fling ( shown in red ) (dont know what
 its called) i want a new image and a new text on it

 I'll be fetching image name and text from db.

 Can anybody throw some light on how this can be done

 Thanks,
 Pawan



  sample.JPG
 65KViewDownload

  sample.JPG
 120KViewDownload

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


[android-developers] Re: LOCK_PATTERN_ENABLED on API 8 (Froyo)

2010-08-07 Thread GodsMoon
I'm also interested in this.
I can't find anything like LOCK_PASSWORD_ENABLED or LOCK_PIN_ENABLED
in the docs. I assume
Anybody know if it will be in Gingerbread or if its somewhere else
that I'm missing?

I've been looking at DevicePolicyManager
http://developer.android.com/reference/android/app/admin/DevicePolicyManager.html#getPasswordQuality(android.content.ComponentName)
It looks like mDPM.getPasswordQuality(null) should work but it
doesn't.
As far as I can tell getPasswordQuality(admin | null) always returns
zero even with the Sample Device Admin enabled.
Possible bug?

Thanks,
David Shellabarger
http://www.nightshadelabs.com
twitter.com/godsmoon

On Jul 22, 3:23 pm, Joseph Earl joseph.w.e...@gmail.com wrote:
 It is working correctly.LOCK_PATTERN_ENABLEDtells you only about if
 the lock pattern is enabled. It has nothing to do with the password as
 far as I am aware.
 I'm afraid I do not know how to tell if the password lock is enabled
 or not, a quick scan of the docs didn't reveal anything to me.

 On Jul 21, 3:29 pm, Nea ehsan@gmail.com wrote:



  According to the documentation System.Secure.LOCK_PATTERN_ENABLED
  tells you whether the autolock is enabled or not. If you set a lock
  pattern it will return true and if you don't set any screen lock it
  will return false, which is all in order.

  However on the Android virtual device emulator you could set a screen
  lock with a pin code or password instead of a lock pattern. But if you
  set a pin or passwordLOCK_PATTERN_ENABLEDwill return false instead
  of true. Isn't this a bug? Or is there another way to find out if a
  screen lock is set or not (independent of it's a lock pattern, pin or
  password)?

  This seemingly wrong behaviour has also been discovered on a Motorola
  Milestone device with Android 2.1 installed. It let's the user set a
  lock pattern or password as a screen lock, however if a password is
  setLOCK_PATTERN_ENABLEDwill return false.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: remove checkboxpreference in preferencescreen

2010-08-07 Thread Sarwar Erfan
Hi,
Your requirement is not quite clear. You need to put some light on it.

What I understood is, you have an XML, where you have defined some
preferences. Then, you show them in a PreferenceActivity (using
addPreferencesFromResource).
Now, there is one checkbox type preference, which you dont want your
user to be able to change.

I am assuming that you are willing to change that preference from code
(otherwise, how is it going to be changed?)

So, just remove that checkbox preference from your XML. Then, your
user will not able to see it.

Then, add/read/modify that preference from code.
In preferences, there is an edit() method, which return an Editor. You
can incove putBoolean(String key, boolean value) on the Editor to add
a key-value.
Dont forget to call commit().


Regards
Sarwar Erfan


On Aug 6, 11:59 pm, bo yada...@gmail.com wrote:
 hi
 everybody

 this is vinod i have a problem with my requirement   pleas help me

 my  problem is :
  i need to invisible  checkboxpreference in run time ,how could i
 solve this one
 basically we have no option to invisible in checkboxpreference

 please help me any one

 rearding ..
 vinod

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