[android-developers] Re: Prefill databases

2010-07-19 Thread Jaap


OK, but where do I need put it in the package?


On Jul 19, 4:07 am, DanH danhi...@ieee.org wrote:
 Again, I say, what's your problem -- do you need to know how to fill
 the database, or how to include it in your app?

 A SQLite database consists of a single file on the PC or phone, and is
 portable between them, so you can use any of a dozen methods to fill
 the database file and then install it with your app.

 On Jul 9, 3:10 pm, Jaap jaap.hait...@gmail.com wrote:

  Hi,

  I have a program that needs a fixed database to do lookups of some
  data. Is there a way to easily fill such a database by just putting
  the data in a file or so

  Thanks

  Jaap

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] File operations extremely slow on emulator - totally stuck.

2010-07-19 Thread MB
Hi,

I am finding that file operations are extremely slow on emulator. The
same operation which takes less than a few seconds in a real device,
takes minutes on an emulator.

I am using a ubuntu linux machine with 2.4Ghz CPU, 2 GB Ram.

I would really appreciate any help in resolving this.  I am totally
stuck due to this.

Thanks,

--MB.

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

2010-07-19 Thread Samuel Lawson
I see the download figures have dropped across all apps. Though that
is probably inline with the adjustment described in the blog post.

I believe the market still has troubles though - yesterday around
30% of users who tried to purchase my app cancelled - due to their
downloads failing.

On a typical day i might get one cancellation. This points to issues
with the market again. I had customers emailing me complaining they
cannot download their purchase...

On Sun, Jul 18, 2010 at 11:35 PM, croco zeug...@gmail.com wrote:
 Both free and paid affected

 On Jul 18, 5:31 pm, croco zeug...@gmail.com wrote:
 My stats are wrong again! !!! And not is not yet corrected has
 mentioned on android blog.

 Lost 2500 downloads and 1500 active users in the night.

 Is it corrected for you guys? ?

 Thanks

 On Jul 17, 8:57 pm, Zsolt Vasvari zvasv...@gmail.com wrote:



  In my case only the free one dropped, the paid one just shows the
  incorrect count as I said a few posts back, but it hasn't dropped per
  se.

  On Jul 18, 6:17 am, Neilz neilhorn...@gmail.com wrote:

   No this is all apps, not just paid. Mine is free and down 15%.

   On Jul 17, 1:10 pm, Sam samuel.law...@gmail.com wrote:

Ah ok so the was the explanation all along:

   http://android-developers.blogspot.com/2010/07/market-statistics-adju...

Logically the total download figures would include refunds (since they
still downloaded the app) but not failed payment transactions (because
they never got to install the app in the first place).

On Jul 17, 5:50 pm, Evgeny V evgen...@gmail.com wrote:

 Yes. It dropped again about 15%!

 On Sat, Jul 17, 2010 at 9:59 AM, Neilz neilhorn...@gmail.com wrote:
  How annoying. Mine have dropped around 15%.

  And I'd just been boasting to my friends about a certain figure I'd
  reached - I'll have to do it all again in a month or so 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.comandroid-developers%2Bunsubs
   cr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group 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: view and subview

2010-07-19 Thread grace
hi please check out the sample code for creating views and viewGroups
without a xml


public class tut3 extends Activity {

/** Called when the activity is first created. */

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);



ScrollView sv = new ScrollView(this);

LinearLayout ll = new LinearLayout(this);

ll.setOrientation(LinearLayout.VERTICAL);

sv.addView(ll);



TextView tv = new TextView(this);

tv.setText(Dynamic layouts ftw!);

ll.addView(tv);



EditText et = new EditText(this);

et.setText(weee~!);

ll.addView(et);



Button b = new Button(this);

b.setText(I don't do anything, but I was added
dynamically. :));

ll.addView(b);



for(int i = 0; i  20; i++) {

CheckBox cb = new CheckBox(this);

cb.setText(I'm dynamic!);

ll.addView(cb);

}

this.setContentView(sv);

}

}


On Jul 17, 5:46 pm, Jags jag...@gmail.com wrote:
 is there a way i can create a view and add some textviews into it ?
 programmatically ? any sample code ?

 regards

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Which Android service path to choose for implementing a large upload?

2010-07-19 Thread MB

What do you mean by an IntentService?

A singleton object running a Thread would be easier to implement and
would probably port out of the box on other java based platforms.
However it would have the following drawbacks:

- Android only treats Activities and Services as components. So if you
are using a singleton object to do the grunt work, your process would
become a candidate to be killed with higher probability in low memory
conditions.

- Notifications require a Context in android. So a singleton object
would not be able to issue notifications.

I would suggest using a Service.



On Jul 17, 5:20 pm, Frank Weiss fewe...@gmail.com wrote:
 My suggestion is to look at some sample code, like Romain Guy's
 PhotoStream. Although PhotoStream does a Flickr download instead of an
 upload, the application structure covers services, AsyncTask (albeit
 an early version thereof), notifications, etc.

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


[android-developers] Re: Best way to logout each time the application/task goes to background

2010-07-19 Thread Zsolt Vasvari
Don't have a server and this is what my users asked for.  They don't
want prying eyes for their financial data.  The password is optional
and a yet to receive a bad comment about this feature.

On Jul 19, 2:34 am, Streets Of Boston flyingdutc...@gmail.com wrote:
 Requiring  users to re-type their passwords every time they leave the
 app (even if not by their doing, e.g. when receiving a phone-call or
 reacting to a notification), may reaallly start to annoy your users.
 And if your app needs a high level of security, i can imagine that the
 users' passwords are pretty strong.

 But i don't know the nature of your app and it could be that your
 users are willing to put up with it.

 About the timeout of my first reply:
 I was talking about a session timeout on the server, not on your app.
 You send an authentication token, e.g. a (secure) cookie, with every
 request to your server. The server then determines if the request's
 session has timed-out or not. If so, the user needs to login again.

 On Jul 17, 5:57 am, Kim Damevin kdame...@gmail.com wrote:



  @Frank weis: my application requires a high level of security, so if the
  user leaves it I don't want that someone else who would use the android
  mobile can open it without having to log in.

  Thanks for all your replies it helps a lot !
  I think i will go for the timeout method. It's a good point that if the user
  clicks on home by mistake and wants to come back to the application in a
  short time period he doesn't need to log in again.

  Anthoni and Zsolt Vasvari can you describe a bit more your solutions please
  ?

  Thanks,
  Kim

  On Sat, Jul 17, 2010 at 10:42 AM, Anthoni anthoni.gard...@gmail.com wrote:
   Hello,

   I also do this, BUT I do not put it into every single activity. What I
   do is create a Handler at application level and a time check object.
   The handler fires every say 10 seconds and checks the time object. If
   it matches what I need I broadcast an event across my entire
   application. Each activity then registers whether or not they need to
   be notified of this broadcast, so they can take what ever action they
   require.

   Hope this helps.

   Regards
   Anthoni

   On Jul 17, 3:43 am, Zsolt Vasvari zvasv...@gmail.com wrote:
1) This is not the best option, at least not without option 2, as the
user can still leave without having the opportunity to log out, for
example to answer a call.

2) I do this, it's a bit of a pain as I need to check the timeout in
every activity, and I have at least a couple of dozens.  So it's a bit
of a maintanence issue.

I set my timeout to, I think, 10 seconds.  Long enough, so if the user
accidentally presses the home button, they can get back in quickly.

On Jul 17, 3:40 am, Streets Of Boston flyingdutc...@gmail.com wrote:

 You have no control over the application and/or activity life cycle.
 This will make is very hard to determine when the user 'exits' the
 app.

 I would do this:
 1. Consider an explicit 'log-out' option for your users.
 2. Add a time-out to your login-sessions. Refresh the session (time-
 out) when the user interacts with your app/server. But when the user
 hasn't interacted with your app/server for a given amount of time, the
 user's session will have had a time-out and this then would require
 the user to login again.

 On Jul 16, 4:09 am, Kim D. kdame...@gmail.com wrote:

  Hello,

  I have an application which requires a login at the beginning (this
   is
  the first activity). When the user logs in, I keep his credentials 
  in
  the application (I extended android.application to add a field 
  called
  'key'). I would like to clear this field from memory (from
   application
  instance) an go back to the login activity.

  I see the following possibilities:
  - Add a broadcast receiver to catch all possible event (call, click
   on
  menu, click on back, lock the phone ...) which clear the key field
   and
  launch the login activity
  - Use clearTaskOnLaunch for all activities except the login 
  activity.
  But then until my application takes the focus again the key stays in
  the application object. (It seems it doesn't work with the go back
  button, maybe I need to use no history also)
  - Detect for each activity in all onPause or onStop events when
  application will leave the foreground
   to clear the key field and launch the login activity

  The best would be to have a kind of OnPause method at application
  level but I think it doesn't exist

  I would appreciate any help on this problem.

  ps: I already posted it once but never saw it on the discussions
   list.

  Cheers,
  Kim- 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 

[android-developers] HTC EVO can't see UDP broadcast packets?

2010-07-19 Thread Robert Green
I'm pretty sure no one but me is using UDP broadcasts but in the rare
chance that someone is - has any experienced this?  I use UDP
broadcast to do LAN multiplayer games - it's how clients discover
hosts of games.  The EVO can't ever see the games when all my other
phones can.

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

2010-07-19 Thread Naseer
Create an assets directory and put it there.
Here is a nice tutorial that explains it -
http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/

-Naseer



On Jul 19, 11:08 am, Jaap jaap.hait...@gmail.com wrote:
 OK, but where do I need put it in the package?

 On Jul 19, 4:07 am, DanH danhi...@ieee.org wrote:

  Again, I say, what's your problem -- do you need to know how to fill
  the database, or how to include it in your app?

  A SQLite database consists of a single file on the PC or phone, and is
  portable between them, so you can use any of a dozen methods to fill
  the database file and then install it with your app.

  On Jul 9, 3:10 pm, Jaap jaap.hait...@gmail.com wrote:

   Hi,

   I have a program that needs a fixed database to do lookups of some
   data. Is there a way to easily fill such a database by just putting
   the data in a file or so

   Thanks

   Jaap



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

2010-07-19 Thread FrankG
Obex via Bluetooth or USB ?

Independent from this question, IMHO their is no
support for that in the SDK.

Good luck !

  Frank


On 15 Jul., 07:30, Amit amitag...@gmail.com wrote:
 Hi,

 I want to transfer a file from my Android application to my desktop (I
 don't want to display any UI for the user)

 I could not find any documentation or links which suggest me how to
 transfer the file programatically.

 Thanks
 Amit

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

2010-07-19 Thread Ken
Hi,

I wonder if it's possible to authenticate an app with a http server.
THe server API does not require user name or password, but I'd like to
expose the server API to a particular app only (so that it cannot be
abused by other program).

At this point I think it's impossible but figure it won't hurt to
ask.

Thanks.

Ken

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

2010-07-19 Thread xuxu
Hi all,
I'm newbie with android and eclipse and I got this strange
thing...when ever I'm running little program that I write on the
emulator I'm getting: Hello android, program_name
for example: I'm writing a little program could udp_client and I'm
getting: Hello android, udp_client
can someone tell me if this is the way it should be?
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] how to make library for another application to use

2010-07-19 Thread cindy
Hi friend,

I need to provide some SDK as third party library for other
applications. We don't want to open our source code. How could make a
jar file?

Thanks!
Cindy

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

2010-07-19 Thread ionel
Take a look on this 
http://www.higherpass.com/Android/Tutorials/Working-With-Android-Contacts/1/

On Jul 13, 2:32 pm, Lieuwe lieuwe.elger...@gmail.com wrote:
 Is it possible to create a generic android application that uses
 contacts (though a contentResolver) that will run on all android
 versions  1.5 ?

 I have backward compatibility issues where f.i. my HTC Hero which is
 upgraded to Android 2.1 is not able to use the People.CONTENT_URI even
 though this is meant to be deprecated - not unsupported!

 If I include the new API style ContactsContract.Contacts.CONTENT_URI
 (with or without a check on the Build.SDK_VERSION to alternatively
 load the old style URI - similar to the Businesscard example 
 -http://developer.android.com/resources/samples/BusinessCard/index.html)
 I would still have to set up Eclipse to use the Android 2.1 libraries.
 Would this application still run on an Android 1.5 device if I keep
 the minsdkversion in the manifest at 3?

 I would like to avoid having to branch my application, create 2
 eclipse projects and release 2 different applications.

 Any advice on this?

 Lew

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


[android-developers] How to add my jar to add-ons as API for other app, like Google Map API ?

2010-07-19 Thread Boern
Hi,all:
   I want to public my jar to other app as API  and I found the google Maps
API is added to android as and-ons,so how can I add my jar to add-ons?
Or is any other way to public my jar API to the third app and my jar has
included the android API, how to implement that idea ?




Thx!

-- 
Boern Z

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

2010-07-19 Thread CMF
http://iphonenews.desinformado.com/wp-content/uploads/2007/12/iphone-music.jpg
iphone has a aweful music cover app. I want to implement one on the
Android OS.
is there any one know how to do that?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Which one to buy ? Droid x vs nexus one ?

2010-07-19 Thread Kim D.
Hi,

For my tests I have to buy a real android phone. Emulator is cool but
I need a real one to really test my application.

Does anyone know which one is the more representative and the best to
test my application ? (my target is android 2.2)

Thanks,
Kim

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

2010-07-19 Thread Kim D.
Hi,

This is not an android related question...
but have a look there:
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.jdt.doc.user/tasks/tasks-33.htm
or there
http://www.javacoffeebreak.com/faq/faq0028.html



On 19 juil, 09:33, cindy ypu01...@yahoo.com wrote:
 Hi friend,

 I need to provide some SDK as third party library for other
 applications. We don't want to open our source code. How could make a
 jar file?

 Thanks!
 Cindy

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 give a rubber-band/bounce effect to ListView (similar to iPhone)

2010-07-19 Thread UD
Hi,

Tnx Shawn for you reply, but I had already checked this link, and due
to some requirements and limitations I have to use ListView in the
application. So this approach can't be used here.
Is there any other way to give similar effect to a ListView?

--
Regards,
Udayan



On Jul 17, 7:26 pm, nation-x shawn.payme...@gmail.com wrote:
 I adapted the dynamics tutorial available here to a custom listview...
 I don't think you can do it with a normal listview.

 http://blogs.sonyericsson.com/developerworld/category/tutorials/3d-list/

 Shawn McAllister

 On Jul 17, 6:47 am, UD udayan.warne...@gmail.com wrote:



  Hi,

  I want a ListView to have rubber-band (or bounce) effect while
  scrolling. Just similar to iPhone lists.

  --
  UD

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

2010-07-19 Thread arsalank2
Hi Android developers,

I am trying to stream a video on an Android device, but default
Mediaplayer is not able to play the stream. The video can be played
offline from SD card. I have tried various codec (H.264, H.263,
MPEG-4, AAC etc..) with different profiles, but unable to come up with
correct format that is streamable.

Can someone please point me to officially supported codec with profile
information for network streaming on Android devices?

Please don't send me the following link, because this list only works
in offline mode:

http://developer.android.com/guide/appendix/media-formats.html

Alternatively, please suggest an application with settings to encode
the video.

Thanks,

Arsalan

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


[android-developers] problem in using getcurrentfocus().... guide me...

2010-07-19 Thread A N K ! T
 while am trying to fetch current focus object i.e View by using
getcurrent focus method ...but view object not getting any value it is
showing null value
please let me know what shu i do nowcode is given bellow
*public* *class* CurrentView *extends* Activity {

/** Called when the activity is first created. */

View view;

Button bt;

 @Override

*public* *void* onCreate(Bundle savedInstanceState) {

*super*.onCreate(savedInstanceState);

   setContentView(R.layout.*main*);

   bt=(Button)findViewById(R.id.*Button01*);

   bt.setText(Get View);

   bt.setOnClickListener(*new* View.OnClickListener() {

@Override

*public* *void* onClick(View v) {

// *TODO* Auto-generated method stub

  *view**=(View)getCurrentFocus(); //here view is not getting
any value!!*

}

});

 }


-- Ankit

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

2010-07-19 Thread Ajmer singh
Hi Frank

I tried to use the PendingIntent but won't work for me may be i was doing it
wrong, Basically i need to start the simple background service that will get
the updates periodically from webserver and look for new coupons there.if he
found any new coupon then i simply need to present user a chioce either to
view the updated coupon or not,


Basically i want to start a new activity from a background service,Is that
possible ?,Please help.

On Sun, Jul 18, 2010 at 12:16 AM, Frank Weiss fewe...@gmail.com wrote:

 I think you should know that an Android service is not meant to
 interact with the user directly, as with a dialog.

 Aside from questioning why the user input is needed in the midst of
 the service and whether the entire background process needs to be
 performed in a service, here's what I'd recommend:

 Split the service into two or three parts. The first would be up to
 the point of requesting the user's choice, the other one or two would
 be the branches of the user choice. Use a notification (pending
 intent, handler) at the branch part (the Android way of having a
 service ask or provide information to the user). You can use a single
 service instead of several by using a state machine pattern (the
 service does different things depending on its state).

 hth

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




-- 
*Thanks and Regards
Ajmer Singh*

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Sorry, this video cannot be played on Nexus one 2.2

2010-07-19 Thread zohar lerman
Hi,

I recently upgraded My Nexus one 2.1 to Nexus one 2.2.

Since then i have problem to play mov files.
I get Sorry, this video cannot be played error message.

Intent myIntent = new Intent(Intent.ACTION_VIEW);
Uri u = Uri.parse(url);
myIntent.setDataAndType(u, video/*);

try {
context.startActivity(myIntent);
} catch (ActivityNotFoundException e) {
Log.e(MyTag, cannot initiate video, e);
}

any Idea?

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

2010-07-19 Thread radiodee1
Hi,

I'm using Eclipse and the Android SDK for Linux. When I start my
emulator at the beginning of the day it works fine. Later in the day
it's sluggish and still later it won't start at all. This computer
runs Debian linux, the testing branch, with 1Gig memory and a two 1.6
Ghz processors.

On another machine I have, the emulator works the same at the
beginning and end of the day. It has 500M ram and a single 1.6 Ghz
processor. What could be the problem? As it turns out I cannot use the
second machine for all my daily tasks. How can I get the first machine
to work? Is it the number of processors? I cannot figure out how to
disable a processor in the emulator. I was looking at the '-qemu'
options, but none seems to do the trick. I don't understand the qemu
options that well. Any help would be appreciated. Thanks.

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


Re: [android-developers] Retreive Default Application associated with a file type

2010-07-19 Thread Mark Murphy
On Sun, Jul 18, 2010 at 11:25 PM, Protocol-X shawn.bur...@gmail.com wrote:
 Is there any way to retrieve either the default application name
 associate to a mime type or a list of applications?

Applications have nothing to do with MIME types in Android.

You can use PackageManager, and methods like queryIntentActivities(),
to determine what will respond to a given Intent, such as one where
you have set the MIME type to be what you want.

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


Re: [android-developers] Launch intent in background then bring to foreground?

2010-07-19 Thread Mark Murphy
On Mon, Jul 19, 2010 at 1:05 AM, gmrunltd gamerunlimi...@gmail.com wrote:
 Hi, is there any way to launch an activity w/ Intents (in this case
 the Browser) in the background, and then bring it to the foreground
 using a service or activity?

 I know it's possible to bring apps to the foreground by launching an
 intent with FLAG_ACTIVITY_BROUGHT_TO_FRONT

 But is it possible to initially launch the activity in the background?

No, sorry.

-- 
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 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] How to call a clicked item within an intent??

2010-07-19 Thread kivy
Hi,


in my code I am trying to call the last clicked item within an
intent.

Inside an onClick event, the Uri gets tagged to keep track of the item
that was clicked, but I don't know how I can call this uri now from
within the intent.

What I mean is: here I tag the item...

 vGrid.setOnItemClickListener(new OnItemClickListener() {

   @Override // click on item and open options menu
   public void onItemClick(AdapterView? parent,
View v, int
position, long id) {

   //get uri of selected/clicked video
String uri = (String) v.getTag();
   String [] proj={MediaStore.Video.Media.DATA};
   videocursor =
managedQuery( MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj,
null,null,null);
   videocursor.moveToPosition((int)
vGrid.getSelectedItemId());

   // print the filename
   Toast.makeText(ShareGalleryView.this, You just
selected 
+uri, Toast.LENGTH_SHORT).show();

   openOptionsMenu(); //Opens Options Menu by
clicking a video
   }
   });

and inside an menu I would like to call the item that was clicked and
attach it to the new intent: i.putExtra(Intent.EXTRA_STREAM,
Uri.fromFile(new File())); //HOW TO CALL THE CLICKED ITEM??

@Override //creates options menu with menu-items
   public boolean onCreateOptionsMenu(Menu menu) {

 MenuInflater inflater = getMenuInflater();
 inflater.inflate(R.menu.menu_gallery_share, menu);
 return super.onCreateOptionsMenu(menu);
   }
   @Override //what happens when a menu item is clicked
   public boolean onOptionsItemSelected (MenuItem item){

try{
   //Facebook
   if (item.getItemId() == R.id.menu_facebook)
   {
//TODO open fb
   new AlertDialog.Builder(this)
 .setTitle(No Service)
 .setMessage(Sorry, Facebook is not supported yet!)
 .setNeutralButton(Close, new
DialogInterface.OnClickListener() {
   @Override
   public void onClick(DialogInterface dialog, int
which) {
   // TODO Auto-generated method stub
   }}).show();
   return true;

   }
  //YouTube
   else if (item.getItemId() == R.id.menu_youtube)
   {
   //TODO open YouTube

   new AlertDialog.Builder(this)
 .setTitle(No Service)
 .setMessage(Sorry, YouTube is not supported
yet!)
 .setNeutralButton(Close, new
DialogInterface.OnClickListener() {
   @Override
   public void onClick(DialogInterface
dialog, int which) {
   // TODO Auto-generated method
stub
   }}).show();

 return  true;
   }
   else if (item.getItemId() == R.id.menu_email)
   {

   Intent i = new Intent(Intent.ACTION_SEND);
   i.setType(text/plain);
   i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
   i.setType(video/mp4);
   i.putExtra(Intent.EXTRA_STREAM,
Uri.fromFile(new File())); //HOW
TO CALL THE CLICKED ITEM??
   startActivity(i);

   return true;

   }
   else if (item.getItemId() == R.id.menu_bluetooth)
   {
   // TODO send via bluetooth
   new AlertDialog.Builder(this)
 .setTitle(No Service)
 .setMessage(Sorry, Bluetooth is not supported
yet!)
 .setNeutralButton(Close, new
DialogInterface.OnClickListener() {
   @Override
   public void onClick(DialogInterface
dialog, int which) {
   // TODO Auto-generated method
stub
   }}).show();
   return true;

   }

   }
catch(Exception e)
   {
   e.printStackTrace();
   }
 return super.onContextItemSelected(item);
   }

Any help is welcome, I would really appreciate if someone could give
me a hand here.

Thank you.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 add my jar to add-ons as API for other app, like Google Map API ?

2010-07-19 Thread Mark Murphy
On Mon, Jul 19, 2010 at 4:13 AM, Boern cayso...@gmail.com wrote:
    I want to public my jar to other app as API  and I found the google Maps
 API is added to android as and-ons,so how can I add my jar to add-ons?

Write your own firmware. Add-ons are part of the firmware.

 Or is any other way to public my jar API to the third app and my jar has
 included the android API, how to implement that idea ?

Write an application that exposes an Android API (AIDL-based service,
Intent-based service, ContentProvider, etc.), package that application
as an APK, and distribute the APK.

-- 
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 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] How to respekt volume preferences ?

2010-07-19 Thread mac-systems
Hello,

i have Code which plays a notification sound using the MediaPlayer :

AssetFileDescriptor afd = null;
try
{
afd = getContext().getResources().openRawResourceFd(_resourceID);
player.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(),
afd.getLength());
player.setVolume(VOLUME, VOLUME);
player.prepare();
player.start();
...
...


How can i respekt the Volume Settings of the User ? VOLUME is set to
1.0f there.

I thought it would possible to read the Volume using the AudioManager,
but it will return an integer:

final AudioManager audioManager = (AudioManager)
_context.getSystemService(Context.AUDIO_SERVICE);
final int volume =
audioManager.getStreamVolume(AudioManager.STREAM_NOTIFICATION);


Thx,
Jens


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Sorry, this video cannot be played on Nexus one 2.2

2010-07-19 Thread Mark Murphy
Try using a real MIME type. Real MIME types do not have asterisks.

On Mon, Jul 19, 2010 at 6:15 AM, zohar lerman lirazo...@gmail.com wrote:
 Hi,

 I recently upgraded My Nexus one 2.1 to Nexus one 2.2.

 Since then i have problem to play mov files.
 I get Sorry, this video cannot be played error message.

 Intent myIntent = new Intent(Intent.ACTION_VIEW);
 Uri u = Uri.parse(url);
 myIntent.setDataAndType(u, video/*);

 try {
        context.startActivity(myIntent);
 } catch (ActivityNotFoundException e) {
        Log.e(MyTag, cannot initiate video, e);
 }

 any Idea?

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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 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] Re: Encrypt with Android using AES, decrypt with PHP...

2010-07-19 Thread sblantipodi
it's quite incredible, no article on internet talks about cypher with
android and php or servlet...

On Jul 18, 8:46 pm, sblantipodi perini.dav...@dpsoftware.org wrote:
 Hi,
 is there some code snippet that show how to encrypt a password with
 Android
 and then decrypt it with php?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: trying to override OEM(Incoming call screen) screen

2010-07-19 Thread mike
hi Ankit,

did u found a way to do this?

regards,
Mik

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Sorry, this video cannot be played on Nexus one 2.2

2010-07-19 Thread zohar lerman
Can you please provide an example?

On Jul 19, 2:02 pm, Mark Murphy mmur...@commonsware.com wrote:
 Try using a real MIME type. Real MIME types do not have asterisks.



 On Mon, Jul 19, 2010 at 6:15 AM, zohar lerman lirazo...@gmail.com wrote:
  Hi,

  I recently upgraded My Nexus one 2.1 to Nexus one 2.2.

  Since then i have problem to play mov files.
  I get Sorry, this video cannot be played error message.

  Intent myIntent = new Intent(Intent.ACTION_VIEW);
  Uri u = Uri.parse(url);
  myIntent.setDataAndType(u, video/*);

  try {
         context.startActivity(myIntent);
  } catch (ActivityNotFoundException e) {
         Log.e(MyTag, cannot initiate video, e);
  }

  any Idea?

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


Re: [android-developers] Re: Sorry, this video cannot be played on Nexus one 2.2

2010-07-19 Thread Mark Murphy
On Mon, Jul 19, 2010 at 7:31 AM, zohar lerman lirazo...@gmail.com wrote:
 Can you please provide an example?

An example of a MIME type without an asterisk is:

video/quicktime

-- 
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 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] Re: Sorry, this video cannot be played on Nexus one 2.2

2010-07-19 Thread zohar lerman
Thanks but it still not working.
Any other idea?

On Jul 19, 2:38 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Mon, Jul 19, 2010 at 7:31 AM, zohar lerman lirazo...@gmail.com wrote:
  Can you please provide an example?

 An example of a MIME type without an asterisk is:

 video/quicktime

 --
 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] Re: Is anyone successfully using custom InputFilter instances?

2010-07-19 Thread Mark Carter
Anyone have any ideas about this?

On Jul 16, 10:09 am, Mark Carter mjc1...@googlemail.com wrote:
 I implemented my own InputFilter recently (for an EditText view) and
 everything works fine...at least on stock keyboards.

 However, I'm getting reports of problems with 3rd party IMEs (such as
 Cantonese Keyboard).

 If the user types hello, then he gets hhehelhellhello. This
 happens with a few popular 3rd party IMEs I've tried. Google Pinyin
 IME works fine though.

 On closer inspection, when typing the e of hello, the args to
 InputFilter.filter() are:

 source: he, start: 0, end: 2, dest: h, dstart: 1, dend: 1

 However, I think it should be either:

 source: e, start: 0, end: 1, dest: h, dstart: 1, dend: 1   (Google
 Pinyin IME and Nexus One stock IME do this)

 or

 source: he, start: 0, end: 2, dest: h, dstart: 0, dend: 1
 (essentially overwriting the entire text each time)

 This is not just one IME behaving like this...

 Anyone else experience 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


[android-developers] Re: Plz help. android emulator on eclipse

2010-07-19 Thread karteek
If you want to give your desired string go and edit the following
res-values-strings.xml hello

On Jul 19, 12:24 pm, xuxu shlomitmay...@gmail.com wrote:
 Hi all,
 I'm newbie with android and eclipse and I got this strange
 thing...when ever I'm running little program that I write on the
 emulator I'm getting: Hello android, program_name
 for example: I'm writing a little program could udp_client and I'm
 getting: Hello android, udp_client
 can someone tell me if this is the way it should be?
 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: Encrypt with Android using AES, decrypt with PHP...

2010-07-19 Thread DanH
Maybe it's because there's nothing special you need to do.

On Jul 19, 6:10 am, sblantipodi perini.dav...@dpsoftware.org wrote:
 it's quite incredible, no article on internet talks about cypher with
 android and php or servlet...

 On Jul 18, 8:46 pm, sblantipodi perini.dav...@dpsoftware.org wrote:

  Hi,
  is there some code snippet that show how to encrypt a password with
  Android
  and then decrypt it with php?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Sorry, this video cannot be played on Nexus one 2.2

2010-07-19 Thread Mark Murphy
On Mon, Jul 19, 2010 at 7:53 AM, zohar lerman lirazo...@gmail.com wrote:
 Thanks but it still not working.
 Any other idea?

Not really. If it is getting to a video player activity, and that
activity is complaining that it cannot play the video, the most likely
scenarios are that the video file is corrupt or there is a
bug/regression in Android.

-- 
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 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] Re: Sorry, this video cannot be played on Nexus one 2.2

2010-07-19 Thread zohar lerman
I guess it is the second option since the same file works as expected
on htc 1.5

On Jul 19, 3:01 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Mon, Jul 19, 2010 at 7:53 AM, zohar lerman lirazo...@gmail.com wrote:
  Thanks but it still not working.
  Any other idea?

 Not really. If it is getting to a video player activity, and that
 activity is complaining that it cannot play the video, the most likely
 scenarios are that the video file is corrupt or there is a
 bug/regression in Android.

 --
 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] Re: Which one to buy ? Droid x vs nexus one ?

2010-07-19 Thread String
If you're using 2.2 features, the Nexus One is currently your only
hardware choice for an officially-supported 2.2 build. 2.2 is only
available for other handsets on custom ROMs, and this does not include
the Droid X at present. Given the apparent lockdown of the X by
Motorola, it may never run custom ROMs.

But even apart from that, IMHO the Nexus One is the closest thing to a
reference handset for the current generation of Android devices, and
it has the best developer support from Google. It'd get my vote as
your best choice for a dev phone.

String

On 19 July, 09:55, Kim D. kdame...@gmail.com wrote:
 Hi,

 For my tests I have to buy a real android phone. Emulator is cool but
 I need a real one to really test my application.

 Does anyone know which one is the more representative and the best to
 test my application ? (my target is android 2.2)

 Thanks,
 Kim

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 disable pop up blocker in emulator 2.1

2010-07-19 Thread Sohan badaya
Hi All,

when i open some urls in emulator 2.1, it gives me message First
disable pop up blocker.
please let me know how to do it.

Thanks

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


Re: [android-developers] Re: Encrypt with Android using AES, decrypt with PHP...

2010-07-19 Thread Raymond C. Rodgers
There is slightly. You need to null pad the data being encrypted to make 
sure it's evenly divisible by 16 on Android. PHP does it automatically 
and silently. See my posts in this thread:


http://groups.google.com/group/android-developers/browse_thread/thread/022e3b4b61de9a7c?pli=1

Raymond

On 7/19/2010 7:58 AM, DanH wrote:

Maybe it's because there's nothing special you need to do.

On Jul 19, 6:10 am, sblantipodiperini.dav...@dpsoftware.org  wrote:
   

it's quite incredible, no article on internet talks about cypher with
android and php or servlet...

On Jul 18, 8:46 pm, sblantipodiperini.dav...@dpsoftware.org  wrote:

 

Hi,
is there some code snippet that show how to encrypt a password with
Android
and then decrypt it with php?
   
   


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


[android-developers] Is face recognition and tagging of faces possible through API?

2010-07-19 Thread prachi
Hii

Im  looking for some help to detect faces in group photograph and then
add some comments to each face as we do in picasa.

As pere as detecting faces is concerned i found the API in android but
to tag each face with some comments i could not find any API.

Please help me.

Is it possible in android??

Are there any APIs for it???

If not then can u tell me if picasa has exposed this feature in its
API?? Any idea???

Any help would be appreciated:)

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


[android-developers] Center MapView on new added GeoPoint in ItemizedOverlay

2010-07-19 Thread LaVision
Hi all,

I'm adding a single GeoPoint to a MapView using ItemizedOverlay (a
derived class of my own in fact) and I'd like the MapView to go to
that new location instead of displaying the last (too far) one.
I know that this page (http://developer.android.com/resources/
tutorials/views/hello-mapview.html) reads You probably need to move
the map to find the new overlay item. but it's not user friendly at
all since I should show events' location precisely...
If anyone could have found a workaround, I would be glad to try it as
well.

Regards,
LV.

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

2010-07-19 Thread Kim Damevin
Ok fine I will go for the nexus one then

On Mon, Jul 19, 2010 at 2:26 PM, String sterling.ud...@googlemail.comwrote:

 If you're using 2.2 features, the Nexus One is currently your only
 hardware choice for an officially-supported 2.2 build. 2.2 is only
 available for other handsets on custom ROMs, and this does not include
 the Droid X at present. Given the apparent lockdown of the X by
 Motorola, it may never run custom ROMs.

 But even apart from that, IMHO the Nexus One is the closest thing to a
 reference handset for the current generation of Android devices, and
 it has the best developer support from Google. It'd get my vote as
 your best choice for a dev phone.

 String

 On 19 July, 09:55, Kim D. kdame...@gmail.com wrote:
  Hi,
 
  For my tests I have to buy a real android phone. Emulator is cool but
  I need a real one to really test my application.
 
  Does anyone know which one is the more representative and the best to
  test my application ? (my target is android 2.2)
 
  Thanks,
  Kim

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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] Application is not installed on your phone

2010-07-19 Thread JOBZ

 In the log cat  below errors are showing


   17:11:10 - GolfLogix]adb is running normally.
[2010-07-17 17:11:10 - GolfLogix]Performing
com.golflogix.ui.startup.SplashScreen activity launch
[2010-07-17 17:11:11 - GolfLogix]Application already deployed. No need
to reinstall.
[2010-07-17 17:11:11 - GolfLogix]Starting activity
com.golflogix.ui.startup.SplashScreen on device
[2010-07-17 17:11:12 - GolfLogix]ActivityManager: Starting: Intent
{ cmp=com.golflogix.ui/.startup.SplashScreen }
[2010-07-17 17:11:13 - GolfLogix]ActivityManager:
java.lang.SecurityException: Permission Denial: starting Intent
{ flg=0x1000 cmp=com.golflogix.ui/.startup.SplashScreen } from
null (pid=-1, uid=-1) requires
android.permission.WRITE_SECURE_SETTINGS


Already i set the  WRITE_SECURE_SETTINGS  permission in my manifest
file. I don't know why this errors are showing .anybody have any
solution for this  problem.

Thanks
  Jobz

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

2010-07-19 Thread Mark Murphy
You cannot hold the WRITE_SECURE_SETTINGS permission unless you are
part of the firmware.

On Mon, Jul 19, 2010 at 9:23 AM, JOBZ joby...@gmail.com wrote:

  In the log cat  below errors are showing


   17:11:10 - GolfLogix]adb is running normally.
 [2010-07-17 17:11:10 - GolfLogix]Performing
 com.golflogix.ui.startup.SplashScreen activity launch
 [2010-07-17 17:11:11 - GolfLogix]Application already deployed. No need
 to reinstall.
 [2010-07-17 17:11:11 - GolfLogix]Starting activity
 com.golflogix.ui.startup.SplashScreen on device
 [2010-07-17 17:11:12 - GolfLogix]ActivityManager: Starting: Intent
 { cmp=com.golflogix.ui/.startup.SplashScreen }
 [2010-07-17 17:11:13 - GolfLogix]ActivityManager:
 java.lang.SecurityException: Permission Denial: starting Intent
 { flg=0x1000 cmp=com.golflogix.ui/.startup.SplashScreen } from
 null (pid=-1, uid=-1) requires
 android.permission.WRITE_SECURE_SETTINGS


 Already i set the  WRITE_SECURE_SETTINGS  permission in my manifest
 file. I don't know why this errors are showing .anybody have any
 solution for this  problem.

 Thanks
  Jobz

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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 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] Re: How to get all the children views of a layout

2010-07-19 Thread PingoWingo
Hello,

Thank you all for your input.
I actually wanted to know a way to grab all the children of a layout
manager so I can 'programmatically' set the width depending on the
screen size, for example.
If there are better ways to do this, please let me know.
Otherwise, I will go with Mark's suggestion on using
getChildCount() and getChildAt().

Thanks!


On Jul 15, 5:55 pm, Matt matthew.quig...@gmail.com wrote:
  what were they thinking when they named this
  parameter layout_width? Doesn't the very name naturally suggest a
  numeric value measuring the width, rather than rule for deriving that
  value from elsewhere?

 You actually can set the layout_width to a numeric value measuring the
 width.  For example, 100dip, or just 100px, if you wanted.
 FILL_PARENT and WRAP_CONTENT are special cases, corresponding to the
 numbers -1 and -2.

 -Matt

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


[android-developers] Re: How to get all the children views of a layout

2010-07-19 Thread PingoWingo
Hello,

Thanks all for your input.
I actually wanted to know how to grab all the children of a layout-
manager parent so that I can set an attribute programmatically,  In my
case, it was to set the layout_width of each child depending on the
screen size which I assume cannot be determined at the XML level.

If there are better ways, please do let me know.
Otherwise, I will go with Mark's suggestion on using
getChildCount() and getChildAt() methods.

Thanks!

On Jul 15, 5:55 pm, Matt matthew.quig...@gmail.com wrote:
  what were they thinking when they named this
  parameter layout_width? Doesn't the very name naturally suggest a
  numeric value measuring the width, rather than rule for deriving that
  value from elsewhere?

 You actually can set the layout_width to a numeric value measuring the
 width.  For example, 100dip, or just 100px, if you wanted.
 FILL_PARENT and WRAP_CONTENT are special cases, corresponding to the
 numbers -1 and -2.

 -Matt

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


[android-developers] Problem Loading Images via Adapter on Zero Index

2010-07-19 Thread Jason Van Anden
Hi All,

I am attempting to load a series of images into a 3x3 gridview.  When the
user refreshes the screen I want images to load into each imageview
randomly.  All of the images load properly - except index zero (topmost
leftmost).  In testing, this will work the first time I load if zero happens
to be the first index randomly picked - but thereafter - nothing.  I suspect
the trouble is in how I am dealing with getView within the BaseAdapter.
Here is what I have:

public View getView(int position, View convertView, ViewGroup
parent)
{
ImageView imageView = (ImageView)convertView;

if (convertView == null) {
imageView = new ImageView(context);
imageView.setLayoutParams(new GridView.LayoutParams(85,
85));
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
imageView.setPadding(1, 1, 1, 1);
imageView.setOnClickListener(ShowArtistSummary);
imageView.setAnimation(anim_fade_in);

} else {
imageView = (ImageView) convertView;
}

imageViews[position] = imageView;
return imageView;
}

The imageViews array is used later to load the bitmaps randmly.

Help appreciated.

j

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Best Practice for Multi-Activity App that Uses a Remote Service?

2010-07-19 Thread Jin Chiu
We have a multi-activity app that needs to communicate with a remote
service with a callback interface. Each activity needs to access the
remote service and receive callback messages from it (either directly
or indirectly). What are some good practices for designing this? Here
are some options:

- store the reference to the service reference in the global
Application Context and have it implement the callback interface
(don't know if this is possible)
- have each activity implement the callback interface and communicate
with the service using its own IPC channel
- Have 1 activity own the service reference and implements the
callback interface (thus serving as hub for all IPC activity). We do
run into a problem that this activity's lifetime may be shorter than
the foreground activity that depends on it to send RPC messages.

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

2010-07-19 Thread arnouf
Hi,

I don't agree with you mark, because there are some differents apps on
market replacing lock screen without change the installed firmware or
change root access.

On Jul 7, 9:03 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Mon, Jul 5, 2010 at 2:15 PM, Sy simonaplat...@googlemail.com wrote:
  Is it possible to override the default androidlockscreenand replace
  with your own?

 Only by creating your own firmware. There are no APIs for replacing
 thelockscreenat this time.

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

 _Android Programming Tutorials_ Version 2.8 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] Possible to gather application logs at runtime?

2010-07-19 Thread Jin Chiu
To facilitate diagnostics while the app has been deployed, does
Android provide any API to facilitate runtime logging? It would be
ideal if the app could retrieve all the messages it wrote to the
Logging System via the Log API functions.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Any Archos5 owners able to help debug a problem?

2010-07-19 Thread Paul Gee
Hi,

I am looking for any Archos5 owners who can help me debug a problem with my
app (PuzzleQube) that appears to only occur on this particular device. Over
50 other phone/device types have no problem.

 

From my crash reporting I see that a crash occurs with the following stack
trace:

java.lang.IllegalArgumentException

  at com.google.android.gles_jni.EGLImpl.eglSwapBuffers(Native Method)

  at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:901)

  at
android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1114)

  at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:968)

 

All the calls listed are outside my code and inside the core Android
libraries. My app uses OpenGL and GLSurfaceView and I let GLSurfaceView set
the surface parameters so I am uncertain why the above problem should occur.
Perhaps someone has some thoughts?

 

If any Archos5 owners are willing to spend some time  helping me to debug (I
could send a debug version of my code with the OpenGL debug turned on) I
would be very grateful.

 

Regards, Paul

 

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

2010-07-19 Thread Mark Murphy
On Mon, Jul 19, 2010 at 9:56 AM, arnouf arnaud.far...@gmail.com wrote:
 I don't agree with you mark, because there are some differents apps on
 market replacing lock screen without change the installed firmware or
 change root access.

Those are not replacement lock screens. Those use malware techniques.

Google has said on this list, repeatedly, that there are no APIs for
replacing the lock screen nor any near-term plans to add any.

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


Re: [android-developers] Possible to gather application logs at runtime?

2010-07-19 Thread Mark Murphy
http://code.google.com/p/android-log-collector/

On Mon, Jul 19, 2010 at 9:59 AM, Jin Chiu live2drea...@gmail.com wrote:
 To facilitate diagnostics while the app has been deployed, does
 Android provide any API to facilitate runtime logging? It would be
 ideal if the app could retrieve all the messages it wrote to the
 Logging System via the Log API functions.

-- 
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 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] make application should support all versions and screens

2010-07-19 Thread aswani kumar tholeti
Hi folks

i want to develop application that should support all version (latest and
old ) and it should adjust screen resolution(large,medium)

i read document.there i found legacy application if i develop application in
1.6

there i am giving

uses-sdk android:minSdkVersion=3 android:targetSdkVersion=4/

is it good way to develop application and is it support 1.5 and 1.5+

user able find my application there market.please share your any ideas to
me


Thanks in advance

Aswan

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

2010-07-19 Thread ameya dandekar
Hi,
 I am currently working on an app in which i use The VideoView for media
playback. I want to actually hide the play controls (i.e play/pause) when
the video starts and want them back on tap on the videoview .I used the
onTouchListener as well as onClickListener on VideoView .But they both seems
nt getting fired. Is there any other way ?

Thanks and Regards,
Ameya

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

[android-developers] Re: GridView - setting selection to last item also loads first item

2010-07-19 Thread robotissues
This looks like it solves my problem too, except that I need to target
1.5 and setTag is 1.6 +. Suggestions?
j

On Jun 12, 5:43 pm, Goran Genter goran.gen...@gmail.com wrote:
 Thanks for the tip.

 I've done like you said and it's exactly what I needed.

 Best regards,
 Goran Genter

 On Jun 12, 10:40 pm, Streets Of Boston flyingdutc...@gmail.com
 wrote:

  Use the convertView.setTag to set an identifier that your AsyncTask
  can recognize when the image has been loaded.
  Don't rely on the order in which the getView gets called (with respect
  to its 'position' parameter).

  On Jun 12, 4:35 pm, Goran Genter goran.gen...@gmail.com wrote:

   Greetings everyone,

   I'm developing application that shows thumbnails of images in gridview
   widget. I load html with image names, and set ImageAdapter. That image
   adapter loads single image (from internet or SD card) in AsyncTask
   with selected image position. After I initialy download html with
   image names, and parse them to array, I set selection of GridView to
   index of last image. But, what happens is this : first image that gets
   downloaded is image with index zero. That gives me a lot of trouble
   because i'm using convert views and AsyncTasks, so sometimes I end up
   with wrong picture at first column in last row (sometimes picture with
   index 0 gets in there), depending on which AsyncTask gets executed
   first. Even stranger, I end up with around 10 calls to getView for
   image with index 0.

   Does anyone have idea how to switch GridViews position to last image,
   and not have image with index 0 loading?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 add my jar to add-ons as API for other app, like Google Map API ?

2010-07-19 Thread Boern
thx,Mark Murphy !

On Mon, Jul 19, 2010 at 7:00 PM, Mark Murphy mmur...@commonsware.comwrote:

 On Mon, Jul 19, 2010 at 4:13 AM, Boern cayso...@gmail.com wrote:
 I want to public my jar to other app as API  and I found the google
 Maps
  API is added to android as and-ons,so how can I add my jar to add-ons?

 Write your own firmware. Add-ons are part of the firmware.

  Or is any other way to public my jar API to the third app and my jar has
  included the android API, how to implement that idea ?

 Write an application that exposes an Android API (AIDL-based service,
 Intent-based service, ContentProvider, etc.), package that application
 as an APK, and distribute the APK.

 --
 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 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Boern Z

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: GridView - setting selection to last item also loads first item

2010-07-19 Thread Mark Murphy
On Mon, Jul 19, 2010 at 10:43 AM, robotissues jason.van.an...@gmail.com wrote:
 This looks like it solves my problem too, except that I need to target
 1.5 and setTag is 1.6 +. Suggestions?

setTag() is 1.0+. Indexed setTag() is 1.6+.

-- 
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 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] Re: Receiving UDP Broadcasts

2010-07-19 Thread elpix1
Hi .

We are also having the same problem.
Our application worked flawlessly with 1.5, 1.6 and 2.0,
but doesn't receive UDP broadcasts any more with
HTC HERO 2.1  and HTC EVO 2.1.

Curiously it worked with Nexus One 2.1 and works
with 2.2.

We also found this issue:
http://code.google.com/p/android/issues/detail?id=8407


Best regards.



On Jul 14, 7:37 pm, Frank Neuhaus dta...@gmail.com wrote:
 Hey,

 I am trying to receive aUDPBroadcast sent by another app on my
 network. I am testing on a HTC Desire Firmware: 2.1-update1. As usual
 I am using a MulticastSocket and before listening, I acquire a
 multicast lock using:

         WifiManager wifi =
 (WifiManager)getSystemService(Context.WIFI_SERVICE);
         lock = wifi.createMulticastLock(mylock);
         lock.setReferenceCounted(true);
         lock.acquire();

 My app permissions include both INTERNET and
 CHANGE_WIFI_MULTICAST_STATE

 The problem is that my program doesn't receive the broadcast. If I
 send the packet directly to my phone's ip-adress, it works without
 changing any code.

 Does anyone have any idea whats wrong? Is this a bug? Is it specific
 to my phone? Is there anything I can do to make this work? :/

 Thanks a lot
    Frank

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 Loading Images via Adapter on Zero Index

2010-07-19 Thread Jason Van Anden
Okay - I figured out something.  Hope this helps someone else.

This post had a similar issue:
http://groups.google.com/group/android-developers/browse_thread/thread/8d3f9c450d00d8a6/ffd344b52f707f57

But I need to target 1.5 so setTag won't work.  Instead I adjusted the if
statement to check to see if the image had already been instantiated a la:

if ((convertView == null)  (imageViews[position] == null)) {

Jason Van Anden
http://www.bubblebeats.com

On Mon, Jul 19, 2010 at 9:45 AM, Jason Van Anden
jason.van.an...@gmail.comwrote:

 Hi All,

 I am attempting to load a series of images into a 3x3 gridview.  When the
 user refreshes the screen I want images to load into each imageview
 randomly.  All of the images load properly - except index zero (topmost
 leftmost).  In testing, this will work the first time I load if zero happens
 to be the first index randomly picked - but thereafter - nothing.  I suspect
 the trouble is in how I am dealing with getView within the BaseAdapter.
 Here is what I have:

 public View getView(int position, View convertView, ViewGroup
 parent)
 {
 ImageView imageView = (ImageView)convertView;

 if (convertView == null) {
 imageView = new ImageView(context);
 imageView.setLayoutParams(new GridView.LayoutParams(85,
 85));
 imageView.setScaleType(ImageView.ScaleType.FIT_XY);
 imageView.setPadding(1, 1, 1, 1);
 imageView.setOnClickListener(ShowArtistSummary);
 imageView.setAnimation(anim_fade_in);

 } else {
 imageView = (ImageView) convertView;
 }

 imageViews[position] = imageView;
 return imageView;
 }

 The imageViews array is used later to load the bitmaps randmly.

 Help appreciated.

 j


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Lifetime of background parent activity after startActivityForResult()

2010-07-19 Thread Jin Chiu
Is there an exception in the lifetime rules for a parent activity
that's in the background after invoking startActivityForResult()? From
my understanding, in low memory scenarios, the background activities
are killed before the foreground. Does this rule still apply even if
the background activity started the foreground one for the purpose of
obtaining some result?

In this case, I think it would make sense for the foreground child
activity to get killed first or to equalize the lifetime of the parent
and child.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Center MapView on new added GeoPoint in ItemizedOverlay

2010-07-19 Thread Frank Weiss
I suppose you just need this in the right place in your code:

mapView.getController().setCenter(centerPoint);
mapView.getController().setZoom(defaultZoom); // optional

where centerPoint is the GeoPoint of the item.

I don't see any other way to do 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: Encrypt with Android using AES, decrypt with PHP...

2010-07-19 Thread Bob Kerns
That's not something special. That's actually what the algorithms are
specified to require, and the APIs reflect that. They're not even
Android-specific APIs, they're Java APIs, and the algorithms are
standards and not tied to language or platform.

Ideally, you'd pad with random bytes, instead of null bytes, which
probably weaken the encryption significantly -- any time an attacker
knows part of the message, it makes his job simpler.

So I'd say PHP's behavior is a special case, and even a design flaw
(both a convenience AND a design flaw, viewed from the standpoint of
conflicting requirements).

On Jul 19, 5:45 am, Raymond C. Rodgers raym...@badlucksoft.com
wrote:
 There is slightly. You need to null pad the data being encrypted to make
 sure it's evenly divisible by 16 on Android. PHP does it automatically
 and silently. See my posts in this thread:

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

 Raymond

 On 7/19/2010 7:58 AM, DanH wrote:



  Maybe it's because there's nothing special you need to do.

  On Jul 19, 6:10 am, sblantipodiperini.dav...@dpsoftware.org  wrote:

  it's quite incredible, no article on internet talks about cypher with
  android and php or servlet...

  On Jul 18, 8:46 pm, sblantipodiperini.dav...@dpsoftware.org  wrote:

  Hi,
  is there some code snippet that show how to encrypt a password with
  Android
  and then decrypt it with php?

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

2010-07-19 Thread ecforu
If I pass a cursor to a simplecursoradapter, do I still need to close the
cursor?  if so when: after I pass it to the adapter or when the adapter is
finished?

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] Nexus One Testing

2010-07-19 Thread Shane Isbell
This problem is solved, thanks for everyone who pitched in and helped. It
was an NPE and had to do with the PackageInfo containing some null fields on
certain distributions of N1s.

On Sun, Jul 18, 2010 at 2:30 PM, Shane Isbell shane.isb...@gmail.comwrote:

 Thanks for checking. Maybe it's an Android 2.1 problem on Nexus. I'll check
 around some more and see if I can narrow it down. It definitely works on the
 emulators for those versions.


 On Sun, Jul 18, 2010 at 2:18 PM, Agus agus.sant...@gmail.com wrote:

 works fine on my Nexus One 2.2

 On Sun, Jul 18, 2010 at 2:05 PM, Shane Isbell shane.isb...@gmail.com
 wrote:
  Can someone with a Nexus One download AppFriend from android market (qr
 code
  - http://www.zappmarket.com/catalog/27) and give me a stack trace of
 the
  error message? I've got reports coming in that it crashes on startup
 (and
  the nice 1 star reviews that follow). The code that it is breaking on is
  really simple, so I'm not sure what the incompatibility could be, as it
  works on G1 and Magic. Thanks for any help.
 
  --
  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.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




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




-- 
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] WebView and Android 1.5

2010-07-19 Thread Justin
I've come across a peculiar problem in one of my apps recently.  I
have a WebView that pulls down a webpage using loadUri(). This is
being loaded into an activity that has just the WebView and a Button
below the WebView inside a RelativeLayout.  It works fine in the
emulator on Android 1.6, 2.1, and 2.2.  However, it does not show the
webpage in Android 1.5.  To strip things down to a bare minimum, I
used the following code from the API docs and tested it with similar
results:

-
   final Activity activity = this;

// Let's display the progress in the activity title bar, like
the
// browser app does.
WebView webview = (WebView) findViewById(R.id.my_web_view);

webview.getSettings().setJavaScriptEnabled(true);

webview.setWebChromeClient(new WebChromeClient() {
  public void onProgressChanged(WebView view, int progress) {
// Activities and WebViews measure progress with different
scales.
// The progress meter will automatically disappear when we
reach 100%
  activity.setProgress(progress * 1000);
  }
});
webview.setWebViewClient(new WebViewClient() {
  public void onReceivedError(WebView view, int errorCode,
String description, String failingUrl) {
Toast.makeText(activity, Oh no!  + description,
Toast.LENGTH_SHORT).show();
  }
});

webview.loadUrl(http://slashdot.org/;);




Any thoughts as to what might be v1.5 specific that would cause this
to not work?  Am I missing something here?

Thanks,

Justin

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

2010-07-19 Thread droidsan
Hi,

What's the reason why a Toast should not be created from a
BroadcastReceiver?

Creating a Toast from a BroadcastReceiver (generated via XML) works
well even if the Creating Toast Notifications documentation only
mentions that Toasts can be created by Activities or Services (see
http://developer.android.com/guide/topics/ui/notifiers/toasts.html). I
am interested in the reason why a Toast should not be created from a
BroadcastReceiver and what could happen (in the worst case) if it is
created from a BroadcastReceiver.

Thanks for your replies.

Droid-san

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

2010-07-19 Thread Raymond C. Rodgers
Well, I'm not talking security wise, just compatibility wise, nor did I 
say that this was Android specific. However, what I did say was that you 
do have to do this in order to get PHP-Android encryption working. 
Android to PHP encryption with AES will not just work without adding 
the null padding or some other mutually recognized padding, so I'd say 
that yes this is slightly special as I stated before.


On 7/19/2010 11:32 AM, Bob Kerns wrote:

That's not something special. That's actually what the algorithms are
specified to require, and the APIs reflect that. They're not even
Android-specific APIs, they're Java APIs, and the algorithms are
standards and not tied to language or platform.

Ideally, you'd pad with random bytes, instead of null bytes, which
probably weaken the encryption significantly -- any time an attacker
knows part of the message, it makes his job simpler.

So I'd say PHP's behavior is a special case, and even a design flaw
(both a convenience AND a design flaw, viewed from the standpoint of
conflicting requirements).

On Jul 19, 5:45 am, Raymond C. Rodgersraym...@badlucksoft.com
wrote:
   

There is slightly. You need to null pad the data being encrypted to make
sure it's evenly divisible by 16 on Android. PHP does it automatically
and silently. See my posts in this thread:

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

Raymond

On 7/19/2010 7:58 AM, DanH wrote:



 

Maybe it's because there's nothing special you need to do.
   
 

On Jul 19, 6:10 am, sblantipodiperini.dav...@dpsoftware.orgwrote:
   
 

it's quite incredible, no article on internet talks about cypher with
android and php or servlet...
 
 

On Jul 18, 8:46 pm, sblantipodiperini.dav...@dpsoftware.orgwrote:
 
 

Hi,
is there some code snippet that show how to encrypt a password with
Android
and then decrypt it with php?
   
   


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Cannot find gen folder... it's right there!

2010-07-19 Thread DulcetTone
I have Eclipse build issues.
I am running ADT 0.9.7 from 1157 May 7th 2010 and a freshly-updated
copy of Eclipse 3.5 IDE for Java

I have an Android project which depends on an underlying Core
Android project, and it claims not to find its gen folder, though it
is exactly where it has ever been (though the project dependency is a
new wrinkle).  The project properties shows that it knows where it
lives.

Any ideas?

Tony


Here is how the .log file reports the issue:


!ENTRY org.eclipse.jdt.ui 4 10001 2010-07-19 11:25:23.592
!MESSAGE Internal Error
!STACK 1
Java Model Exception: Java Model Status [gen [in CD1] does not exist]
at
org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:
502)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:
246)
at
org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:
515)
at
org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:
252)
at
org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:
238)
at
org.eclipse.jdt.internal.core.PackageFragmentRoot.getKind(PackageFragmentRoot.java:
477)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:
645)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.handleAffectedChildren(PackageExplorerContentProvider.java:
791)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:
734)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.handleAffectedChildren(PackageExplorerContentProvider.java:
791)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.processDelta(PackageExplorerContentProvider.java:
734)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerContentProvider.elementChanged(PackageExplorerContentProvider.java:
124)
at org.eclipse.jdt.internal.core.DeltaProcessor
$3.run(DeltaProcessor.java:1557)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:
1547)
at
org.eclipse.jdt.internal.core.DeltaProcessor.firePostChangeDelta(DeltaProcessor.java:
1381)
at
org.eclipse.jdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:
1357)
at
org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:
1958)
at
org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:
470)
at org.eclipse.core.internal.events.NotificationManager
$2.run(NotificationManager.java:291)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:
285)
at
org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:
149)
at
org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:
313)
at
org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:
1022)
at
org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:
45)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!SUBENTRY 1 org.eclipse.jdt.core 4 969 2010-07-19 11:25:23.592
!MESSAGE gen [in CD1] does not exist



!ENTRY org.eclipse.core.resources 8 2 2010-07-19 11:25:27.803
!MESSAGE Problems occurred when invoking code from plug-in:
org.eclipse.core.resources.
!STACK 1
org.eclipse.core.runtime.CoreException: 'aapt' error. Pre Compiler
Build aborted.
at
com.android.ide.eclipse.adt.internal.build.BaseBuilder.stopBuild(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.build.PreCompilerBuilder.execAapt(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.build.PreCompilerBuilder.handleResources(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.build.PreCompilerBuilder.build(Unknown
Source)
at org.eclipse.core.internal.events.BuildManager
$2.run(BuildManager.java:627)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:
170)
at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:
201)
at org.eclipse.core.internal.events.BuildManager
$1.run(BuildManager.java:253)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:
256)
at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:
309)
at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:
341)
at 

[android-developers] Unpublished app still can be purchased?

2010-07-19 Thread Ken
I took down one of my apps a few days ago, however I am still seeing
purchases trickling in even though I can no longer see my app on the
market. Where did they purchase the app from?

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

2010-07-19 Thread Justin Giles
Ok, through trial and error I seem to have things working in 1.5 now.  For
some reason, all versions  1.5 the pages load fine.  However in v1.5, I'm
needing to put a webview.bringToFront() after the page load.  Seems strange,
but that line fixed things.



On Mon, Jul 19, 2010 at 11:05 AM, Justin jtgi...@gmail.com wrote:

 I've come across a peculiar problem in one of my apps recently.  I
 have a WebView that pulls down a webpage using loadUri(). This is
 being loaded into an activity that has just the WebView and a Button
 below the WebView inside a RelativeLayout.  It works fine in the
 emulator on Android 1.6, 2.1, and 2.2.  However, it does not show the
 webpage in Android 1.5.  To strip things down to a bare minimum, I
 used the following code from the API docs and tested it with similar
 results:

 -
   final Activity activity = this;

// Let's display the progress in the activity title bar, like
 the
// browser app does.
WebView webview = (WebView) findViewById(R.id.my_web_view);

webview.getSettings().setJavaScriptEnabled(true);

webview.setWebChromeClient(new WebChromeClient() {
  public void onProgressChanged(WebView view, int progress) {
// Activities and WebViews measure progress with different
 scales.
// The progress meter will automatically disappear when we
 reach 100%
  activity.setProgress(progress * 1000);
  }
});
webview.setWebViewClient(new WebViewClient() {
  public void onReceivedError(WebView view, int errorCode,
 String description, String failingUrl) {
Toast.makeText(activity, Oh no!  + description,
 Toast.LENGTH_SHORT).show();
  }
});

webview.loadUrl(http://slashdot.org/;);

 


 Any thoughts as to what might be v1.5 specific that would cause this
 to not work?  Am I missing something here?

 Thanks,

 Justin

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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: Encrypt with Android using AES, decrypt with PHP...

2010-07-19 Thread sblantipodi
OK...
I'm using this class to encrypt/decrypt in android.
public class SimpleCrypto {

public static String encrypt(String seed, String cleartext) throws
Exception {
byte[] rawKey = getRawKey(seed.getBytes());
byte[] result = encrypt(rawKey,
cleartext.getBytes());
return toHex(result);
}

public static String decrypt(String seed, String encrypted) throws
Exception {
byte[] rawKey = getRawKey(seed.getBytes());
byte[] enc = toByte(encrypted);
byte[] result = decrypt(rawKey, enc);
return new String(result);
}

private static byte[] getRawKey(byte[] seed) throws Exception {
KeyGenerator kgen = KeyGenerator.getInstance(AES);
SecureRandom sr = SecureRandom.getInstance(SHA1PRNG);
sr.setSeed(seed);
kgen.init(128, sr); // 192 and 256 bits may not be available
SecretKey skey = kgen.generateKey();
byte[] raw = skey.getEncoded();
return raw;
}


private static byte[] encrypt(byte[] raw, byte[] clear) throws
Exception {
SecretKeySpec skeySpec = new SecretKeySpec(raw, AES);
Cipher cipher = Cipher.getInstance(AES);
cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
byte[] encrypted = cipher.doFinal(clear);
return encrypted;
}

private static byte[] decrypt(byte[] raw, byte[] encrypted) throws
Exception {
SecretKeySpec skeySpec = new SecretKeySpec(raw, AES);
Cipher cipher = Cipher.getInstance(AES);
cipher.init(Cipher.DECRYPT_MODE, skeySpec);
byte[] decrypted = cipher.doFinal(encrypted);
return decrypted;
}

public static String toHex(String txt) {
return toHex(txt.getBytes());
}
public static String fromHex(String hex) {
return new String(toByte(hex));
}

public static byte[] toByte(String hexString) {
int len = hexString.length()/2;
byte[] result = new byte[len];
for (int i = 0; i  len; i++)
result[i] = Integer.valueOf(hexString.substring(2*i, 
2*i+2),
16).byteValue();
return result;
}

public static String toHex(byte[] buf) {
if (buf == null)
return ;
StringBuffer result = new StringBuffer(2*buf.length);
for (int i = 0; i  buf.length; i++) {
appendHex(result, buf[i]);
}
return result.toString();
}
private final static String HEX = 0123456789ABCDEF;
private static void appendHex(StringBuffer sb, byte b) {
sb.append(HEX.charAt((b4)0x0f)).append(HEX.charAt(b0x0f));
}

}

Now what I have understood is that I need to pass a base64 string to
PHP to get it working.
I'm able to do this in PHP, but I haven't understood what I need to
convert in BASE64.
If I convert into base64 the string outputted from String
encrypt(String seed, String cleartext)
PHP get a junk data when decrypting the string with mcrypt.
Have you got some idea?

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

2010-07-19 Thread Mike dg
Apps can still be gotten to through links. I think it was a side
effect of fixing the exploit where someone could unpublish an app and
there would be no way to get a refund.

On Jul 19, 12:36 pm, Ken ken0624...@gmail.com wrote:
 I took down one of my apps a few days ago, however I am still seeing
 purchases trickling in even though I can no longer see my app on the
 market. Where did they purchase the app from?

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


[android-developers] Re: Why not raise Toast from BroadcastReceiver

2010-07-19 Thread Mike dg
It's very  jarring to the user. There is no indication of what app the
toast is from. Why not just use a notification?

On Jul 19, 12:17 pm, droidsan droid...@googlemail.com wrote:
 Hi,

 What's the reason why a Toast should not be created from a
 BroadcastReceiver?

 Creating a Toast from a BroadcastReceiver (generated via XML) works
 well even if the Creating Toast Notifications documentation only
 mentions that Toasts can be created by Activities or Services 
 (seehttp://developer.android.com/guide/topics/ui/notifiers/toasts.html). I
 am interested in the reason why a Toast should not be created from a
 BroadcastReceiver and what could happen (in the worst case) if it is
 created from a BroadcastReceiver.

 Thanks for your replies.

 Droid-san

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

2010-07-19 Thread Arjun
Thanks Mark Murphy.

On Jul 14, 10:15 am, Mark Murphy mmur...@commonsware.com wrote:
 On Wed, Jul 14, 2010 at 12:53 PM,Arjunarjunf...@gmail.com wrote:
  I have few intents in my manifest file and an AIR application. How can
  I instantiate AIR application from android.

 You probably should ask Adobe that question.

 --
 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 *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] Android Socket Communication

2010-07-19 Thread Arjun
Please clarify me on the following issues.

How to assign a IP address to the emulator ?  I have two application
packages which communicate through sockets. Apk1 implements a server
socket and apk2 listens to the server content and read the responses.
How can I run two different apk's simultaneously so that android does
not kill any one of those app's ?

Thanks,
Arjun.

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

2010-07-19 Thread BA
I am quite new to Java, let alone Android. I am stuck with a problem
that I encountered while instrumenting (using the instrumentation
framework of android) the code of a Android project. I have a ListView
and using the getTouchables() API I have store the view in a
ArrayList. When in debug session, I saw that each view has children
(mChildren) when expanded I could see that there is a ImageView and
TextView present. when the TextView is expanded, I could access
the mText variable which contains the text value I am looking for. In
brief, the value I am looking for, when looking at the variables
window of the debug perspective of Eclipse, is present at myview-
mChildren-[1] (TextView)-mText-value.

Here myview is the name of the object of View class.

how do I access/ read the content of the value variable?

Please let me know if you need any info in this regard?

Thank you
-BA

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

2010-07-19 Thread ferar
android-ndk-r4/samples/hello-jni  as is works fine. However, if I
rename /hello-jni/jni/hello-jni.c to /hello-jni/jni/hello-jni.cpp,
Modify the code in that file as following:
-
include string.h
#include jni.h

/* This is a trivial JNI example where we use a native method
 * to return a new VM String. See the corresponding Java source
 * file located at:
 *
 *   apps/samples/hello-jni/project/src/com/example/HelloJni/
HelloJni.java
 */
jstring
Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env,
  jobject thiz )
{
return env-NewStringUTF(Hello from JNI !);
}

-
modify Android.mk to compile ello-jni.cpp, after successfully building
the native library, then the hello-jni project.

the problem occurs when trying to run hello-jni, a run-time exception
occurs related to UnsatisfiedLinkError !

is there a way to use *cpp* files *without* resorting to extern C to
disable mangling for android project?

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

2010-07-19 Thread Michael Angerman
Is this project Tiny ORM written by Shawn O. Pearce going to be equivalent
to

Hibernate in Java
ActiveRecord in Ruby
Doctrine in PHP

http://android.git.kernel.org/?p=tools/gwtorm.git;a=summary

Does any one know if Google is working on an ORM for Android...

What are the similarities and differences between Tiny ORM and the above
named projects ?

Why are protocol buffers being used in the ORM, I do not understand the
relationship
between protocol buffers and ORM concepts.

I found the above link by reading this blog post.

http://mobilebytes.wordpress.com/2009/06/14/android-orm-coming/

I have been hearing rumblings about this, but was just curious if
anyone has any further information.

Thanks,
Michael I Angerman

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

2010-07-19 Thread Andy
Hi all,

Does anyone know how to access ( using findViewById() for example)
buttons created by a Dialog Builder. Specifically the Positive button
created by the code below:

builder.setPositiveButton(R.string.dialog_button_save, new
DialogInterface.OnClickListener() {
public void 
onClick(DialogInterface dialog, int item){
   
   
}});

I have tried: android.R.id.button1, android.R.id.button2,
android.R.id.button3  with no luck.  Maybe they havnt got an id at
all?

Many thanks for any help.

Andy

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

2010-07-19 Thread Feisky
Has anyone get a App Inventor account? I'd like to get an account to
develop some programs, but now what can I do is just waiting...

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


[android-developers] How to do JUnit Testing for Android Phone.

2010-07-19 Thread Bharathi raja
Hi All,

Please anyone help me, how to do JUnit Testing for Android phone(Not
for Android application).

I have a doubt whether Junit Testing for android phone required
android source code or only class name are enough to do.



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


[android-developers] Android User Build.

2010-07-19 Thread pasi
Hi All,

I'm trying to make user build for one of my device. User build has
been generated but I'm not able to differentiate with eng build.
How to differentiate user build and eng build?

And one more thing when I flash user build to device phone app is
getting removed . I mean no phone app inside the device.

I have tried few below changes in .mk file(phone and dialerActivity)
but still phone app is missing in device.

LOCAL_MODULE_TAGS := user development eng

So my questions are :
How to differentiate user build and eng build?
What is the reason for phone app removal in user build and how to get
the phone app in user build ??

Any suggestion or help would be helpful for me.

Thanks in advance,
Prasanna

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


[android-developers] android sdk emulator question: how can I replace framework-res.apk?

2010-07-19 Thread Jeff
I made some changes to the framework-res.apk.  However, I don't know
if it is possible to push it to the emulator without having to rebuild
the entire system image.  Can someone help me here?

Thanks!
Jeff

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 create a DBAdapter object in class extends BaseExpandableListAdapter?

2010-07-19 Thread Dmitry
Hello there, I want to populate ExpandableListView from database. But
I can't create the DBAdapter object in class extends
BaseExpandableListAdapter, because I don't know what context must be
passed to DBAdapter constructor. I use DBAdapter db = new
DBAdapter(AutoContacts.this); but it doesn't work (AutoContacts is
main class extends Activity).
And here is DBAdapter constructor:
public DBAdapter(Context ctx) {
this.context = ctx;
DBHelper = new DatabaseHelper(context);
}

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

2010-07-19 Thread LA
Hello,

I have the android source 2.01 built in my ubuntu box.

I am trying to add a new locale on top of the existing ones in the
source.

I tried adding a new folder values-xx-xXX under frameworks/res/
res.

I have tried to update the sdk.mk with the new language.

I have also tried to change a bunch of make files that would point to
PRODUCT_LOCALES.

But i always end up getting the error:

make: *** No rule to make target `frameworks/base/core/res/res/values-
xx-xXX', needed by `out/target/common/obj/APPS/framework-
res_intermediates/src/R.stamp'.  Stop.

Can someone please point me in the right direction on how to add a new
locale resource to the source.





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

2010-07-19 Thread Evan Cummings
Hello All,

I am attempting to listen for system fired Intents, specifically
regarding text input, using a class extending BroadcastReceiver. I see
there is an Intent called ACTION_INPUT_METHOD_CHANGED
(android.intent.action.INPUT_METHOD_CHANGED) which I hope to be able
to use to know when the keyboard or text input is attempted by the
user. (I assume this intent will work as I can use an
InputMethodManager object to handle keyboard related tasks)

My java code:

package com.BroadcastReception;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;


public class InputMethodChangedReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context arg0, Intent arg1) {
// TODO Auto-generated method stub
if
(arg1.getAction().equals(android.intent.action.INPUT_METHOD_CHANGED))
{
Log.d(this.toString(), Event Fired);
}
}
}


My Manifest:

?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
  package=com.BroadcastReception
  android:versionCode=1
  android:versionName=1.0
application android:icon=@drawable/icon android:label=@string/
app_name
receiver android:name=.InputMethodChangedReceiver
android:enabled=true
intent-filter
action
android:name=android.intent.action.INPUT_METHOD_CHANGED/
action
/intent-filter
/receiver

/application

uses-permission android:name=android.permission.READ_INPUT_STATE/
uses-permission

/manifest

Using DDMS I never see my logs written, indicating to me that my
broadcast receiver is not functioning properly.

My question is this:

1) Is INPUT_METHOD_CHANGED the correct intent to receive on to
determine if the user is attempting to use the keyboard, and if not,
what would be the proper method to use to monitor to see if the user
opens up the keyboard, and

2) Am I doing something incorrect in listening for the event,
permissions, filters, etc? It would seem to me based on the resources
I've looked at it that I'm along the right track, but I must be
missing something!

I appreciate the help and responses

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

2010-07-19 Thread L A
Hello,

I have the android source 2.01 built in my ubuntu box.

I am trying to add a new locale on top of the existing ones in the
source.

I tried adding a new folder values-xx-xXX under frameworks/res/
res.

I have tried to update the sdk.mk with the new language.

I have also tried to change a bunch of make files that would point to
PRODUCT_LOCALES.

But i always end up getting the error:

make: *** No rule to make target
`frameworks/base/core/res/res/values-xx-xXX', needed by
`out/target/common/obj/APPS/framework-res_intermediates/src/R.stamp'.  Stop.

Can someone please point me in the right direction on how to add a new
locale resource to the source.

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

2010-07-19 Thread Gaelin
First I have my app running currently and its working fine, I just
question how I implemented it.  I come from a linear C++ background
and this Activity/Intent thing is a little new to me.  Here is how my
app works currently (order of activities started) (- = Starts
Activity, - = Returns from activity)

MainActivity
- Login Activity
- onActivityResult
function displayListOfItems
...

I am wondering if I should switch the starting intent as follows:

LoginActivity
MainActivity
function displayListOfItems
...

The issue I had with the second scenario was that pressing the back
hard key would take me from the MainActivity back to the LoginActivity
and I didn't like this.  I guess to sum up my question, is it normal
for the MainActivity to handle all subsequent starting of activities
or is it common to do a more linear implementation?

--G

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

2010-07-19 Thread black adder
I am quite new to Java, let alone Android. I am stuck with a problem
that I encountered while instrumenting (using the instrumentation
framework of android) the code of a Android project. I have a ListView
and using the getTouchables() API I have store the view in a
ArrayList. When in debug session, I saw that each view has children
(mChildren) when expanded I could see that there is a ImageView and
TextView present. when the TextView is expanded, I could access
the mText variable which contains the text value I am looking for. In
brief, the value I am looking for, when looking at the variables
window of the debug perspective of Eclipse, is present at myview-
mChildren-[1] (TextView)-mText-value.

Here myview is the name of the object of View class.

how do I access/ read the content of the value variable?

Please let me know if you need any info in this regard?

Thank you
-BA

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

2010-07-19 Thread Mattias Nilsson
Hi

I've written a simple class that should create objects from a given
XML file. This works fine when I run it on desktop but when I run the
exact same code on android it doesn't find anything...

It doesn't cast any exceptions but at the end area is still null and
boulders an empty list. The problem is that I don't know how to start
analyzing the problem...

I'm pasting my parser code and the content of a file that I know don't
work (when run on Android 1.6 on a HTC Tatto)


import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

import javax.xml.parsers.SAXParserFactory;

import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;


public class XMLParser implements ContentHandler {
private XMLReader reader;
private String name;
private String description;
private String boulderName;
private String boulderGrade;
private String boulderDescription;
private float longi, lati;
private boolean area = false;
private boolean boulder = false;
private boolean path = false;
private ListBoulder boulders;

public XMLParser() {
try{
SAXParserFactory spf = SAXParserFactory.newInstance();
reader = spf.newSAXParser().getXMLReader();
reader.setContentHandler(this);
}
catch(Exception e) {

}
}

public void parse(File input) throws IOException, SAXException {
InputStream stream = new FileInputStream(input);

reader.parse(new InputSource(stream));
}

@Override
public void characters(char[] ch, int start, int length)
throws SAXException {
String text = (new String(ch, start, length)).trim();

if( path ) {
parsePath(text);
}
else if( boulder ) {
Scanner scanner = new Scanner(new String(ch, start, 
length));
parseBoulder(scanner);
}
else if( area ) {
parseArea(text);
}
else {
throw new SAXException(Unable to parse, unknown 
state.);
}
}

// TODO: rewrite, is completely without grace
private void parseArea(String text) {
Scanner scanner = new Scanner( text );

String name = scanner.findInLine(name\\s*=\\s*\.+\);
if( name != null ) {
name = name.substring(name.indexOf('')+1,
name.length()-1);
this.name = name;
}

String description = scanner.findInLine(description\\s*=\\s*
\.+\);
if( description == null ) {
description = scanner.findInLine(description\\s*=\\s*\.+);

if( description != null ) {
scanner.nextLine();
String line = null;
while( scanner.hasNext()  !(line =
scanner.nextLine()).contains(\) ) {
 description += \n + line.trim();
}
if( line != null ) {
description += \n + line.substring(0, 
line.indexOf('')
+1).trim();
}
}
}
if( description != null ) {
description = description.substring(description.indexOf('')
+1, description.length()-1);
this.description = description;
}
}

private void parseBoulder(Scanner scanner) throws SAXException {

String name = scanner.findInLine(name\\s*=\\s*\.+\);
if( name != null ) {
name = name.substring(name.indexOf('')+1,
name.length()-1);
boulderName = name;
}

String grade = scanner.findInLine(grade\\s*=\\s*\.+\);
if( grade != null ) {
grade = grade.substring(grade.indexOf('')+1,
grade.length()-1);
boulderGrade = grade;
}

String longi = scanner.findInLine(longitud\\s*=\\s*\.+\);
if( longi != null ) {
longi = longi.substring(longi.indexOf('')+1,
longi.length()-1);
try{
this.longi = Float.parseFloat(longi);
}
catch( Exception e ) {
throw new SAXException(Error: Unable to parse
longitude.);
}
}

String lati = scanner.findInLine(latitud\\s*=\\s*\.+\);
if( lati != null ) {
lati = lati.substring(lati.indexOf('')+1,
lati.length()-1);
try{
this.lati = 

[android-developers] unexpected crash, date questions

2010-07-19 Thread Ethan
Hi all,

I am new to Android and Java (though have plenty of Javascript
experience). I am learning the language, the OS, and the programming
environment all at once, so I know I am missing simple stuff here. I
have an extremely basic program that takes the year, month, and day,
makes a few calculations based on that, and uses it to determine which
strings print in unique combinations based on the date. I used Droid
Draw to create an extremely simple interface. There are no obvious
errors on the page and the app appears to run but immediately crashes
on the emulator.


Here is my source:


package com.Borg.energy;

import java.util.Calendar;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class energize extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

TextView daylbl;
TextView monthlbl;
TextView text1;
TextView text2;
TextView yearlbl;



int mo = 0;
int yr = 0;
int dy = 0;
int da = 0;
int Stem = 0;
int Branch = 0;
String stemtype = ;
String branchtype = ;
String yeartype = ;
String yearinfo = ;

text1 = (TextView)this.findViewById(R.id.text1);
text2 = (TextView)this.findViewById(R.id.text2);


final Calendar Cal = Calendar.getInstance();
mo = 7; //Cal.get(Calendar.MONTH);
yr = 2010; //Cal.get(Calendar.YEAR) - 1900;
dy = 16; //Cal.get(Calendar.DATE);
   daylbl = (TextView)this.findViewById(R.id.daylbl);
   monthlbl = (TextView)this.findViewById(R.id.monthlbl);
   yearlbl = (TextView)this.findViewById(R.id.yearlbl);
daylbl.setText(dy);
monthlbl.setText(mo);
yearlbl.setText(yr);
if(yr == 2002) {
Stem = 6;
Branch = 6;
}
if (yr == 2003) { Stem = 1; Branch = 11; }
if (yr == 2004) { Stem = 6; Branch = 4; }
if (yr == 2005) { Stem = 2; Branch = 10; }
if (yr == 2006) { Stem = 7; Branch = 3; }
if (yr == 2007) { Stem = 2; Branch = 8; }
if (yr == 2008) { Stem = 7; Branch = 1; }
if (yr == 2009) { Stem = 3; Branch = 7; }
if (yr == 2010) { Stem = 8; Branch = 12; }
if (yr == 2011) { Stem = 3; Branch = 5; }
if (yr == 2012) { Stem = 8; Branch = 10; }
if (yr == 2013) { Stem = 4; Branch = 4; }
if (yr == 2014) { Stem = 9; Branch = 9; }
if (yr == 2015) { Stem = 4; Branch = 2; }
if (yr == 2016) { Stem = 9; Branch = 7; }
if (yr == 2017) { Stem = 5; Branch = 1; }
if (yr == 2018) { Stem = 10; Branch = 6; }
if (yr == 2019) { Stem = 5; Branch = 11; }
if (yr == 2020) { Stem = 10; Branch = 4; }
if (yr == 2021) { Stem = 6; Branch = 10; }
if (yr == 2022) { Stem = 1; Branch = 3; }
if (yr == 2023) { Stem = 6; Branch = 8; }
if (yr == 2024) { Stem = 1; Branch = 1; }
if (yr == 2025) { Stem = 7; Branch = 7; }
if (yr == 2026) { Stem = 2; Branch = 12; }
if (yr == 2027) { Stem = 7; Branch = 5; }
if (yr == 2028) { Stem = 3; Branch = 11; }
if (yr == 2029) { Stem = 8; Branch = 4; }
if (yr == 2030) { Stem = 3; Branch = 9; }
if (yr == 2031) { Stem = 8; Branch = 2; }

if (mo == 1) { Stem = Stem - 1; Branch = Branch - 1; }
if (mo == 2) { Stem = Stem - 0; Branch = Branch + 6; }
if (mo == 3) { Stem = Stem - 2; Branch = Branch + 10; }
if (mo == 4) { Stem = Stem - 1; Branch = Branch + 5; }
if (mo == 5) { Stem = Stem - 1; Branch = Branch - 1; }
if (mo == 6) { Stem = Stem - 0; Branch = Branch + 6; }
if (mo == 7) { Stem = Stem - 0; Branch = Branch - 0; }
if (mo == 8) { Stem = Stem + 1; Branch = Branch + 7; }
if (mo == 9) { Stem = Stem + 2; Branch = Branch + 2; }
if (mo == 10) { Stem = Stem + 2; Branch = Branch + 8; }
if (mo == 11) { Stem = Stem + 3; Branch = Branch + 3; }
if (mo == 12) { Stem = Stem + 3; Branch = Branch + 9; }

if ((yr == 2000) || (yr == 2004)  || (yr == 2008)  || (yr ==
2012)  || (yr == 2016)  || (yr == 2020)  || (yr == 2024)  || (yr ==
2028)) {
Stem = Stem + 1; Branch = Branch + 1;
if (mo = 3) { Stem = Stem + 1; Branch = Branch + 1; }
} else {
Stem = Stem + 1; Branch = Branch + 1;
}

dy = dy - 1;
Stem = Stem + dy;
Branch = Branch + dy;


do {
Stem = Stem - 10;
} while (Stem = 11);


do {
Branch = Branch - 12;
} while (Branch =13);



if (Stem == 1) { stemtype = Wood Yang; }
if (Stem == 2) { stemtype = Wood Yin; }
if (Stem == 3) { stemtype = Fire Yang; }
if (Stem == 4) { stemtype = Fire Yin; }
if (Stem == 5) { stemtype = Earth Yang; }
if (Stem == 6) { stemtype = Earth Yin; }
if (Stem == 7) { stemtype = Metal Yang; }
if (Stem == 8) { stemtype = Metal Yin; }
if (Stem == 9) { stemtype = Water Yang; }
if (Stem == 10) { stemtype = Water Yin; }

if (Branch == 1) { branchtype = Water; }
if (Branch == 2) { 

[android-developers] Re: How to uninstall application?

2010-07-19 Thread cookieLabs
Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
startActivity(uninstallIntent);

this makes Android to uninstall an application. The user will be asked
first.

cheers,
Daniel

On Jul 17, 9:06 am, Alex Xin xinxi...@gmail.com wrote:
 Hi, there

 I'm now implementing an app management tool, but I don't know how to
 uninstall an application using SDK? Could anyone tell me this?
 Thanks a lot

 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] Camera focus information?

2010-07-19 Thread birger
Is it possible to get info from the camera about the approximate
distance to the focus point?

I couldn't find anything about this in the SDK description, so it may
not be possible? I couldn't find such information in the picture
metadata either.

--
birger

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Socket in AsyncTask - application crashesso the UI won't be blocked

2010-07-19 Thread Francesco
Hi, when trying to start a socket connection in an AsyncTask, my
application crashes for no reason (debugger says
android.view.ViewRoot$CalledFromWrongThreadException: Only the
original thread that created a view hierarchy can touch its views.).

If I remove the Async and use the same code, my application works (of
course, if I make the socket connect to a not valid IP or port, the
application freezes for 5 seconds, because that's the socket's
timeout).
As I'd like to avoid that 5 seconds freeze with wrong configurations,
I have to implement the AsyncTask.

The application works just fine opening the socket and everything
related, but as I try and make it change some TextViews, it gives this
error. The AsyncTask doc says:

AsyncTask enables proper and easy use of the UI thread. This class
allows to perform background operations and publish results on the UI
thread without having to manipulate threads and/or handlers.

So I'm doing something legit.

This is the code, it's quite simple:

private class ConnectTask extends AsyncTaskVoid, Void, Void {
protected Void doInBackground(Void... params) {
try {
InetAddress inetAddr = InetAddress.getByName(IP);
int PORT = Integer.parseInt(Port);

if (PORT  0)
throw (new NumberFormatException());
if (IP.equals())
throw (new UnknownHostException());

SocketAddress sockaddr = new InetSocketAddress(inetAddr,
PORT);
socket = new Socket();
socket.connect(sockaddr, 5000);

if (socket.isConnected()) {
OutputStreamOut = new
ObjectOutputStream(socket.getOutputStream());
InputStreamIn = new 
ObjectInputStream(socket.getInputStream());
// everything worked fine until here
statusTxt.setText(App is now connected to:\n 
+ IP +  : 
+ Port); // CRASHING 
connectBt.setText(Disconnect);
connected = true;
continueBt.setVisibility(0);
} else {
throw new UnknownHostException();
}
} catch (SocketTimeoutException sockExc) {
statusTxt.setText(Connection timeout:\nplease, review 
your IP/
Port settings.);
} catch (NumberFormatException numExc) {
statusTxt.setText(Number Format Error:\nplease, review 
your
Port settings.);
} catch (UnknownHostException e1) {
statusTxt.setText(Unknown Host Error:\nplease, 
review your IP/
Port settings.);
} catch (IOException e2) {
statusTxt.setText(Input/Output Error:\nplease, 
review your
connection settings.);
} finally {
//dialog.dismiss();
}
return null;
}

protected void onProgressUpdate(Void... progress) {}

protected void onPostExecute(Void result) {}
 }

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] To get help in read XML file excluding extra characters.

2010-07-19 Thread vikram kadam
Res. All
I was tried to parse XML file using SAXParser and
DefaultHandler class. It gives me output but there are some unexpected
extra characters in between data. I found that it gives me '[]' at the
place of #13, and tags b as it is from file. can you help me to
solve this problem.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] To get help in read XML file excluding extra characters.

2010-07-19 Thread vikram kadam
Res. All
I was tried to parse XML file using SAXParser and
DefaultHandler class. It gives me output but there are some unexpected
extra characters in between data. I found that it gives me '[]' at the
place of #13, and tags b as it is from file. can you help me to
solve this problem.


 
Thank You
 
(Vikram Kadam)

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


  1   2   >