Re: [android-developers] Re: How to hide error dialog on MediaPlayer

2013-02-07 Thread Per-Jarle Sæther
Hi
That solved it :)

Thank you for the help

Best regards
Per-Jarle

On Tue, Feb 5, 2013 at 4:46 PM, Nobu Games dev.nobu.ga...@gmail.com wrote:

 Have you tried setting a 
 MediaPlayer.OnErrorListenerhttp://developer.android.com/reference/android/media/MediaPlayer.OnErrorListener.htmlthat
  returns true? Maybe this will suppress the internally generated error
 message.



 On Tuesday, February 5, 2013 4:55:05 AM UTC-6, Per-Jarle Sæther wrote:

 Hello all
 I'm working with a video playback app

 Sometimes when there is a problem with the video stream, the MediaPlayer
 displays an error dialog saying:
 Sorry, this video cannot be played

 Is there any way to disable this dialog so it will not be displayed in my
 app?
 I would like to implement my own functionality when errors happen

 Best regards
 Per-Jarle

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




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




[android-developers] How to hide error dialog on MediaPlayer

2013-02-05 Thread Per-Jarle Sæther
Hello all
I'm working with a video playback app

Sometimes when there is a problem with the video stream, the MediaPlayer
displays an error dialog saying:
Sorry, this video cannot be played

Is there any way to disable this dialog so it will not be displayed in my
app?
I would like to implement my own functionality when errors happen

Best regards
Per-Jarle

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




[android-developers] how to make graphics fit to different screen resolutions

2013-01-21 Thread Per-Jarle Sæther
Hi all
I have an application that was originally developed for a 7 touchpad with
resolution 800x480 (mdpi).
Both graphics and layouts was made for this resolution.

Now I am trying to make this app to support another device that have
resolution 1024x552 (mdpi)

Since both devices are mdpi, then I need to make new graphics to fit the
new resolution.
How can I make each device automatically select the right graphics and
layouts when they are both mdpi?

Can anybody show point me to an example that solves this?

Best regards
Per-Jarle

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

2012-11-26 Thread Per-Jarle Sæther
Hello all
I ran an update of the ADT in Eclipse.

After updating, I get an error message saying:

*This version of ADT requires Android SDK Tools revision 21.0.0 rc9 or
above.
Current revision is 20.0.0.
Please update your SDK Tools to the latest version.*

Together with two buttons (Open SDK Manager, Close)

When I open SDK Manager, it does not show Android SDK Tools higher than
Rev. 20.

How do I solve this?

Best regards
Per-Jarle

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

2012-11-26 Thread Per-Jarle Sæther
Hi all
Please ignore my last email
I found the reload button...

Best regards
Per-Jarle

On Mon, Nov 26, 2012 at 3:33 PM, Per-Jarle Sæther 
per.jarle.saet...@gmail.com wrote:

 Hello all
 I ran an update of the ADT in Eclipse.

 After updating, I get an error message saying:

 *This version of ADT requires Android SDK Tools revision 21.0.0 rc9 or
 above.
 Current revision is 20.0.0.
 Please update your SDK Tools to the latest version.*

 Together with two buttons (Open SDK Manager, Close)

 When I open SDK Manager, it does not show Android SDK Tools higher than
 Rev. 20.

 How do I solve this?

 Best regards
 Per-Jarle


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

2012-06-19 Thread Per-Jarle Sæther
Thank you for good explanation

Best regards
Per-Jarle

On Mon, Jun 18, 2012 at 5:01 PM, Mark Murphy mmur...@commonsware.comwrote:

 If the ContentProvider has an android:permission,
 android:readPermission, or android:writePermission attribute in its
 provider element in the manifest, then the consumer needs to have
 the corresponding uses-permission element.

 On Mon, Jun 18, 2012 at 9:02 AM, Per-Jarle Sæther
 per.jarle.saet...@gmail.com wrote:
  Hello, and thank you for replying
 
  I was looking at a tutorial that used Contacts which is a ContentProvider
 
  That app had the following tag in AndroidManifest:
 
   uses-permission
 android:name=android.permission.READ_CONTACTS
 
   /uses-permission
 
 
 
  I thought maybe I would need something like that to access a custom
  ContentProvider
 
  Best regards
  Per-Jarle
 
 
  On Mon, Jun 18, 2012 at 12:29 PM, Mark Murphy mmur...@commonsware.com
  wrote:
 
  You do not need to have a uses-permission element to use that
  ContentProvider. I do not know what other uses tag you might be
  concerned with.
 
  On Mon, Jun 18, 2012 at 5:09 AM, Per-Jarle Sæther
  per.jarle.saet...@gmail.com wrote:
   Hello all
   Do I need to specify an uses tag in AndroidManifest if I shall use a
   custom
   Content provider?
  
   Example:
   Provider tag in Content Provider:
  
provider android:name=BooksProvider
  
android:authorities=net.learn2develop.provider.Books /
  
  
   What uses tag do I need to have in a client app that use this
 provider?
  
   Best regards
   Per-Jarle
  
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, 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.7 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
 
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, 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.7 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


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

[android-developers] Using custom Content Providers

2012-06-18 Thread Per-Jarle Sæther
Hello all
Do I need to specify an uses tag in AndroidManifest if I shall use a custom
Content provider?

Example:
Provider tag in Content Provider:

 provider android:name=BooksProvider
 android:authorities=net.learn2develop.provider.Books /


What *uses* tag do I need to have in a client app that use this provider?

Best regards
Per-Jarle

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

2012-06-18 Thread Per-Jarle Sæther
Hello, and thank you for replying

I was looking at a tutorial that used Contacts which is a ContentProvider

That app had the following tag in AndroidManifest:

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



I thought maybe I would need something like that to access a custom
ContentProvider

Best regards
Per-Jarle

On Mon, Jun 18, 2012 at 12:29 PM, Mark Murphy mmur...@commonsware.comwrote:

 You do not need to have a uses-permission element to use that
 ContentProvider. I do not know what other uses tag you might be
 concerned with.

 On Mon, Jun 18, 2012 at 5:09 AM, Per-Jarle Sæther
 per.jarle.saet...@gmail.com wrote:
  Hello all
  Do I need to specify an uses tag in AndroidManifest if I shall use a
 custom
  Content provider?
 
  Example:
  Provider tag in Content Provider:
 
   provider android:name=BooksProvider
 
   android:authorities=net.learn2develop.provider.Books /
 
 
  What uses tag do I need to have in a client app that use this provider?
 
  Best regards
  Per-Jarle
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, 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.7 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

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Hardware accleration slow down every Canvas app. Why?

2012-01-16 Thread Per Larsson
sblantipodi wrote:
 Simply enable hardware acceleration and the framerate drops from 10FPS
to 30FPS. 

That is not a drop. 10FPS (frames per second) is slower, 30FPS is faster.
So, hardware acceleration makes the rendering faster, as expected.
I don't understand what you mean.

Regards,
Per


2012/1/16 sblantipodi perini.dav...@dpsoftware.org

 Just to add some more data.
 This simple app can render its UI at 60FPS on Galaxy Nexus running
 stock 4.0.2 with HW ACC is OFF.

 https://market.android.com/details?id=MortgageCalculatorPRO.DPsoftware.orgfeature=search_result#?t=W251bGwsMSwyLDEsIk1vcnRnYWdlQ2FsY3VsYXRvclBSTy5EUHNvZnR3YXJlLm9yZyJd

 Simply enable hardware acceleration and the framerate drops from 10FPS
 to 30FPS.
 As I repeat all the UI is drawn using drawLine() drawRect()
 drawRoundRect() and StaticLayout to draw a correctly wrapped text.
 Simple apps using simple UI runs slow on a 1.2GHz CPU with 1GB of RAM.

 Is there any reason to justify this aside from the fact that it must
 be some problem in the hw acceleration implementation?

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

Re: [android-developers] Giving away my book: Genius Android Marketing

2012-01-09 Thread Per Larsson
Hi,

This seems like a useful book. I'm interested in it.

Best Regards,
Per



2012/1/5 scp89 jayvanbui...@gmail.com

 I've recently finished writing the first full-length, android-specific
 book on Android Marketing. It covers tips, tricks, strategies,
 competitive analysis, and so much more. Everything I've learned in 2
 years selling android apps, I've put into this book. It is available
 via e-book OR softcover:

 E-book:
 http://www.amazon.com/Genius-Android-Marketing-Outsmarting-ebook/dp/B005WE7S3G/ref=sr_1_5?ie=UTF8qid=1325606679sr=8-5

 Softcover:

 http://www.amazon.com/Genius-Android-Marketing-Outsmarting-Market/dp/1463778406/ref=sr_1_cc_1?s=digital-textie=UTF8qid=1325606710sr=1-1-catcorr

 GIVEAWAY: I am giving away 3 PDF copies of the book to readers! Simply
 reply to this thread, and 1 week from today I will randomly select 3
 members and PM you a link to your free download of the 130 page book.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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: How can i mount a yaffs2 image on Linux Ubuntu 11.04

2011-10-13 Thread Per
You would need to compile am yaffs2 driver module for your kernel to
do that,
it would proberly be easier to get the program unyaffs, then you can
unpack the
image to a directory. You should be able to find that program with a
little google
search.

Per

On Oct 11, 4:35 pm, luca aliberti lucal...@gmail.com wrote:
 I have extracted a yaffs2 image of my android phone situated in /dev/
 mtd/mtd0, for forensics purpose.

 I would know how can I mount it in ubuntu 11,04 to exploore the
 contents, because yaffs2 is not supported.

 Thanks to everyone.

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

2011-08-12 Thread Per
Update:

I had my app running for hours yesterday while charging, with the
Desire kept cool by sitting on top of a small CPU-cooler-like fan.
Noisy, but cool.
When I switched off the fan, the Desire rebooted within 3 minutes.

Also, no reboots in flight mode.

Bugger.


On Aug 11, 1:55 pm, Per p...@care2wear.com wrote:
 Oh dear.

 Though I'm sort of happy that I'm not to blame this time, this is
 horrible.

 I tried a few experiments not involving my app, and sure enough,
 loading the poor device a bit (music, youtube, navigation at the same
 time) works fine off the charger, but inserting the charger invariably
 reboots the thing within minutes. Sometimes it even reboots while
 recovering...

 Turning off WiFi/Data has no effect.
 Flight mode seems to help, but that's not really a good option :)

 I'll try cooling the device by a fan or something, just to confirm
 that temperature really is the cause.

 The thread you pointed to also discussed Froyo as a possible (partial)
 cause.
 I tend to suspect the 2.1-2.2 update to worsen the problem, I don't
 remember seeing this a year ago (when I was making a similar app).

 thanks,
 Per

 On Aug 11, 10:54 am, Nico Balestra nicobales...@gmail.com wrote:

  I think this is related to a known problem affecting the HTC Desire.

  Apparently it happens when the CPU gets hot, which is very likely for
  intensive operations.
  See 
  this:http://androidforums.com/desire-support-troubleshooting/78992-htc-des...

  I had an HTC Desire and it was rebooting all the time as soon as I attached
  the phone to my USB cable and starting an application via Eclipse. The same
  was happening when I was browsing the web or playing Angry Birds :)

  Eventually.. I've got a Samsung Galaxy S2!!

  Hope this help,
  Nico

  2011/8/11 Per p...@care2wear.com

   Does anyone know of (reproducible) reasons for device reboot?

   My app-under-development will run for hours if the device is not
   charging, but with USB connected it will reboot, usually within
   minutes. No exceptions shown, just a reboot.

   The app has one activity, which (via a WakefulIntentService [from
   CommonsWare]) sets up alarms that will trigger at different intervals
   (4mins to half a day). The alarms are cancelled when the activity is
   destroyed.
   When an alarm goes off, a BroadcastReceiver starts a
   WakefulIntentService, which pulls some data from a server and saves it
   in a file. That service starts another service, which provides a cache
   of the data in the file to the activity. The start of the cache
   service is afaik the simplest way of providing a simple notification.
   It is most likely already running, as it is bound by the activity.

   This could most likely be done smarter, but it seemed like a fair
   compromise when I want the app to work offline, too.

   Does anyone know of an interaction between USB/charging and
   wakelocks / alarms / services ?
   Logcat does not provide much help. Seems that the log is cleared at
   reboot.
   Any hints for debugging this apart from logcat (will adb bugreport
   provide more history than logcat?)

   Just for the record, I have seen the device (HTC Desire running 2.2)
   reboot when it gets hot (hot environment, lots of voice/data traffic
   while or just after charging), but it's running pretty cool in this
   scenario.

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

2011-08-11 Thread Per
Does anyone know of (reproducible) reasons for device reboot?

My app-under-development will run for hours if the device is not
charging, but with USB connected it will reboot, usually within
minutes. No exceptions shown, just a reboot.

The app has one activity, which (via a WakefulIntentService [from
CommonsWare]) sets up alarms that will trigger at different intervals
(4mins to half a day). The alarms are cancelled when the activity is
destroyed.
When an alarm goes off, a BroadcastReceiver starts a
WakefulIntentService, which pulls some data from a server and saves it
in a file. That service starts another service, which provides a cache
of the data in the file to the activity. The start of the cache
service is afaik the simplest way of providing a simple notification.
It is most likely already running, as it is bound by the activity.

This could most likely be done smarter, but it seemed like a fair
compromise when I want the app to work offline, too.


Does anyone know of an interaction between USB/charging and
wakelocks / alarms / services ?
Logcat does not provide much help. Seems that the log is cleared at
reboot.
Any hints for debugging this apart from logcat (will adb bugreport
provide more history than logcat?)


Just for the record, I have seen the device (HTC Desire running 2.2)
reboot when it gets hot (hot environment, lots of voice/data traffic
while or just after charging), but it's running pretty cool in this
scenario.

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

2011-08-11 Thread Per
Oh dear.

Though I'm sort of happy that I'm not to blame this time, this is
horrible.

I tried a few experiments not involving my app, and sure enough,
loading the poor device a bit (music, youtube, navigation at the same
time) works fine off the charger, but inserting the charger invariably
reboots the thing within minutes. Sometimes it even reboots while
recovering...

Turning off WiFi/Data has no effect.
Flight mode seems to help, but that's not really a good option :)

I'll try cooling the device by a fan or something, just to confirm
that temperature really is the cause.

The thread you pointed to also discussed Froyo as a possible (partial)
cause.
I tend to suspect the 2.1-2.2 update to worsen the problem, I don't
remember seeing this a year ago (when I was making a similar app).

thanks,
Per


On Aug 11, 10:54 am, Nico Balestra nicobales...@gmail.com wrote:
 I think this is related to a known problem affecting the HTC Desire.

 Apparently it happens when the CPU gets hot, which is very likely for
 intensive operations.
 See 
 this:http://androidforums.com/desire-support-troubleshooting/78992-htc-des...

 I had an HTC Desire and it was rebooting all the time as soon as I attached
 the phone to my USB cable and starting an application via Eclipse. The same
 was happening when I was browsing the web or playing Angry Birds :)

 Eventually.. I've got a Samsung Galaxy S2!!

 Hope this help,
 Nico

 2011/8/11 Per p...@care2wear.com

  Does anyone know of (reproducible) reasons for device reboot?

  My app-under-development will run for hours if the device is not
  charging, but with USB connected it will reboot, usually within
  minutes. No exceptions shown, just a reboot.

  The app has one activity, which (via a WakefulIntentService [from
  CommonsWare]) sets up alarms that will trigger at different intervals
  (4mins to half a day). The alarms are cancelled when the activity is
  destroyed.
  When an alarm goes off, a BroadcastReceiver starts a
  WakefulIntentService, which pulls some data from a server and saves it
  in a file. That service starts another service, which provides a cache
  of the data in the file to the activity. The start of the cache
  service is afaik the simplest way of providing a simple notification.
  It is most likely already running, as it is bound by the activity.

  This could most likely be done smarter, but it seemed like a fair
  compromise when I want the app to work offline, too.

  Does anyone know of an interaction between USB/charging and
  wakelocks / alarms / services ?
  Logcat does not provide much help. Seems that the log is cleared at
  reboot.
  Any hints for debugging this apart from logcat (will adb bugreport
  provide more history than logcat?)

  Just for the record, I have seen the device (HTC Desire running 2.2)
  reboot when it gets hot (hot environment, lots of voice/data traffic
  while or just after charging), but it's running pretty cool in this
  scenario.

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

2011-06-22 Thread Per
I think there's a video for exactly this topic on the developer site.
/Per

On Jun 21, 5:35 pm, Sivaprakash sivaprakashshanmu...@gmail.com
wrote:
 Any sample ? Even if you respond back with stream how does my front end
 under stand the structure and behave?

 On Tue, Jun 21, 2011 at 7:11 PM, jjoe64 g.jjo...@googlemail.com wrote:
  parse it in background and as a stream. never read it with a buffer, don't
  create objects for every node/attribute ...

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

 --
 - Prakash.

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


[android-developers] Creating a bitmap based App Widget

2011-06-06 Thread Per Magnus Veierland
I've created a bitmap based app widget for Android homescreens. The
whole widget is rendered as one image, and rendered unscaled using an
ImageView. To create the bitmap I need to know the exact dimensions of
the widget. At the moment I'm doing this by using the Android
guidelines for the guaranteed minimum widget dimensions.

Due to what seems like a bug in the Android framework, setting the
ImageView scaleType to center (which is not supposed to scale the
image) does not work when loading the image using a ContentProvider
and setImageViewUri(). Instead, the image is scaled depending on the
screen dpi. Setting the bitmap (with the property
density=DENSITY_NONE) directly to the ImageView using
setImageViewBitmap() on the RemoteViews works correctly with
scaleType=center, but this method only works for small bitmaps, as the
IPC mechanism used has a low limit, and will fail if trying to pass a
full 4x4 app widget bimap for example.

My current solution is to use images served using ContentProviders,
with scaleType=fitXY, and set the layout_width and layout_height of
the ImageView in the layout to a fixed number of DPI, then rendering
the image to the same size, scaling for screen density.

In portrait mode on most phones, this approach works fine. However, in
WVGA or generally for landscape tablets, this method does not use the
full amount of widget space which is available, and will not fill the
width, and/or height of the app widget area.

Current dimensioning formula:
int widgetWidth = (int)Math.round(((isLandscape ? (106.0f *
mWidgetColumns) : (80.0f * mWidgetColumns)) - 2.0f) * dp);
int widgetHeight = (int)Math.round(((isLandscape ? (74.0f *
mWidgetRows) : (100.0f * mWidgetRows)) - 2.0f) * dp);

Subtracting - 2 from the calculated dpi (e.g. 74 * cy - 2) is to avoid
cases where the resulting number of pixels is rounded down. (For
example in landscape mode on Nexus One, the height is 110, not 111 (74
* 1.5).

My questions are:
Is there any way in the Android framework to dynamically determine the
available widget dimensions? Will there ever be?
Are the issues I've encountered confirmed bugs, or are there better
solutions to my problems?

Some more info here with further links:
http://stackoverflow.com/questions/6085946/custom-rendered-android-app-widget

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


[android-developers] Call Intervention

2011-02-07 Thread Per Nordlöw
Hi, Android App Creators!

I'm looking for a way to change the phone's display *behaviour* when a 
specific contact is calling. Is this possible? If so what android API 
classes are involved in changing this behaviour?

Many thanks in advance,
Per Nordlöw

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Getting a test version of an .apk to a end user

2011-01-03 Thread Per
I usually
1: put the apk on my own website (not the market)
2: make a QR-code image containing the URL to the apk (see e.g.
http://code.google.com/intl/da-DK/apis/chart/docs/gallery/qr_codes.html)
3: Instruct the user to install Barcode Scanner from market
4: Use Barcode Scanner to scan the QR

(and yes, the above comments about market/non-market origins and
allowing unknown sources are crucial)

BR
Per


On 4 Jan., 02:50, metal mikey coref...@gmail.com wrote:
 Your tester will need to uninstall the current from-market instance of
 your App then go to MENU  SETTINGS  APPLICATIONS  and check 'Unkown
 sources' to allow the not-from-market install. Then upon opening (aka
 clicking on) the .apk file attached to the email you sent, Android
 will install the App.

 On Jan 4, 12:23 pm, John Lussmyer johnlussm...@gmail.com wrote:

  Okay, email is fine - but how does an average end-user get the file onto
  their Android Device?
  That's what I was asking.

  On Mon, Jan 3, 2011 at 4:55 PM, metal mikey coref...@gmail.com wrote:
   Is Email easy enough?

   Note: because you will have the tester install out-of-band from the
   Market, the tester will need to uninstall the App first.

   On Jan 4, 9:58 am, John Lussmyer johnlussm...@gmail.com wrote:
You mean you put it out on the Android Marketplace?

On Mon, Jan 3, 2011 at 2:56 PM, Wayne Wenthin wa...@fuligin.com wrote:
 I've taken to putting the latest version on the website and letting
   them
 download and install from there.

 On Mon, Jan 3, 2011 at 2:54 PM, John Lussmyer johnlussm...@gmail.com
   wrote:

 Is there any relatively easy way for me to send a test version of my
 app.apk file to a user?
 I may have fixed a problem he's seeing (that doesn't happen on my
   phone of
 course), and I'd like to have him test it BEFORE I deploy it to the
   store.

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

2010-12-24 Thread Per
As far as I can see, Android does not currently support playing sound
(beeps or other) through a mono (SCO) BT headset. I believe that BT
stereo (A2DP) headsets work, though. Have not tried.
You might want to check this thread for more info:
http://code.google.com/p/android/issues/detail?id=7906

As for getting info on headset button activations in your app, I
believe that this requires support for the AVRCP profile. Again, this
is commonly seen for stereo headsets, but not for mono. I don't think
that the Android BT stack supports AVRCP.
This wikipedia article gives a good intro to BT profiles, if you need
that: http://en.wikipedia.org/wiki/Bluetooth_profile

If you manage to get it to work, be aware that the various
manufacturer's interpretation of the BT spec tend to vary a bit... In
other words: I'd recommend to test the functionality with every
headset that you wish to claim supported by your app.

Good luck!

BR
Per


On 24 Dec., 06:51, Jags jag...@gmail.com wrote:
 Thanks a ton IV, I am happy as long as I get some relevant
 solution :) .

 1. Beep, means I did not mean default handset beep. I meant in my
 custom application i play a sound. if my hedset is paired when i am
 playing the sound in my custom application using Mediaplayer class,
 will it be heard in my headset ?

 2. will i be able to capture volume up/down key press in the headset
 in my application ? if yes how ?

 regards

 On Dec 24, 5:53 am, Indicator Veritatis mej1...@yahoo.com wrote:

  Yes, that is right. You did not get your point across properly. You
  are doing better in this post, though, despite the disappointing typo
  of '[oint' for 'point'.

  But if you do know that the beep is at headsets[sic] control, why
  you even asking where it is? That makes no sense.

  The truth of the matter is that the Bluetooth spec does not mandate
  the beep. The implementer may chose to do it in the headset software,
  as it is the only choice that makes sense: otherwise the user gets no
  audio feedback to know that pairing just happened. The only feedback
  that the Android application gets is that now the headset is listed in
  the list of bound devices returned by getBondedDevices().

  That is, you can sense when the headset was paired by polling
  getBondedDevices(), but you cannot cause the beep, nor can you sense
  when the headset does its own beep. You can only rely on what the
  headset manufacturer chose to implement in their own Bluetooth code.

  On Dec 22, 9:52 pm,Jagsjag...@gmail.com wrote:

   thanks IV,

   I guess i could not put my [oint across properly. Beep is at headsets
   control, i know. Now when the headset is paired, and my custom
   application plays a beep, does it automatically beep in the headset or
   in the handset ? if it automatically beeps in the headset, good, if
   not what can i do in my custom app to make the beep heard in the
   headset ?

   more to that i also need to capture some keypress volume up and down
   from the headset in my application
   will I be able to do that in my application ? how ? documentation is
   not clear on this !

   thanks and regards
   Jagat

   On Dec 17, 10:57 am, Indicator Veritatis mej1...@yahoo.com wrote:

I don't know why this thread is getting spam, but I can offer a guess
why you are not getting answers. Your questions seems to strongly
imply you have not studied the basics of how to do Bluetooth (whether
on Android or not). Specifically, the beep you are interested in
controlling is under the headset's control: it is NOT controllable
from Android. Nor should it be, so don't wait for it to be added in a
future version.

On Dec 16, 1:21 am,Jagsjag...@gmail.com wrote:

 is this message a spam ? Nobody is able to see my message or what ?
 dont get answers, only get spams posted in the forum !

 On Dec 16, 11:03 am, hanika han...@securitywall.in wrote:

  hi

  Thanks  Regards,
  cid:image002@01CA2AEF.10F60770
  Vijay Patel
  Test Engineer
  Elitecore Technologies Ltd.
  904, Silicon tower, off C.G Road, Ahmedabad-380 006 Gujarat (INDIA),
  Tel: +91-79-66065606 | HYPERLINK
  mailto:vijay.pa...@elitecore.comvijay.pa...@elitecore.com
  HYPERLINK http://www.cyberoam.comwww.cyberoam.com
  P    Please do not print this email unless it is absolutely 
  necessary.
  Spread environmental awareness.

   image001.jpg
  2KViewDownload

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


[android-developers] Re: How to read the current frame buffer

2010-11-16 Thread Per
Not sure what you mean by frame buffer, but maybe
View.getDrawingCache() would work for you?

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

I have successfully used it to implement in-app screendumps.

BR
Per



On 16 Nov., 13:32, Vic kvic2...@gmail.com wrote:
 Is there a method to read the frame buffer of the current screen? I
 searched some data about the frame buffer. Some one used the
 glReadPixels method, but the information was not enough. Does anyone
 know how to read the current frame buffer in detail?

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

2010-10-08 Thread Per
what's 'sequential programming'?  :P

(couldn't resist)

I'm guessing that you're looking for a tool to help with documenting
your OO architectural/design thoughts?
I'd say that any tool capable of handling UML could do that. These
come with many price tags, from 0$ to very expensive, and sometimes
functionalty reflects this. If
you want a drawing tool, take a look at StarUML (free) or Visio (not
free). At the other end of the scale you'd find tools like Together,
Rational Rose and others.

BR
Per


On 7 Okt., 19:37, DanH danhi...@ieee.org wrote:
 I'm not looking for a flowcharting tool, but rather something to
 design the relationships between Activities, Intents, Providers, etc.
 Android isn't a conventional sequential programming environment, and
 sequential programming design tools are of little help.

 On Oct 7, 12:15 pm, Bret Foreman bret.fore...@gmail.com wrote:



  I think the Rational toolset (RUP) has a generic tool for creating
  flowcharts for most languages, including Java. That's not free, but it
  would be a good thing to study before recreating the same
  functionality in open 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] Re: Bluetooth Serial Port Programming.

2010-09-26 Thread Per


In general, the examples and hints found here, in the SDK and on
StackOverflow will get you far.

My experience is:
1: You probably want to target only Android 2.2 (or higher). As far as
I recall, SPP was not supported before 2.1 (2.0.1?), but the versions
before 2.2. had various quirks that you need to hack around. BT in 2.2
works as advertised.
2: Beware that Android will not connect to devices that are set up to
not require pairing. This is probably for security reasons, but is a
pain IRL
3: If you're building on the BluetoothChat example, beware that the
UUID used there is specific to that app, and will not work with SPP
services in general. Google for UUID and SPP.
4: Expect some iterations getting it to work. I've pulled quite a few
hairs on getting automatic reconnection to work (hint: ensure that
everything is properly closed down in the right order).
5: Log extensively to understand what's happening...

Have fun :)
/Per

On 25 Sep., 00:34, Nathan critter...@crittermap.com wrote:
 I may be doing some Bluetooth Serial Port programming work for a
 client and I'm just looking for some tips in determining complexity/
 workload.
 The work is similar to reading from a bluetooth GPS (not making the
 phone a bluetooth GPS), but it is some custom hardware, so not
 exact.

 Here's what (I think) I know so far:
 I will need to pair devices with a Serial Port Profile.
 I need to connect using a BluetoothSocket which works on Android 2x
 -I don't know yet if the Android I will be a server or a client in
 this scenario.
 I will open an InputStream (no outputstream needed) and have a thread
 continually blocking for input
 I believe BluetoothChat is the best example to start with.

 What I would want to know.
 - Are there devices/manufacturers who block the bluetooth serial port,
 trying to block tethering or something like that?
    (-I've seen posts here that imply that, but I don't see a bunch of
 comments like Doesn't work on my @#$$ in Bluetooth GPS Providers in
 the market).
 -Are there going to be hardware specific oddities, or can I develop
 with my Nexus One and just hope it works on everything else?
 -Is pairing something that will require a lot of education for the
 users, and would a good app try to initiate this inside their app, or
 just assume it is already done.
 -Is Bluetooth programming going to be my worst nightmare, like it
 sometimes was on Windows Mobile, or smoother than I could ever hope?

 Thanks

 Nathan

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

2010-09-26 Thread Per
Oh - forgot to say that I'm working with a HTC Desire.
/Per


On 26 Sep., 09:42, Per p...@care2wear.com wrote:
 In general, the examples and hints found here, in the SDK and on
 StackOverflow will get you far.

 My experience is:
 1: You probably want to target only Android 2.2 (or higher). As far as
 I recall, SPP was not supported before 2.1 (2.0.1?), but the versions
 before 2.2. had various quirks that you need to hack around. BT in 2.2
 works as advertised.
 2: Beware that Android will not connect to devices that are set up to
 not require pairing. This is probably for security reasons, but is a
 pain IRL
 3: If you're building on the BluetoothChat example, beware that the
 UUID used there is specific to that app, and will not work with SPP
 services in general. Google for UUID and SPP.
 4: Expect some iterations getting it to work. I've pulled quite a few
 hairs on getting automatic reconnection to work (hint: ensure that
 everything is properly closed down in the right order).
 5: Log extensively to understand what's happening...

 Have fun :)
 /Per

 On 25 Sep., 00:34, Nathan critter...@crittermap.com wrote:

  I may be doing some Bluetooth Serial Port programming work for a
  client and I'm just looking for some tips in determining complexity/
  workload.
  The work is similar to reading from a bluetooth GPS (not making the
  phone a bluetooth GPS), but it is some custom hardware, so not
  exact.

  Here's what (I think) I know so far:
  I will need to pair devices with a Serial Port Profile.
  I need to connect using a BluetoothSocket which works on Android 2x
  -I don't know yet if the Android I will be a server or a client in
  this scenario.
  I will open an InputStream (no outputstream needed) and have a thread
  continually blocking for input
  I believe BluetoothChat is the best example to start with.

  What I would want to know.
  - Are there devices/manufacturers who block the bluetooth serial port,
  trying to block tethering or something like that?
     (-I've seen posts here that imply that, but I don't see a bunch of
  comments like Doesn't work on my @#$$ in Bluetooth GPS Providers in
  the market).
  -Are there going to be hardware specific oddities, or can I develop
  with my Nexus One and just hope it works on everything else?
  -Is pairing something that will require a lot of education for the
  users, and would a good app try to initiate this inside their app, or
  just assume it is already done.
  -Is Bluetooth programming going to be my worst nightmare, like it
  sometimes was on Windows Mobile, or smoother than I could ever hope?

  Thanks

  Nathan

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Please help me with calculating direction from point A to B

2010-09-23 Thread Per
hmm..

Have you checked the numerical values that you get (mHeading,
mBearing, angleDegrees) ?
Log them and check if they look reasonable (assuming that you know
where north is :). Expect some deviation caused by your surroundings.
Not only the Earth is magnetic...

If that looks ok, I'd suggest to recehck your line drawing code.
I took a simpler way (having some arrow bitmap to draw):

Drawable d = get_your_bitmap();
canvas.save();
canvas.rotate(angleDegrees, centerX, centerY);
d.draw(canvas);
canvas.restore();

BR
Per


On 22 Sep., 18:17, Pedro Teixeira pedroteixeir...@gmail.com wrote:
 Per can you explain your example a little bit further?
 My code seems fine but the direction of the arrow doesnt seem accurate:

 public void onSensorChanged(SensorEvent event) {
         double mLatitude  =  (mLocation.getLatitude()); // lat1 location  
 manager
         double mLongitude =  (mLocation.getLongitude()); // long1 locationg  
 manager
         double picLatitude = Double.parseDouble(picLatitudeString); //lat2  
 fixed
         double picLongitude = Double.parseDouble(picLongitudeString); //long2 
  
 fixed
          float mHeading = event.values[0]; // azimuth value
          float[] results = new float[1];
          Location.distanceBetween(mLatitude, mLongitude, picLatitude,  
 picLongitude, results);
         float mBearing = results[1]; // bearing
          float angleDegrees =  ((mBearing - mHeading)+360) % 360;

         myCompass.updateDirection(angleDegrees);

 }

 The update method goes simply like this:

         public void updateDirection(float dir)
                 {
                 firstDraw = false;
                 direction = dir;
                 invalidate();
                 }

 And this is how I draw the compass:

 public static class compassLook extends View {

                 private Paint paintPointer = new Paint(Paint.ANTI_ALIAS_FLAG);
                 private Paint paintCircle = new Paint(Paint.ANTI_ALIAS_FLAG);
                 private Paint paintLeters = new Paint(Paint.ANTI_ALIAS_FLAG);
                 private boolean firstDraw;
                 private float direction;

 protected void onDraw(Canvas canvas) {
                 int cxCompass = (getMeasuredWidth()/2);
                 int cyCompass = (getMeasuredHeight()/2);
                 float radiusCompass;
                 if(cxCompass  cyCompass){
                  radiusCompass = (float) (cyCompass * 0.9);
                 }
                 else{
                  radiusCompass = (float) (cxCompass * 0.9);
                 }
                 // circle drawing
                 canvas.drawCircle(cxCompass, cyCompass, radiusCompass, 
 paintCircle);
                 if(!firstDraw){

                 // line pointer
                  canvas.drawLine(cxCompass, cyCompass,
                    (float)(cxCompass + radiusCompass * 
 Math.sin((double)(-direction)  
 * 3.14/180)),
                    (float)(cyCompass - radiusCompass * 
 Math.cos((double)(-direction)  
 * 3.14/180)),
                    paintPointer);
                         double mLatitude  =  (mLocation.getLatitude()); //lat1
                         double mLongitude =  
 (mLocation.getLongitude());//long1
                         double picLatitude = 
 Double.parseDouble(picLatitudeString); //lat2
                         double picLongitude = 
 Double.parseDouble(picLongitudeString); //long2

                  // Distance formula (harversin)
                         float R = 6371; // km
                         float dLat = (float) 
 Math.toRadians(picLatitude-mLatitude);
                         float dLon = (float) 
 Math.toRadians((picLongitude-mLongitude));
                         float a = (float) (Math.sin(dLat/2) * 
 Math.sin(dLat/2) +
                                 Math.cos(Math.toRadians(mLatitude)) * Math.cos
 (Math.toRadians(picLatitude)) *
                                 Math.sin(dLon/2) * Math.sin(dLon/2));
                         float c = (float) (2 * Math.atan2(Math.sqrt(a), 
 Math.sqrt(1-a)));
                         float distancia = R * c;

                  canvas.drawText(String.valueOf(distancia*1000) + m, 
 cxCompass-30,  
 cyCompass+20, paintLeters);
                 }

 }

 I didn't wrote all the methods on compssLook since they are not  
 relevant..

 On Sep 22, 2010, at 1:12 PM, Per wrote:





  this works for me:

  1: listen to location changes. Store the most recent location. You
  need it below.
  2: listen to orientation changes. Store the most recent heading
  (azimuth) in mHeading - that's the compass direction corresponding to
  your viewing direction when holding your phone horizontally in
  portrait mode;
  3: the bearing to your destination (assuming you have its coordinates)
  can be found using Location.distanceBetween() (call it mBearing)
  4: to point your directional arrow towards the destination, its
  required rotation (from 'up') is  ((mBearing - mHeading)+360) % 360;

  You may wish to compensate

[android-developers] Re: Please help me with calculating direction from point A to B

2010-09-22 Thread Per
this works for me:

1: listen to location changes. Store the most recent location. You
need it below.
2: listen to orientation changes. Store the most recent heading
(azimuth) in mHeading - that's the compass direction corresponding to
your viewing direction when holding your phone horizontally in
portrait mode;
3: the bearing to your destination (assuming you have its coordinates)
can be found using Location.distanceBetween() (call it mBearing)
4: to point your directional arrow towards the destination, its
required rotation (from 'up') is  ((mBearing - mHeading)+360) % 360;

You may wish to compensate for device rotation (portrait/landscape),
too. See Display.getOrientation / Display.getRotation

Not a complete 3D solution, but works ok.

/Per


(not sure if the terms bearing/heading are 100% in sync with common
naval use, but hey...)

On 22 Sep., 11:28, Kostya Vasilyev kmans...@gmail.com wrote:
   Pedro,

 I think you should learn something about the way direction (and
 orientation) is specified in computer programming.

 http://en.wikipedia.org/wiki/Yaw,_pitch,_and_roll

 http://en.wikipedia.org/wiki/Euler_angles

 http://en.wikipedia.org/wiki/Rotation_representation_(mathematics)#Ro...

 I believe that Android orientation sensors work this way.

 Now about the compass

 There are two ways you can think about this:

 First, take the value you get from the algorithm and make it into a
 vector in 3D space (i.e. think of the arrow you're going to draw to
 indicate direction). Then:

 One: Compute the device's orientation matrix using sensor data. Take the
 inverse of this matix, and multiply the arrow vector by this matrix.

 Two: Compute the device's orientation matrix using sensor data. Rather
 than interpreting it as a rotation matrix, think of it as defining a
 plane in space (aligned with the device's screen).  Then project the
 arrow vector onto this plane, in the plane's coordinates.

 You might want to start with compensating just for the vertical axis
 (the device's rotation from the true north direction), it might be enough.

 -- Kostya

 22.09.2010 13:02, Pedro Teixeira пишет:





  I'm really not understanding how to go with this...

  I've been reading and reading.. I can find all kind of algorithms.. I
  can find a haversin algorithm that points me to the correct direction
  if my device is pointing north.. but the needle is static... so if i
  change the device orientation the measure is incorrect... and I know
  this happens because I'm not using device's sensor values like
  azimuth, pitch and roll.. oh god.. 2 weeks on this.. I'm just
  desperate now.

  On Sep 18, 2010, at 10:29 AM, Kostya Vasilyev wrote:

  Pedro,

  If I understand you correctly, you are having difficulties with the
  device's orientation.

  The bearing angle seems to be computed in the horizontal plane. If
  you wish to adjust for the device's orientation, you need to
  concatenate it with the bearing angle.

  Google for quaternions.

  This is a (relatively) simple math technique to work with rotations
  the same way you can work with vectors: add / subtract, interpolate.

  -- Kostya

  18.09.2010 0:56, Pedro Teixeira пишет:
  Hi everyone...

  I'm back with the same issue for the last couple of days… I'm trying
  to create a compass for my application BUT the difference is that,
  instead of having a line always pointing to north, I want this line to
  point for a specific point. I've been trying dozens of algorithms and
  nothing works..
  I've finally found one that points me exactlly to the point I want..
  BUT it doesn't move if I change the position of the device which is my
  objective.. basicly, what I want is that no matter the direction I'm
  using my device.. the line always point me to the point
  (picLatitude,picLongitude)…

  I understood that for the line to move, I can't use static variables…
  I need to use the values offered by the onSensorChanged(SensorEvent
  event).

  This are the data I have available:

  event.values[0]: azimuth, rotation around the Z axis (device in
  relation to north, 0º)
  event.values[1]: pitch, rotation around the X axis
  event.values[2]: roll, rotation around the Y axis
  mLatitude: device current latitude gottern from GPS (variable)
  mLongitude: device current longitude gotten from GPS (variable)
  picLatitude: static picture latitude established previously
  picLongitude: static picture longitude established previously
  distance: distance in Km from device to the picture calculated
  previously

  And this the formula that works correct, and gives me the correct
  angle.. ( BUT IT DOESN'T USE ANY OF THE SENSOR DATA SO THE LINE
  COMPASS DOESNT MOVE):

  double dLong = picLongitude - mLongitude;
  double y =  (Math.sin(dLong) * Math.cos(picLatitude));
  double x =  (Math.cos(mLatitude) * Math.sin(picLatitude) -
  Math.sin(mLatitude)*Math.cos(picLatitude)*Math.cos(dLong));
  double angleDegreesWrongRange = Math.abs(Math.toDegrees(Math.atan2(y,
  x

[android-developers] Re: Find the location in Android Map

2010-09-16 Thread Per
Hi there,

I see at least two issues:
1: your button click listener takes lat/long from the EditText's, then
effectively starts the Maps app (Intent url is geo:lat,long).
2: The GeoPoint constructor takes coordinates that are scaled by
100, i.e. 45.7 N would be 4570. (see e.g.
http://developer.android.com/resources/tutorials/views/hello-mapview.html)

BR
Per



On 15 Sep., 19:59, Dhrumil Shah dhrumilsh...@gmail.com wrote:
 Hey TreKing,

 If you dont mind, just refer this code.
 You exactly got what is going on here. I am new in Android so I dont know
 what is stack trace and log? How to check stack trace?

 So here is my code.

 public class ShowLocation extends MapActivity {
 private EditText lat;
 private EditText lng;
  GeoPoint gp=null;
  MapController  mapcontroller;
     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);

         Button btn = (Button)findViewById(R.id.btnShow);
         lat = (EditText)findViewById(R.id.lat);
         lng = (EditText)findViewById(R.id.lng);

         MapView mapView = (MapView)findViewById(R.id.myGMap);

         mapcontroller = mapView.getController();

         //gp = new GeoPoint(lat.intValue(), lng.intValue());
         mapView.setSatellite(true);
         mapView.setTraffic(true);
         mapView.setStreetView(true);
         mapView.displayZoomControls(true);
         mapView.setBuiltInZoomControls(true);

         //mapcontroller.animateTo(gp);
         mapcontroller.setZoom(2);
         LocationManager locationManager;
         String context = Context.LOCATION_SERVICE;
         locationManager = (LocationManager)getSystemService(context);

         Criteria criteria = new Criteria();
         criteria.setAccuracy(Criteria.ACCURACY_FINE);
         criteria.setAltitudeRequired(true);
         criteria.setBearingRequired(false);
         criteria.setCostAllowed(true);
         criteria.setPowerRequirement(Criteria.POWER_HIGH);
         String provider = locationManager.getBestProvider(criteria, true);

      Location location = locationManager.getLastKnownLocation(provider);

         btn.setOnClickListener(new View.OnClickListener() {
 �...@override
 public void onClick(View v) {
 // TODO Auto-generated method stub
 String _lat = lat.getText().toString();
 String _lng = lng.getText().toString();
 Uri uri = Uri.parse(geo:+_lat+,+_lng);
  startActivity(new Intent(Intent.ACTION_VIEW, uri));
 //mapcontroller.animateTo(gp);
 mapcontroller.setZoom(2);}
 });

         String _lat,_lng;
         MapOverlay mylocationoverlay = new MapOverlay();
         ListOverlay list = mapView.getOverlays();
         list.add(mylocationoverlay);
     }
  protected class MapOverlay extends com.google.android.maps.Overlay{
  public boolean draw(Canvas canvas, MapView myGMap, boolean shadow, long
 when){
 Paint paint = new Paint();
 //mapcontroller.animateTo(gp);
 super.draw(canvas, myGMap, shadow);
  Point myScreenCoords = new Point();
 //mapview.getProjection().toPixels(gp, myScreenCoords);
 //paint.setARGB(255, 255, 255, 255);
 Drawable marker = getResources().getDrawable(R.drawable.marker);
 Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
 R.drawable.marker);
 canvas.drawBitmap(bitmap, myScreenCoords.x, myScreenCoords.y, paint);
 canvas.drawText(Location is at here.., myScreenCoords.x, myScreenCoords.y,
 paint);
 return true;}
 }

 �...@override
 protected boolean isRouteDisplayed() {
 // TODO Auto-generated method stub
 return false;

 }
 }

 ~Dhr



 On Wed, Sep 15, 2010 at 11:17 PM, TreKing treking...@gmail.com wrote:
  On Wed, Sep 15, 2010 at 12:42 PM, Dhrumil Shah 
  dhrumilsh...@gmail.comwrote:

  You can change this at any time.
  - Ya, i know that thing, but its not working in my this application.

  It's not working is not useful information.

  Or you can animate or snap to the exact location.
  - I used this method but it generates and force close error on my
  emulator.

  Did you check the stack trace?

  Why not?
  -I dont know why not. I try to debug it but it gives me nothing.

  Nothing? No logs, no stack trace?

  --- 
  --
  TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
  transit tracking app for Android-powered devices

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

[android-developers] StreetView intent - support for address?

2010-09-09 Thread Per
Hi,
The published intents list (http://developer.android.com/guide/
appendix/g-app-intents.html) mentions only geocoordinates as input to
StreetView.

Does anyone know if addresses can be specified?
This is possible for Maps, so...

Anyway, I tried 'google.streetview:q=address' and
'google.streetview:cbq=address' (inspired by the format for Maps),
but that won't work.

The reason I need this is that the geooordinates I have sometimes lie
just a bit too far from the street address for StreetView to capture
them, producing an empty StreetView activity that just waits
forever...

Also, it appears the navigation is accessible through:
'google.navigate:q=address' (if installed, of course)

BR
Per

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 configure SDK emulator to start with english instead of japanese?

2010-08-26 Thread Per-Jarle Sæther
Hi again Kostya
The Wipe User Data is not checked in any of my run configurations.

Best regards
Per-Jarle

On Thu, Aug 26, 2010 at 9:37 AM, Kostya Vasilyev kmans...@gmail.com wrote:

 Have you tried disabling wipe user data in the emulator launch dialog? I
 just verifified that it does help to leave it off.

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

 26.08.2010 11:19 пользователь Per-Jarle Sæther 
 per.jarle.saet...@gmail.com написал:


 Hi, and thank you for replying to me

 The japanese settings are coming back every time I start the simulator or
 run an app (doesn't matter if the simulator is restarted or not)

 The attached picture shows the Compose message application after I changed
 the settings and thereafter ran an application.

 It seems like the simulator is reset or settings uploaded during the upload
 of the application.

 Best regards
 Per-Jarle




 On Wed, Aug 25, 2010 at 5:28 PM, { Devdroid } webnet.andr...@gmail.com
 wrote:
 
  2010/8/25 Per...

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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] How to configure SDK emulator to start with english instead of japanese?

2010-08-25 Thread Per-Jarle Sæther
Hello all
I'm new to Android development and have just startet playing with the SDK.

One thing that is annoying is that the emulator always start with Japanese
settings.
I have found out how to fix this by going into settings and remove all the
Japanese stuff, but this is time consuming since I have to do it every time
I start the emulator.

Can someone help me change the startup settings for the emulator?

Thanks in advance

/Per-Jarle

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 manipulate order of views in a viewgroup using drag'n'drop

2010-08-19 Thread Per-Jarle Sæther
Hi all
I want to develop an application that contains 4 views in one viewgroup

The following interactions shall be possible:

   1. change ordering
  - When you drag a finger from one view to another, the two views shall
  swap
   2. maximize one view
  - When you click on one view, it shall maximize (remove other 3 views)
  - when maximized, a single touch shall give back the quad view
  3. Start rotation between maximized views
  - When push and hold, it shall start rotation between all views
  showing one maximized at a time in the same order as the views are
  organized.
  - When rotation running, a single touch should give back the quad view

I would be thankful if someone can give me some hints how to accomplish
this. If possible with some sample code

Best regards
Per-Jarle

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

[android-developers] Dalvik VM vs Sun JVM - compabillity

2010-08-18 Thread Per-Jarle Sæther
Hi all
I am new to Android development

Are there any compability issues between a standard JVM and Dalvik VM?

Are there any classes or packages from the Sun SDK that can't be used on
Android?

Best regards
Per-Jarle Sæther

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

[android-developers] Bluetooth, RFCOMM socket close error ?

2010-07-18 Thread Per
Hi all,

Using this list as a valuable source of info, I've been able to
succesfully create an RFCOMM connection and transfer data over it,
using my HTC Desire.
The primary obstacle was the failure of
BluetoothDevice.createRfcommSocketToServiceRecord(), circumvented by
reflection (createRfcommSocket). Search this group or
stackoverflow.com for example code.

So far, so good.
But - after closing down the connection following what I think is
correct procedure (close streams, then close socket, each encapsulated
in try/catch), the next call to connect() blocks until I call close()
from another thread.

In this scenario, Logcat always contains:

E/BTLD(23644): RFCOMM_CreateConnection - already opened state:2,
RFC state:4, MCB state:5

- despite the fact that I (think I) have closed everything properly.

The only cure I've been able to find is cycling BT off and on, which
is a bit much, I think... Doable from code, but definitely not a nice
thing to do.

Am I missing a point somewhere, or is this a known bug in the BT stack
(possibly HTC specific) ?

BR
Per



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: CANNOT manage to get ADB working whatever I do.

2010-06-02 Thread Per
you can fetch it directly from HTC:
http://www.htc.com/www/supportdownloadlist.aspx?p_id=312act=sdcat=all


On 1 Jun., 14:29, HLL hll...@gmail.com wrote:
 Worth a shoot, could you upload this thing? cuz i don't have this
 thing on my card that came with the device...

 On Jun 1, 9:29 am, Per p...@care2wear.com wrote:

  I initially had the same problem (HTC Desire, which I believe is
  99.9%=Nexus One) on Win32 (Vista, XP). SDK USB driver didn't work.
  I came across a recommendation to install the HTCSync exe that was on
  the SD card - and that did it.

  I assume that something equivalent exists for the N1?

  BR
  Per

  On 25 Maj, 17:20, HLL hll...@gmail.com wrote:

   Hay everyone,

   I Want to start developing for android and for some reason whatever I
   do I can not make ADB show up my Nexus One.

   Both on and off in development mode
   Both SD Mount and without SD Mount
   Both With usb tethering on and off

   for all adb devices(windows XP64bit) show no device (service started
   successfully, device recognized in Device Manager correctly).

   Tried reinstalling drivers, tried uninstalling drivers
   completely(using 3rd party software) and reinstalling, tried different
   versions of the usb driver (up to the one before the last - that came
   with the 2.1 sdk)
   NOTHING...
   It seems online that this issue reoccurs on different devices, but all
   of them seemed to solve with one of the above solutions, Which none
   worked for me.

   It does not look like a hardware problem, because EVERYTHING else that
   is USB'ed works correctly.

   Any non-already tried idea would be appreciated.

   Regards,
  Hillel

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: CANNOT manage to get ADB working whatever I do.

2010-06-01 Thread Per
I initially had the same problem (HTC Desire, which I believe is
99.9%=Nexus One) on Win32 (Vista, XP). SDK USB driver didn't work.
I came across a recommendation to install the HTCSync exe that was on
the SD card - and that did it.

I assume that something equivalent exists for the N1?

BR
Per


On 25 Maj, 17:20, HLL hll...@gmail.com wrote:
 Hay everyone,

 I Want to start developing for android and for some reason whatever I
 do I can not make ADB show up my Nexus One.

 Both on and off in development mode
 Both SD Mount and without SD Mount
 Both With usb tethering on and off

 for all adb devices(windows XP64bit) show no device (service started
 successfully, device recognized in Device Manager correctly).

 Tried reinstalling drivers, tried uninstalling drivers
 completely(using 3rd party software) and reinstalling, tried different
 versions of the usb driver (up to the one before the last - that came
 with the 2.1 sdk)
 NOTHING...
 It seems online that this issue reoccurs on different devices, but all
 of them seemed to solve with one of the above solutions, Which none
 worked for me.

 It does not look like a hardware problem, because EVERYTHING else that
 is USB'ed works correctly.

 Any non-already tried idea would be appreciated.

 Regards,
 Hillel

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

2010-05-04 Thread Per
(blushing)
arrgh - should have thought of that. You're right. Wifi access to that
ip:port does not work from a PC, either.

Sorry for taking up anyone's bandwidth :)

/Per


On 4 Maj, 07:49, Vinay S s.vinay@gmail.com wrote:
 Hi,

 Did you look at the router does it allow outgoing TCP traffic to flow
 through for port 8080?

 -Vinay

 On May 3, 3:48 pm, Per p...@care2wear.com wrote:



  Hi,

  I have trouble getting http post to work over WiFi.

  The server listens at port 8080, and posting works just fine when
  disabling WiFi and just using 3G.
  When enabling WiFi, I always get an IOException with message 'Socket
  is not connected'.

  Using the standard port 80 (or opening raw sockets to other ports)
  works just fine, but the combination (http + 8080 + WiFi) seems to
  fail.

  I've been looking for hints in the android.net package, but
  unsuccessfully. Any hints are welcome..

  /Per

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

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

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


[android-developers] HTTP post to non-standard port over Wifi?

2010-05-03 Thread Per
Hi,

I have trouble getting http post to work over WiFi.

The server listens at port 8080, and posting works just fine when
disabling WiFi and just using 3G.
When enabling WiFi, I always get an IOException with message 'Socket
is not connected'.

Using the standard port 80 (or opening raw sockets to other ports)
works just fine, but the combination (http + 8080 + WiFi) seems to
fail.

I've been looking for hints in the android.net package, but
unsuccessfully. Any hints are welcome..

/Per

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

2010-02-01 Thread Per Sandström
you could simplify your code by using openOrCreateDatabase
(DATABASE_NAME, Context.MODE_PRIVATE, null); instead. :) Maybe then
the problem will resolve itself.

Cheers,
Per Sandström

On Jan 29, 5:52 pm, Josema jose.maria.estr...@gmail.com wrote:
 Hi,

 im doing debug with my mobile. My code works in the past, but now is not
 working and i dont know why i cant create or open an existing database.

 Here is my 
 code:http://stackoverflow.com/questions/2163100/creating-database-in-android

 Could you help me about how to solve this problem?

 I read that there is an option from the command line:

 emulator -wipe-data but since im not using an emulator to debug the
 application (im using my own android mobile), im lost about how to solve the
 problem.

 Thanks in advance.
 Best Regards.
 Josema.

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

2010-01-28 Thread Per Sandström
I think this works:

InputMethodManager inputMethodManager = (InputMethodManager)
getSystemService(
Context.INPUT_METHOD_SERVICE );
inputMethodManager.showSoftInput ( yourEditText,
InputMethodManager.SHOW_FORCED );

you might have to force the edittext to be focused by running
yourEditText.requestFocus() first, Im not sure.

cheers,

On Jan 28, 11:16 am, swapnil kamble swap.kam...@gmail.com wrote:
  I want to display keyboard when my app gets started. I know we can get
 Virtual Keyboard when clicked on EditText field, but I want to show Virtual
 Keyboard without clicking on EditText.

 Swapnil

 || Hare Krishna Hare Krishna Krishna Krishna Hare Hare ||
 || Hare Rama    Hare Rama   Rama   Rama    Hare Hare ||

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

2010-01-25 Thread Per Sandström
After turning off copy protection and losing db and local files, are
there any way to restore them?

Regards,
Per Sandström

On Jan 15, 6:10 am, Kumar Bibek coomar@gmail.com wrote:
 Hi Andrei,

 If you don't care about dev phones downloading your app, and ripping
 apart your db and local files, then it's fine.

 Kumar Bibek

 On Jan 15, 6:34 am, Andrei gml...@gmail.com wrote:

  I have Copy Protection turned on for my app, but now i want to
  remove it
  Will there be any problems if i remove it now?
  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: Stack trace does not reference application

2009-12-23 Thread Per Sandström
Im having huge problems with this right now. More and more droid-users
are suffering from it. Is there any information on when this happens,
so maybe I can do a workaround to avoid the crashes until the
plattform is patched?

On 16 Dec, 18:58, Romain Guy romain...@android.com wrote:
 This is a known bug in the platform.

 2009/12/16 Per Sandström pg.sandst...@gmail.com:



 So I have an app on the market with 10k active users. I have recieved 
 maybe 50complaints from Droid-user that the program crashes
  arbitrarily. I have not been able to replicate the error with my own
  droid, but I got one of the to send me this crash log. However, it
  does not reference the application.

  Do you have any suggestions on how to track down this error? I stand
  baffled.

  11-25 16:18:03.730 D/AndroidRuntime( 2964): Shutting down VM
  11-25 16:18:03.730 W/dalvikvm( 2964): threadid=3: thread exiting with
  uncaught exception (group=0x4001b180)
  11-25 16:18:03.730 E/AndroidRuntime( 2964): Uncaught handler: thread
  main exiting due to uncaught exception
  11-25 16:18:03.761 E/AndroidRuntime( 2964): java.lang.

  IndexOutOfBoundsException: getChars (5 ... 0) has end before start
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  android.text.SpannableStringBuilder.checkRange
  (SpannableStringBuilder.java:935)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  android.text.SpannableStringBuilder.getChars
  (SpannableStringBuilder.java:847)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  android.text.TextUtils.getChars(TextUtils.java:69)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  android.text.SpannableStringBuilder.init(SpannableStringBuilder.java:
  59)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  android.text.SpannableStringBuilder.subSequence
  (SpannableStringBuilder.java:839)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  android.widget.TextView.extractTextInternal(TextView.java:4542)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  android.widget.TextView.reportExtractedText(TextView.java:4581)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  android.widget.TextView.finishBatchEdit(TextView.java:4724)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  android.widget.TextView.endBatchEdit(TextView.java:4706)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  com.android.internal.widget.EditableInputConnection.endBatchEdit
  (EditableInputConnection.java:54)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  com.android.internal.view.IInputConnectionWrapper.executeMessage
  (IInputConnectionWrapper.java:334)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  com.android.internal.view.IInputConnectionWrapper
  $MyHandler.handleMessage(IInputConnectionWrapper.java:57)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  android.os.Handler.dispatchMessage(Handler.java:99)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at android.os.Looper.loop
  (Looper.java:123)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  android.app.ActivityThread.main(ActivityThread.java:4310)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  java.lang.reflect.Method.invokeNative(Native Method)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  java.lang.reflect.Method.invoke(Method.java:521)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
  (ZygoteInit.java:860)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
  11-25 16:18:03.761 E/AndroidRuntime( 2964): at
  dalvik.system.NativeStart.main(Native Method)
  11-25 16:18:03.777 I/Process ( 1015): Sending signal. PID: 2964 SIG: 3
  11-25 16:18:03.777 I/dalvikvm( 2964): threadid=7: reacting to signal 3
  11-25 16:18:03.832 I/dalvikvm( 2964): Wrote stack trace to '/data/anr/
  traces.txt'
  11-25 16:18:05.543 I/Process ( 2964): Sending signal. PID: 2964 SIG: 9
  11-25 16:18:05.558 I/ActivityManager( 1015): Process myapp.myapp (pid
  2964) has died.

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

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

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

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


[android-developers] Stack trace does not reference application

2009-12-16 Thread Per Sandström
So I have an app on the market with 10k active users. I have recieved
maybe 50 complaints from Droid-user that the program crashes
arbitrarily. I have not been able to replicate the error with my own
droid, but I got one of the to send me this crash log. However, it
does not reference the application.

Do you have any suggestions on how to track down this error? I stand
baffled.

11-25 16:18:03.730 D/AndroidRuntime( 2964): Shutting down VM
11-25 16:18:03.730 W/dalvikvm( 2964): threadid=3: thread exiting with
uncaught exception (group=0x4001b180)
11-25 16:18:03.730 E/AndroidRuntime( 2964): Uncaught handler: thread
main exiting due to uncaught exception
11-25 16:18:03.761 E/AndroidRuntime( 2964): java.lang.

IndexOutOfBoundsException: getChars (5 ... 0) has end before start
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
android.text.SpannableStringBuilder.checkRange
(SpannableStringBuilder.java:935)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
android.text.SpannableStringBuilder.getChars
(SpannableStringBuilder.java:847)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
android.text.TextUtils.getChars(TextUtils.java:69)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
android.text.SpannableStringBuilder.init(SpannableStringBuilder.java:
59)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
android.text.SpannableStringBuilder.subSequence
(SpannableStringBuilder.java:839)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
android.widget.TextView.extractTextInternal(TextView.java:4542)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
android.widget.TextView.reportExtractedText(TextView.java:4581)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
android.widget.TextView.finishBatchEdit(TextView.java:4724)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
android.widget.TextView.endBatchEdit(TextView.java:4706)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
com.android.internal.widget.EditableInputConnection.endBatchEdit
(EditableInputConnection.java:54)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
com.android.internal.view.IInputConnectionWrapper.executeMessage
(IInputConnectionWrapper.java:334)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
com.android.internal.view.IInputConnectionWrapper
$MyHandler.handleMessage(IInputConnectionWrapper.java:57)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
android.os.Handler.dispatchMessage(Handler.java:99)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at android.os.Looper.loop
(Looper.java:123)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
android.app.ActivityThread.main(ActivityThread.java:4310)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
java.lang.reflect.Method.invokeNative(Native Method)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
java.lang.reflect.Method.invoke(Method.java:521)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:860)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
11-25 16:18:03.761 E/AndroidRuntime( 2964): at
dalvik.system.NativeStart.main(Native Method)
11-25 16:18:03.777 I/Process ( 1015): Sending signal. PID: 2964 SIG: 3
11-25 16:18:03.777 I/dalvikvm( 2964): threadid=7: reacting to signal 3
11-25 16:18:03.832 I/dalvikvm( 2964): Wrote stack trace to '/data/anr/
traces.txt'
11-25 16:18:05.543 I/Process ( 2964): Sending signal. PID: 2964 SIG: 9
11-25 16:18:05.558 I/ActivityManager( 1015): Process myapp.myapp (pid
2964) has died.

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

2009-12-11 Thread Per Sandström
If I am in the emulator and press alt+enter to get full screen, the
emulator closes and the following output is written in the console:

[2009-12-11 15:01:00 - Emulator]### Error: could not create or resize
SDL window: No video mode large enough for 1050x1680

Note that I have my monitor flipped to the side. The resolution isnt
1680*1050, but 1050*1680. This bug has only happened on this
resolution with flipped monitor. I have tried maybe three different
resolutions, but nothing bigger than this. The error is replicable
since it happens everytime I try to go into fullscreen mode. I would
very much prefer if the action was cancelled instead of the emulator
closing.

If there is a more appriopriate place to file a bug report, then
please inform me and I will file it there.

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


[android-developers] Something wrong here error message

2009-11-27 Thread Per Sandström
I have had a few reports coming in from Droid-users using my apps and
getting this error message:

11-25 16:17:44.589 W/UsageStats( 1015): Something wrong here, didn't
expect (package name) to be resumed

Everytime I have got an error description for this, I have never been
able to reproduce the error on the emulators. Are there any good
information on what exactly this error is? I have a hard time
imagining what such an error message can really mean.

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


[android-developers] Changing the factory reset-state

2009-11-24 Thread Per Sandström
I am in a situation where I want to make alot of android-phones fool-
proof, so that a company or agency can distribute phones with certain
apps installed, and maybe even the apps configured in a certain way.
It should be easy to reset the phone to this state, perhaps through
the factory reset. Is there any documentation on how to do this? I see
this as something very important for Android to be used in these
contexts. Relying on the personell to configure and care for the
settings of their phone is not an option in this case.

Cheers,
Per Sandström

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


[android-developers] Re: Our app is not visible on market for some devices

2009-11-23 Thread Per Sandström
I have seen other discussions where is seems as if the general
consensus is that the market is bugged. Apps will simply arbitrarily
not show for some phones. Our company has suffered the same way, and I
have yet to find a solution. Two exact identical phones, both had just
been factory resetted,only one can find our app.

On Nov 23, 11:30 pm, Klaus Kartou kar...@gmail.com wrote:
 This thread is a follow up from that thread. I contacted Google´s market
 support about this issue, but haven't received a reply...
 I would really be interested in an official response to this issue. We have
 many people that complains about not being able to download our app.

 On Mon, Nov 23, 2009 at 11:20 PM, String sterl...@addressender.com wrote:
  According to this thread:

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

  apps with a manifest permission of CAMERA don't seem to appear on the
  Market from the Tattoo. No explanation yet of why, or if anyone from
  HTC/Google is aware of the problem, or what you can do about it if
  your app requires the camera.

  String

  On Nov 23, 9:15 pm, Klaus Kartou kar...@gmail.com wrote:
   Thank you for your fast response!
   We havent activated copy protection, so that is not the issue.

   On Mon, Nov 23, 2009 at 10:11 PM, Greg Donald gdon...@gmail.com wrote:
On Mon, Nov 23, 2009 at 3:10 PM, Klaus Kartou kar...@gmail.com
  wrote:
 Our app does not show up on the market on HTC Tattoo/Dragon devices.

Copy protection bug.  If you disable it your app will probably appear.

--
Greg Donald
   http://destiney.com/

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

2009-09-04 Thread Per Sandström

I have a function that performs two things: First it should set an
invisible image to be visible, and then it should read a huge shunk of
data from a database. Performing this is easy, but my problem is that
android threads this, resulting in a delay of almost a second before
the image becomes visible. I have tried extending the images draw-
function, and initiating the database-read when draw() is finished,
but it seems that when the draw-function finishes the image is not yet
visible on the screen. How should I find out when the image actually
is visible?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Log in to google account without browser?

2009-09-03 Thread Per Sandström

Hi,

Im currently trying to combine android and google apps engine for a
real neat application, not unlike http://3banana.com/. However I want
to enable the user to login to his google account without opening the
browser. I have made some attempts to just simulate the http-posts
done, but to no avail. Are there any nice way of doing this google
account login in android code?

For example, to make my own loginscreen, and then send user/pass to
the google apps server and get an aknowledgement if the login
information was correct.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] change color of fading edge in listview

2009-08-07 Thread Per Sandström

i have a listview with a very white layout. Thus I wish the fading
edge was black, instead of white as it is right now. How can I change
this? As far as I can see it cant be done in xml...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sharing data between activities

2009-08-05 Thread Per Sandström

thanks man, that is an excellent way of explaining so even an android-
beginner can understand. Is there a similar way of returning data to
the first activity when the second activity has finished running,
corresponding to javas return value1;?

Regards
Per Sandström

On 4 Aug, 17:44, powerbyte powerb...@gmail.com wrote:
 Hello

 To summarize: Activities don't have constructors! How do I send data
 to them from their parent activity???

 we can send data from parent activity to childs, using Intent

 for example:

 In parent activity,

   Intent intent = new Intent(this,com.sample.aaa.class); //aaa is
 child activity
   intent.putExtra(ARG1,value1);
   intent.putExtra(ARG2,value2);
   StartActivity(intent);

 In Child activity (aaa) use Bundle to get the data

   public void onCreate(Bundle som) {
         super.onCreate(som);

          Intent intent = this.getIntent();
          Bundle b = intent.getExtras();
          String sVal1 =  b.getString(ARG1);
          String sVal2 =  b.getString(ARG2);
           
           ...

 }

 -pb

 On Aug 4, 6:31 pm, Per Sandström pg.sandst...@gmail.com wrote:

  but how do I create and pass this global object? I cant do it like I
  do in java or other programming languages where . AIDL is an
  alternative, but it still seems overkill for a small app.

  regards
  Per Sandström

  On Jul 22, 10:50 pm, niko20 nikolatesl...@yahoo.com wrote:

   On Jul 22, 1:19 pm, Roman roman.baumgaert...@t-mobile.com wrote:

Android supports multiple IPC mechanisms.

You can use the Intent mechanism as well as the AIDL mechanism for
doing this. The AIDL approach is more complex but offers you also more
flexibility to pass objects.

Find information about this topic on

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

--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.

On Jul 22, 6:49 am, PerSandströmpg.sandst...@gmail.com wrote:

 So far I have been using SharedPreferences to share data between
 activities. But I would very much like to find a better way. I would
 simply like both Activity1 and Activity2 to share Object1. Activity1
 will create Object1 and then start Activity2. What is the smartest way
 to give Activity2 a pointer to Object1?

 To summarize: Activities don't have constructors! How do I send data
 to them from their parent activity???

 Regards,
 PerSandström

   Hi,

   If both activities are in the same application, then just use a global
   object and pass that around (singleton or such). Not too tough.

   -niko- Hide quoted text -

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



[android-developers] Re: Sharing data between activities

2009-08-04 Thread Per Sandström

but how do I create and pass this global object? I cant do it like I
do in java or other programming languages where . AIDL is an
alternative, but it still seems overkill for a small app.

regards
Per Sandström

On Jul 22, 10:50 pm, niko20 nikolatesl...@yahoo.com wrote:
 On Jul 22, 1:19 pm, Roman roman.baumgaert...@t-mobile.com wrote:



  Android supports multiple IPC mechanisms.

  You can use the Intent mechanism as well as the AIDL mechanism for
  doing this. The AIDL approach is more complex but offers you also more
  flexibility to pass objects.

  Find information about this topic on

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

  --
  Roman Baumgaertner
  Sr. SW Engineer-OSDC
  ·T· · ·Mobile· stick together
  The views, opinions and statements in this email are those of the
  author solely in their individual capacity, and do not necessarily
  represent those of T-Mobile USA, Inc.

  On Jul 22, 6:49 am, PerSandströmpg.sandst...@gmail.com wrote:

   So far I have been using SharedPreferences to share data between
   activities. But I would very much like to find a better way. I would
   simply like both Activity1 and Activity2 to share Object1. Activity1
   will create Object1 and then start Activity2. What is the smartest way
   to give Activity2 a pointer to Object1?

   To summarize: Activities don't have constructors! How do I send data
   to them from their parent activity???

   Regards,
   PerSandström

 Hi,

 If both activities are in the same application, then just use a global
 object and pass that around (singleton or such). Not too tough.

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



[android-developers] Sharing data between activities

2009-07-22 Thread Per Sandström

So far I have been using SharedPreferences to share data between
activities. But I would very much like to find a better way. I would
simply like both Activity1 and Activity2 to share Object1. Activity1
will create Object1 and then start Activity2. What is the smartest way
to give Activity2 a pointer to Object1?

To summarize: Activities don't have constructors! How do I send data
to them from their parent activity???

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



[android-developers] Re: using touch screen to draw a straight line

2009-04-14 Thread Per Sandström

Here is another bug in the code:

if(i == 0) {
static_x = event.getX();
static_y = event.getY();
i = 1;
} else
{
static_x1 = event.getX();
static_y1 = event.getY();

}
   // want to draw a line at this stage after figuring out two
screen
touches have been performed ??
   if(i == 1) {

As you can see, you set i = 1 on the first time this function is
called. Thus the second if-statement is always true. Add an else
before the last if

On Apr 14, 2:12 am, gandor gand...@gmail.com wrote:
 Hi Folks,

 Want to draw a line when I touch screen at two points.
 I can see OnTouch been invoked but after than everything breaks looks,
 the application crashes

 I am using drawLine in Canvas.
 Please let me know what I am doing wrong

 Thanks a ton

 
 ?xml version=1.0 encoding=utf-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
     android:id=@+id/layout_id
     android:orientation=vertical
     android:layout_width=fill_parent
     android:layout_height=fill_parent
     
 TextView
     android:layout_width=fill_parent
     android:layout_height=wrap_content
     android:text=@string/hello
     /
 /LinearLayout
 --

 package .DrawPoints;

 import android.app.Activity;
 import android.content.Context;
 import android.graphics.Canvas;
 import android.graphics.Color;
 import android.graphics.Paint;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.View.OnTouchListener;
 import android.widget.TextView;

 public class DrawPoints extends Activity implements OnTouchListener{
         static int i = 0;
         static float static_x = 0;
         static float static_y = 0;
         static float static_x1 = 0;
         static float static_y1 = 0;

     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
         View topLayout = this.findViewById(R.id.layout_id);
         // register for events for the view, previously
         topLayout.setOnTouchListener((OnTouchListener) this);

 }

   // the following callback is called when touch event on screen
 happens
         @Override
         public boolean onTouch(View v, MotionEvent event) {
                 String tag = null;

                 if(i == 0) {
                 static_x = event.getX();
                 static_y = event.getY();
                 i = 1;
                 } else
                 {
                         static_x1 = event.getX();
                         static_y1 = event.getY();

                 }
            // want to draw a line at this stage after figuring out two screen
 touches have been performed ??
                if(i == 1) {
                Paint p = new Paint();
                p.setColor(Color.WHITE);
            p.setStyle(Paint.Style.STROKE);
           Canvas canvas = new Canvas();
            canvas.drawColor(Color.BLUE);

            canvas.drawLine(static_x, static_y, static_x1, static_y1,
 p);
                 i = 0;
         }

                return false;
         }

      }

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