[android-developers] Support for Cross-Platform Windowed 3D

2017-08-02 Thread Alistair Lowe
Hi guys,

I'm wishing to integrate a 3D view into my app that contains a single 
textured and rigged 3D model of a human, there's no requirement for any 
interactive controls.

Is it possible to:
A. Display a 3D view/window within a standard app surrounded by standard UI 
widgets?
B. Are there any tools that will do this cross-platform for both Android 
and iOS?

Appreciate any advice!

Many thanks

-- 
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.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/5e922b74-8a5c-4e22-bba0-bd73dfb95d03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Android NFC Options

2012-06-21 Thread Alistair Lowe
Hi guys,

I'm attempting to get into NFC on Android by communicating with a custom 
PN532 device, however I'm a little confused as to my options and the 
Android protocol.


   - NFCIP-1, is it possible to place my device as a target into this mode, 
   for Android to automatically detect and communicate with to load an app or 
   can this only be done in card emulation mode (i.e. does NFCIP-1 have to be 
   actively triggered)?
   - What's the easiest to use card emulation mode for the sake of data 
   format simplicity? (get an NDEF file over to the phone as simple and easy 
   as possible that it will automatically act upon)?

Any help/advice is very much appreciated,
Many 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] Custom SurfaceView with overlayed views

2011-04-07 Thread Alistair
Hi there,

My program is a grid (surfaceView) which holds tiles. The surfaceView
runs a thread which has synchronized access to the surfaceView (I used
the lunar lander example).

The surfaceview is added programmatically to a frame layout. I have a
palette object which extends a view. When i touch the palette view,
after a while, i get a SIGSEV. I think this is because of multiple
threads accessing the same object but I've tried everything to fix
it.

Should I try to avoid using views over the top of each other? Does
this kind of thing happen because of the way android works? Or is it
purely my fault for being an idiot?

Cheers.

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

2010-11-03 Thread Alistair.
Thanks Jason. One month later and I finally got it working. You were
correct but it has taken a bit of time me to get my head around what
was going on. You suggestion would rotate the texture around the point
at which it was drawn but I wanted to rotate it around it's mid-point.
I see now that the secret is to:

- translate the origin to a draw point plus half the width and height.
- rotate
- translate back by half the width and height.
- draw

Here is my code. Note to anyone looking at this that I have just tried
it out and I am sure it can be tidied up. Also most importantly I am
adjusting the co-ordinate system to match that of canvas where the top
left is (0,0). This is because by drawing primitives as set to work in
Canvas as well.

surface.glMatrixMode(GL10.GL_MODELVIEW);

Grid.beginDrawing(surface, true, false);

surface.glBindTexture(GL10.GL_TEXTURE_2D, ids[index]);

surface.glLoadIdentity();

surface.glPushMatrix();

// Draw using the DrawTexture extension.
float drawWidth = texture.getDrawWidth();
float drawHeight = texture.getDrawHeight();
float ypos = screenHeight - drawHeight - y;

if (angle0)
{
float halfWidth = drawWidth/2;
float halfHeight = drawHeight/2;

surface.glTranslatef(x+halfWidth, ypos+halfHeight, 0);

surface.glRotatef(-angle, 0.0f, 0.0f, 1.0f);

surface.glTranslatef(-halfWidth, -halfHeight, 0);
}
else
{
surface.glTranslatef(x, ypos, 0);
}

texture.getGrid().draw(surface, true, true);

surface.glPopMatrix();

Grid.endDrawing(surface);

surface.glDisable(GL10.GL_TEXTURE_2D);

Al.

On Oct 15, 3:37 pm, Jason jason.poli...@gmail.com wrote:
 You want to call glLoadIdentity before anything else, and remember
 that the commands are on a stack, so are processed in reverse order.

 The glLoadIdentity will reset everything, so your matrix will be at
 0,0.  This means you draw, rotate, then translate; but you push the
 commands to do this onto the stack in reverse order.

 Here's what I do:

 // Load the identity matrix so we always start from 0,0
 gl.glLoadIdentity();

 // push a copy of the matrix on the stack to manipulate
 gl.glPushMatrix();

 // translate to target coordinates.
 gl.glTranslatef(x, y, 0.0f);

 // Scale if needed
 // gl.glScalef(scaleX, scaleY, 1.0f);

 // Rotate (must be in degrees)
 gl.glRotatef((float)Math.toDegrees(angle), 0, 0, 1.0f);

 // push the draw command last
 grid.draw(gl);

 // finally pop the matrix
 gl.glPopMatrix();

 There is NO need to re-translate back anywhere.. and certainly no need
 to perform an additional rotation as suggested.

 On Oct 15, 8:42šam, Kostya Vasilyev kmans...@gmail.com wrote:







  Add another rotate call before the non-working translate, with the inverse
  angle (in your case, the value in 'angle' without the '-').

  This will reverse the rotation so the translate call can undo the
  translation.

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

  15.10.2010 1:30 ÐÏÌØÚÏ×ÁÔÅÌØ Alistair. alistair.rutherf...@gmail.com
  ÎÁÐÉÓÁÌ:

  Alas, that had no effect. I have _something_ sort of working

  š š š š š šsurface.glMatrixMode(GL10.GL_MODELVIEW);

  surface.glEnable(GL10.GL_TEXTURE_2D);

  surface.glBindTexture(GL10.GL_TEXTUR...
  š š š š š šGrid.beginDrawing(surface, true, false);

  š š š š š šsurface.glPushMatrix();

  // Draw using the DrawTexture extension.
  š š š š š šint drawHeight = texture.getDrawHeight();
  š š š š š šint drawWidth = texture.getDrawWidth();
  š š š š š šfloat ypos = screenHeight - drawHeight- y;

  š š š š š šsurface.glLoadIdentity();

  š š š š š šsurface.glTranslatef(x, ypos, 0);

  surface.glRotatef(-angle, 0.0f, 0.0f, 1.0f);
  š š š š š šsurface.glTranslatef(-x, -ypos, 0); // THIS NOT DOING WHAT
  I THOUGHT WOULD

  š š š š š štexture.getGrid().draw(surface, true, false);

  š š š š š šsurface.glPopMatrix();

  š š š š š šGrid.endDrawing(surface);

  surface.glDisable(GL10.GL_TEXTURE_2D);
  What I can't seem to get working now it the re-translate back to the
  original point after the rotation.

  On Oct 12, 6:02 am, Kunal Kant kunalkant2...@gmail.com wrote:

   remove that line  surface.glLoad...
   alistair.rutherf...@gmail.comwrote:

I am trying to rotate a bitmap in OpenGL. I have searched around and
come up w...
android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs
 cr...@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

[android-developers] Re: Rotate bitmap in opengl

2010-10-14 Thread Alistair.
Alas, that had no effect. I have _something_ sort of working


surface.glMatrixMode(GL10.GL_MODELVIEW);

surface.glEnable(GL10.GL_TEXTURE_2D);

surface.glBindTexture(GL10.GL_TEXTURE_2D, ids[index]);

Grid.beginDrawing(surface, true, false);

surface.glPushMatrix();

// Draw using the DrawTexture extension.
int drawHeight = texture.getDrawHeight();
int drawWidth = texture.getDrawWidth();
float ypos = screenHeight - drawHeight- y;

surface.glLoadIdentity();

surface.glTranslatef(x, ypos, 0);

surface.glRotatef(-angle, 0.0f, 0.0f, 1.0f);

surface.glTranslatef(-x, -ypos, 0); // THIS NOT DOING WHAT
I THOUGHT WOULD

texture.getGrid().draw(surface, true, false);

surface.glPopMatrix();

Grid.endDrawing(surface);

surface.glDisable(GL10.GL_TEXTURE_2D);

What I can't seem to get working now it the re-translate back to the
original point after the rotation.

On Oct 12, 6:02 am, Kunal Kant kunalkant2...@gmail.com wrote:
 remove that line  surface.glLoadIdentity();
 i think it will rotate

 On Sun, Oct 10, 2010 at 10:46 PM, Alistair.
 alistair.rutherf...@gmail.comwrote:







  I am trying to rotate a bitmap in OpenGL. I have searched around and
  come up with this

     public void drawTexture(Texture texture, int index, float x, float
  y, float angle)
     {
         int[] ids = texture.getTextureIds();

         if (ids != null)
         {
             surface.glEnable(GL10.GL_TEXTURE_2D);

             surface.glBindTexture(GL10.GL_TEXTURE_2D, ids[index]);

             // Draw using the DrawTexture extension.
             int drawWidth = texture.getDrawWidth();
             int drawHeight = texture.getDrawHeight();

             surface.glPushMatrix();

             surface.glLoadIdentity();

             surface.glRotatef(angle, 0.0f, 0.0f, 1.0f);

             ((GL11Ext) surface).glDrawTexfOES(x, screenHeight -
  drawHeight - y, 0, drawWidth, drawHeight);

             surface.glPopMatrix();

             surface.glDisable(GL10.GL_TEXTURE_2D);

         }
     }

  Drawing the bitmaps indicated with the ids works fine but no
  rotation happens. I am no expert at openGL. Is is possible I need to
  set some sort of mode prior to the rotation?

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

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


[android-developers] Re: Rotate bitmap in opengl

2010-10-13 Thread Alistair.
After a great deal of searching I have discovered that you cannot use
glRotate and glDrawTexfOES. I will have to use the quad grid from the
SpriteMethodTest in apps-for-android.


On Oct 10, 6:16 pm, Alistair. alistair.rutherf...@gmail.com wrote:
 I am trying to rotate a bitmap in OpenGL. I have searched around and
 come up with this

     public void drawTexture(Texture texture, int index, float x, float
 y, float angle)
     {
         int[] ids = texture.getTextureIds();

         if (ids != null)
         {
             surface.glEnable(GL10.GL_TEXTURE_2D);

             surface.glBindTexture(GL10.GL_TEXTURE_2D, ids[index]);

             // Draw using the DrawTexture extension.
             int drawWidth = texture.getDrawWidth();
             int drawHeight = texture.getDrawHeight();

             surface.glPushMatrix();

             surface.glLoadIdentity();

             surface.glRotatef(angle, 0.0f, 0.0f, 1.0f);

             ((GL11Ext) surface).glDrawTexfOES(x, screenHeight -
 drawHeight - y, 0, drawWidth, drawHeight);

             surface.glPopMatrix();

             surface.glDisable(GL10.GL_TEXTURE_2D);

         }
     }

 Drawing the bitmaps indicated with the ids works fine but no
 rotation happens. I am no expert at openGL. Is is possible I need to
 set some sort of mode prior to the rotation?

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


[android-developers] Rotate bitmap in opengl

2010-10-10 Thread Alistair.
I am trying to rotate a bitmap in OpenGL. I have searched around and
come up with this


public void drawTexture(Texture texture, int index, float x, float
y, float angle)
{
int[] ids = texture.getTextureIds();

if (ids != null)
{
surface.glEnable(GL10.GL_TEXTURE_2D);

surface.glBindTexture(GL10.GL_TEXTURE_2D, ids[index]);

// Draw using the DrawTexture extension.
int drawWidth = texture.getDrawWidth();
int drawHeight = texture.getDrawHeight();

surface.glPushMatrix();

surface.glLoadIdentity();

surface.glRotatef(angle, 0.0f, 0.0f, 1.0f);

((GL11Ext) surface).glDrawTexfOES(x, screenHeight -
drawHeight - y, 0, drawWidth, drawHeight);

surface.glPopMatrix();

surface.glDisable(GL10.GL_TEXTURE_2D);

}
}

Drawing the bitmaps indicated with the ids works fine but no
rotation happens. I am no expert at openGL. Is is possible I need to
set some sort of mode prior to the rotation?

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

2010-05-22 Thread Alistair.
I had to update my usb drivers.

http://developer.android.com/sdk/win-usb.html

Al.


On May 22, 8:37 am, Dominik Erbsland derbsl...@gmail.com wrote:
 Hi all

 I have a HTC Hero and newly also a Nexus One. I used to debug with the
 HTC Hero which worked just fine. Now when I try to debug with my Nexus
 One I just can't make it work. I updated everything Android via
 Eclipse and have now the version which officially supports Nexus One
 as a debug device. Whenever I connect the Nexus One, turn on Debug
 Mode and want to run the application I don't see the device in the
 debug list.

 Anyone got any ideas what I might do wrong? As said above, with the
 HTC Hero it works just fine.

 Thanks for help.
 Dominik

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email 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] Noiz2 Android Port Source Code Available

2010-05-15 Thread Alistair.
Since this languishing at the bottom of the Arcade and Action
section in the marketplace I figured I may as well make the source
available. It's maybe not everyone's cup of tea for sure judging from
the somewhat polarised comments on it but I learnt a lot from
converting it from the original applet.

Noiz2 is a vector graphics shoot em up. It was created by Kenta Cho a
well known Japanese game designer. The bullet patterns are defined in
an XML markup language called BulletML. I had to rewrite the parser
for this amongst other stuff. If anyone can make any sense of Kentas
code then this component could be pulled out and might serve a useful
function in shoot-em-ups of the future. I found it completely
impenetrable myself.

The game has touchscreen and rollerball support as well as switchable
renderers between Canvas and OpenGL.

Project is here: http://code.google.com/p/noiz2-droid/

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

2009-09-20 Thread Alistair.

I think I need to get my eyes tested. The documentation states that
the debug.keystore is now stored in

C:\Documents and Settings\\.android\

I was looking in the old (which I think must be pre 1.5) directory. I
could have sworn I went through this page and never saw anything about
expired certificates.

http://developer.android.com/guide/publishing/app-signing.html

Changed the certificate over and now it works.

Al.

On Sep 19, 6:03 pm, Alistair. alistair.rutherf...@googlemail.com
wrote:
 Mydebug.keystorecertificate has expired. Does anyone know how to
 force Android to regenerate either certificate or the whole directory
 under

 C:\Documents and Settings\Admin\Local Settings\Application Data
 \Android

 I have tried deleting the file then recompiling and switching SDK's
 but nothing seems to work!

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



[android-developers] Debug certificate has expired!

2009-09-19 Thread Alistair.

My debug.keystore certificate has expired. Does anyone know how to
force Android to regenerate either certificate or the whole directory
under

C:\Documents and Settings\Admin\Local Settings\Application Data
\Android

I have tried deleting the file then recompiling and switching SDK's
but nothing seems to work!

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



[android-developers] Certificate has expirted

2009-09-19 Thread Alistair.

My debug.keystore certificate has expired. Does anyone know how to
force Android to regenerate either certificate or the whole directory
under

C:\Documents and Settings\Admin\Local Settings\Application Data
\Android

I have tried deleting the file then recompiling and switching SDK's
but nothing seem to work!

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



[android-developers] Re: Game using Canvas porting to OpenGL please help

2009-07-01 Thread Alistair.

Take a look at the sprite drawing code in the apps-for-android code
here

http://code.google.com/p/apps-for-android/

You will see how you go about drawing a bitmap onto the OpenGL
surface. Trying to explain the steps required to re-implement your
sample code in Android might have seemed a bit of a big job hence no
replies.

I have implemented an abstraction for line drawing in my BulletML demo
which lets you switch between Canvas and OpenGL here:

http://code.google.com/p/netthreads-for-android/

This only handles line drawing though. It's not easy to get your head
around this stuff. I spent a lot of time  stumbling around towards a
solution.

Al.

On Jun 30, 10:05 pm, TjerkW tje...@gmail.com wrote:
 Nobody can help me?

 On 18 jun, 14:12, TjerkW tje...@gmail.com wrote:



  Hello All,

  My game runs fairly well on my phone, but i want to increase the
  performance by usingopengl.
  However currently i use the Canvas.
  I am a beginner inopengl.
  I have to port all my drawing code toopengl. However can somebody
  give me directions.
  For example how do i do the following inopengl:

                          c.save();
                          c.scale(0.3f+scale, 0.3f+scale, width/2, height/2);
                          c.drawBitmap(
                                          bMsg.bitmap,
                                  width/2 - bMsg.bitmap.getWidth()/2,
                                  dy+height/2 - bMsg.bitmap.getHeight()/2,
                                  MESSAGE_PAINT
                          );
                          c.restore();

  And why cant i just use Canvas as an abstraction layer (facade) foropengl.
  An implementation of canvas could call the correctopenglmethods in
  order to render.
  Why do i have to port all my code. I thought the canvas was a good
  abstraction interface to a drawing surface,
  why do i have to bother withopengl?

  It looks like this is possible, when is see the following contructor:
  public Canvas (GL gl)
  Also the this seems usefull.
  SURFACE_TYPE_GPU        Surface type: creates a surface suited to be used
  with the GPU

  So what should i do?
  Re implementing the GamePainter completely and callopenglfunctions
  directly?
  Or is there some kind of abstraction mechanism, so that i can useOpenGLwith 
  just a few lines of code?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Live traffic events as icons on a map

2009-06-22 Thread Alistair.

Are you sure you want to update the map in real time? In terms of a
mobile application users are not going to have the application  open
to the map view constantly they will open the app and observe the
current state of the road location they are interested in.

All you really need to do is fetch the latest data when the view is
opened and update the current event list.

Al.

On Jun 21, 12:19 pm, Lex hakkinen1...@gmail.com wrote:
 Hi everyone,

 I am developing a prototype application which features basic
 navigation (updating of own location on the map) and displays live
 traffic events as traffic sign icons on the map. The traffic events
 will be fetched from a server over a UDP connection. (I haven't
 implemented this as I don't have the traffic message specs yet).

 The idea is to display traffic events in real-time and also delete
 them when they have expired. I figured out that what I need for this
 is one or more ItemizedOverlays with dynamic items. I found this post,

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

 which seems to be similar to my application. So the circular process
 is:
 1. fetch traffic data from server
 2. populate an ItemizedOverlay object containing traffic events
 3. update the map accordingy when the items in the overlay have
 changed

 Apparently in the MapView (or Map Activity?) I need some sort of a
 listener for changes in the ItemizedOverlay object. What is the best
 practice for doing this?

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

2009-06-10 Thread Alistair.

I think this might be a bit out of date. I put the phrase android
draw polyline into Google.

http://www.anddev.org/route_-_improved_google_driving_directions-t1892.html

Al.

On Jun 10, 9:57 am, skyman krzysiek.bieli...@gmail.com wrote:
 Anyone?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 driving directions from application

2009-06-10 Thread Alistair.

Perhaps some combination of

http://data.giub.uni-bonn.de/openrouteservice/
http://wiki.openstreetmap.org/index.php/OpenRouteService#ORS_.22API.22

But it's Europe only I'm afraid.

Al.

On Jun 10, 1:21 pm, skyman krzysiek.bieli...@gmail.com wrote:
 In current SDK there is no com.google.googlenav :(
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] OpenGL - glLineWidthx, glLineWidth bug

2009-05-26 Thread Alistair.

Can anyone confirm that the OpenGL methods glLineWidthx, glLineWidth
do not work. That is, setting these to anything about 1 has no effect
when running on the phone.

They appear to work on the emulator okay but not the phone.

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



[android-developers] Re: OpenGL - glLineWidthx, glLineWidth bug

2009-05-26 Thread Alistair.

I have added an issue to the Android Issue Tracker because I didn't
see it already mentioned.

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

Al.

On May 26, 9:19 pm, Streets Of Boston flyingdutc...@gmail.com wrote:
 Looks like the iPhone has the same 
 issue:http://www.khronos.org/message_boards/viewtopic.php?f=4t=1223

 It seems that only a line-width of exactly 1 must be supported,
 anything else is 
 optional.http://www.khronos.org/opengles/documentation/opengles1_0/html/glLine...

 On May 26, 4:58 am, Alistair. alistair.rutherf...@googlemail.com
 wrote:



  Can anyone confirm that the OpenGL methods glLineWidthx, glLineWidth
  do not work. That is, setting these to anything about 1 has no effect
  when running on the phone.

  They appear to work on the emulator okay but not the phone.

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

2009-05-19 Thread Alistair.

That works! Wonderful, thanks. I was doing something dumb right
enough.

Al

On May 18, 10:48 pm, Streets Of Boston flyingdutc...@gmail.com
wrote:
 I think the color values are values between 0 (rgb = 0) and 1 (rgb =
 255).
 And, if i'm reading your code correctly, the 'red', 'green' and 'blue'
 values in your code-example have values between 0 and 255 (in fixed
 format: 0.0, 1.0, 2.0 -- 
 255.0).http://www.khronos.org/opengles/documentation/opengles1_0/html/glColo...

 Try this as your last statement:
 surface.glColor4x(red/255, green/255, blue/255)

 On May 18, 8:53 am, Alistair. alistair.rutherf...@googlemail.com
 wrote:

  Anyone used glColor4x much?

  I am passing colours into a line draw rtn in the usual format '4
  bytes: alpha, red, green, blue.'

  my call to to set the colour attempts to modify the RRGGBB parts into
  fixed format values.

          int red = (color0x00FF);
          int green = (color0xFF00)8;
          int blue = (color0x00FF)16;

          surface.glColor4x(red, green, blue, 0);

  I am getting screwy colours from this. I have searched but there
  aren't many examples of this call kicking around and used in this way.
  I am obviously doing something dumb. Do I have to format the rgb
  values as percentages somehow?

  'surface' is defined as GL10 btw.

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

2009-05-18 Thread Alistair.

Anyone used glColor4x much?

I am passing colours into a line draw rtn in the usual format '4
bytes: alpha, red, green, blue.'

my call to to set the colour attempts to modify the RRGGBB parts into
fixed format values.

int red = (color0x00FF);
int green = (color0xFF00)8;
int blue = (color0x00FF)16;

surface.glColor4x(red, green, blue, 0);

I am getting screwy colours from this. I have searched but there
aren't many examples of this call kicking around and used in this way.
I am obviously doing something dumb. Do I have to format the rgb
values as percentages somehow?

'surface' is defined as GL10 btw.

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

2009-05-10 Thread Alistair.

This page makes a start and should give you some ideas.

http://blog.pocketjourney.com/2008/03/19/tutorial-2-mapview-google-map-hit-testing-for-display-of-popup-windows/

The code for the one the image shows would be very useful but I've yet
to come across a fully featured pop-up yet


On May 10, 10:18 am, Wouter wouterg...@gmail.com wrote:
 Does nodody has an idea how to do this?

 On May 6, 4:35 pm, Wouter wouterg...@gmail.com wrote:

  Hey,

  How can I make such a info bubble like you see at this image

 http://www.lifeaware.net/images/screenshots/locatefriend.png

  I'm looking for it for very long!

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



[android-developers] BulletML : Source Code

2009-05-10 Thread Alistair.

Hi everybody,

I have ported Kenta Chos BulletML demo code to the Android platform
here:

http://code.google.com/p/netthreads-for-android/

From his site

BulletML is the Bullet Markup Language. BulletML can describe the
barrage of bullets in shooting games

I thought a few game designers would be interested. The plan is to use
this in a game application I am working on.

I have ported his game Noiz2 to Android but it's not quite ready yet.

Al.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: SW (2D API) vs. HW (openGL) rendering

2009-04-28 Thread Alistair.

Take a look at SpriteMethodTest here

http://code.google.com/p/apps-for-android/

Al.

On Apr 27, 9:51 pm, mcmc manni...@gmail.com wrote:
 I'm trying to compare the difference in speed between software and
 hardware graphics rendering, but I'm a little confused...

 Can someone please give me a starter?

 I have 2 apps right now - one written with only java/android 2D APIs,
 and one written with openGL calls...

 Thanks a bunch.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Initial database population from large data files, several problems

2009-03-06 Thread Alistair.

Justin,

You might find this article of interest. This is a technique to pre-
populate the database and bundle into the assets directory of your
application.

http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/

Al.

On Mar 5, 7:49 am, Justin Allen Jaynes jus...@ragblue.com wrote:
 I'm building a dictionary application with 135,000 word entries (words
 only).  My raw file must have been too large (1.5 meg), because I got
 this error:

 D/asset (909): Data exceeds UNCOMPRESS_DATA_MAX (1424000 vs 1048576)

 I've searched for this error with very few relevant hits.  It seemed to
 mean I could not open an uncompressed file over a meg.  So I then split
 the file into two smaller files and ran my code on both of them.  It
 worked out fine.  My total application size is 3 meg installed.

 My code is:
 public void onCreate(SQLiteDatabase database) {
     database.execSQL(CREATE TABLE  + DATABASE_TABLE +  (wordid
 INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, word VARCHAR););

     Scanner fileScanner = new
 Scanner(myContext.getResources().openRawResource(R.raw.wordlist));
     while ( fileScanner.hasNextLine() ) {
         String wordFromFile = fileScanner.nextLine();
          database.execSQL(INSERT INTO words (word) VALUES (' +
 wordFromFile + '););
     }
     fileScanner = new
 Scanner(myContext.getResources().openRawResource(R.raw.wordlist2));
     while ( fileScanner.hasNextLine() ) {
         String wordFromFile = fileScanner.nextLine();
          database.execSQL(INSERT INTO words (word) VALUES (' +
 wordFromFile + '););
      }

 }

 However, when the application is first run, it takes several MINUTES to
 initialize the database in this way.  Is there a way (like a copy
 command, as found in, say, postgresql, or a restore of a database file)
 to copy data from a raw file, and can such a method be accessed from the
 SDK so that standard first-run procedures can correctly set up the
 database?  I have been unable to locate such a luxury.  I am seeking to
 speed up this data populating process.

 First question: how can I speed up my database population?

 Second question: is there a way to read a raw resource file larger than
 1 megabyte (aside from making it into two smaller files)?  If not, why?

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



[android-developers] Re: getAssets().open(file.txt)

2009-02-19 Thread Alistair.

Based more or less line for line from EULA.java in apps-for-android
Google Code project.

http://code.google.com/p/apps-for-android/source/browse/trunk/Photostream/src/com/google/android/photostream/Eula.java

public static CharSequence readAsset(String asset, Activity
activity)
{
BufferedReader in = null;

try
{
in = new BufferedReader(new InputStreamReader
(activity.getAssets().open(asset)));

String line;
StringBuilder buffer = new StringBuilder();

while ((line = in.readLine()) != null)
{
buffer.append(line).append('\n');
}

return buffer;
}
catch (IOException e)
{
return ;
}
finally
{
closeStream(in);
}
}

Al.

On Feb 19, 10:31 am, zeeshan genx...@gmail.com wrote:
 i am trying to access a resource file by

 try {
             InputStream is = getAssets().open(read_asset.txt);

            int size = is.available();

             byte[] buffer = new byte[size];
             is.read(buffer);
             is.close();

             // Convert the buffer into a string.
             String text = new String(buffer);

             // Finally stick the string into the text view.
            TextView tv = (TextView)findViewById(R.id.text);
             tv.setText(text);
         } catch (IOException e) {

             // Should never happen!
             throw new RuntimeException(e);
         }

 and it is returning me exception, please help me

 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: Programmatically get resource information

2009-02-14 Thread Alistair.

Something like:

private Bitmap getFromName(String bitmapName)
{
   Bitmap target = null;

try
{
int value = getFieldValue(bitmapName, R.drawable.class);

InputStream is = context.getResources().openRawResource(value);

target = BitmapFactory.decodeStream(is);
}
catch (Throwable e)
{
// couldn't find it
}

return target;
 }


public int getFieldValue(String name, Class obj) throws
NoSuchFieldException, IllegalArgumentException,
IllegalAccessException
{
Field field = obj.getDeclaredField(name);

int value = field.getInt(obj);

return value;
}


On Feb 14, 4:34 pm, stanchat stanc...@tccons.com wrote:
 I have a SQLite database and one of the tables has a column that is
 the string name of a jpeg file..

 For instance the column is called PhotoID and a record value is say
 photoone.jpg
 I have strored all the actual jpegs in the drawable resouce directory.

 I would like to be able to programmatically access the resources with
 having to prep or setup the link.  I have about 100 photos but do want
 to setup a link to the actual resource id.

 For instance the R class has the following setting
 ==

  public static final int david_beckham=0x7f020011;

 I have created a record in my DB as follows;

 INSERT INTO Celebrity_Trump_Raw_Data (Rank, CelebrityName, PayMil,
 WebRank, PressRank, TVRank, PhotoId) VALUES ('5',  '  David Beckham',
 50, '10', '3', '18', 'David_Beckham.jpg');,

 I would like to do something like this:

 int curr_pic_res = R.drawable.(String.tolower(Celeb.PhotoID));

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



[android-developers] Geocoder county code started to return NULL

2009-02-09 Thread Alistair.

I am using the Geocoder call 'getFromLocationName' to return an
Address object given some location text.

On one application I examine the country code value of the Address
object. I have noticed that at some point over the weekend the
Geocoder started returning NULL for this field where it had usually
been populated for valid searches before.

Anyone else who uses this service from the SDK seen this?

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

2009-02-04 Thread Alistair.

I think the answer is no.

You will find a Base64 encoder/decoder here:

http://www.source-code.biz/snippets/java/2.htm

It seems that it has been used with some success already.

http://groups.google.com/group/android-developers/browse_thread/thread/1b434be82afd2661/da653497508b22a3

Al.

On Feb 3, 10:25 pm, hapciu horia...@gmail.com wrote:
 Is there a base64 encoding/decoding utility anywhere in the Android
 SDK ?
 I wouldn't want to reinvent the wheel.

 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: Fwd: GMAPS is not being displayed in the emulator

2009-02-03 Thread Alistair.

This really looks to me like your debug map key is incorrect.

Refer to

http://code.google.com/android/toolbox/apis/mapkey.html

There are a couple of batch files, definition.bat and getDebugKey.bat
which might help here:

http://code.google.com/p/netthreads-for-android/source/browse/#svn/trunk/place-finder/build

The keytool.exe is found in your jdk bin directory.

Failing that. Have you tried explicitly uninstalling your app and then
running it again (which will install it once more). I noticed that any
change I made to the key didn't seem to get picked up until I had
wiped it from the emulator first.

Al.

On Feb 3, 3:58 am, swapna annamaneni swapna.annaman...@gmail.com
wrote:
 hi,
 i am also facing sme problem ,if get it plz let me know
 @      swapna.annaman...@gmail.com

 On Fri, Jan 16, 2009 at 12:19 PM, sheik sheik...@gmail.com wrote:

  Kindly look at this queryand help me regarding the issue..

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



[android-developers] Re: Force close (exception) during rotation

2009-01-30 Thread Alistair.

This might help.

http://groups.google.com/group/android-developers/browse_thread/thread/db839840e8f20dc1/ed7737e3e3587881

Al.

On Jan 29, 3:16 am, Sean E. Russell seaneruss...@gmail.com wrote:
 I have a strange problem where, if the screen is rotated while a
 dialog is displayed, an exception gets thrown every time.  It happens
 _only_ during this single dialog, and the exception is thrown outside
 of the app (there's no trace information that touches any of my
 code).  It happens in both the emulator and the G1.

 I'm wondering if anybody has any suggestions about how I might analyze
 this problem, or what might be the cause.  The stack trace, for what
 it is worth, follows.  Is this something I can work around, or is it
 an Android bug?

 Thanks!

 E/AndroidRuntime(  353): Uncaught handler: thread main exiting due to
 uncaught exception
 E/AndroidRuntime(  353): java.lang.RuntimeException: Unable to start
 activity ComponentInfo{net.ser1.timetracker/
 net.ser1.timetracker.Tasks}: java.lang.NullPointerException
 E/AndroidRuntime(  353):        at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
 2140)
 E/AndroidRuntime(  353):        at
 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
 2156)
 E/AndroidRuntime(  353):        at
 android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:
 3086)
 E/AndroidRuntime(  353):        at android.app.ActivityThread.access
 $1900(ActivityThread.java:112)
 E/AndroidRuntime(  353):        at android.app.ActivityThread
 $H.handleMessage(ActivityThread.java:1584)
 E/AndroidRuntime(  353):        at android.os.Handler.dispatchMessage
 (Handler.java:88)
 E/AndroidRuntime(  353):        at android.os.Looper.loop(Looper.java:
 123)
 E/AndroidRuntime(  353):        at android.app.ActivityThread.main
 (ActivityThread.java:3742)
 E/AndroidRuntime(  353):        at
 java.lang.reflect.Method.invokeNative(Native Method)
 E/AndroidRuntime(  353):        at java.lang.reflect.Method.invoke
 (Method.java:515)
 E/AndroidRuntime(  353):        at com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:739)
 E/AndroidRuntime(  353):        at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
 E/AndroidRuntime(  353):        at dalvik.system.NativeStart.main
 (Native Method)
 E/AndroidRuntime(  353): Caused by: java.lang.NullPointerException
 E/AndroidRuntime(  353):        at
 android.app.Activity.restoreManagedDialogs(Activity.java:850)
 E/AndroidRuntime(  353):        at
 android.app.Activity.performRestoreInstanceState(Activity.java:793)
 E/AndroidRuntime(  353):        at
 android.app.Instrumentation.callActivityOnRestoreInstanceState
 (Instrumentation.java:1171)
 E/AndroidRuntime(  353):        at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
 2117)
 E/AndroidRuntime(  353):        ... 12 more

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

2009-01-26 Thread Alistair.

I too am looking for a sample EULA. I found this.

http://www.developer-resource.com/sample-eula.htm

Al.

On Dec 5 2008, 6:14 am, lior liorza...@comcast.net wrote:
 Thanks, I actually meant an agreement example as most examples out
 them deal with companies (not single developers)

 On Dec 4, 9:54 pm, Xavier Mathews xavieruni...@gmail.com wrote:

  Text File Html File pdf File pdf is the best by html. But not all
  devices can have a pdf reader. So I would go with HTML For the end
  user license agreement!

  On 12/04/2008, lior liorza...@comcast.net wrote:

   Hi folks,
   My friend and I are about to launch are first app on the Market. We
   are don't have an incorporated company formed (yet) and we would like
   to protect us with anEULA. Can someone share anEULAformat that
   would work for us.

   Any other advice on the topic ofEULAwill be great.

   Thanks in advance,
   Lior

  --
  Xavier A. Mathews
  Student/Browser Specialist/Developer/Web-Master
  Google Group Client Based Tech Support Specialist
  Hazel Crest Illinois
  xavieruni...@gmail.com¥xavieruni...@hotmail.com¥truestar...@yahoo.com
  Fear of a name, only increases fear of the thing itself.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Unable to reconstruct bitmap from ksop2 response

2009-01-13 Thread Alistair.

I am not that familiar with using SOAP but I have passed images using
Strings in the past.

Can I suggest you encode your image using Base64 and then decode it on
the Android side. You can use something like this:

http://www.source-code.biz/snippets/java/2.htm

Al.

On Jan 13, 11:17 am, sooraj.rit sooraj@gmail.com wrote:
 Hi , I am trying to download a bitmap from a web service ( created
 in .Net ). My web service consists of a method GetImage , and the
 server machine is returning the image stored in it as String which is
 converted from Byte[].but when i try to reconstruct a bitmap from the
 so obtained byte, it is a null bitmap.I have
 attached the source code. any sort of help is greatly appreciated.

 public class HelloWeb extends Activity {

         private static final String SOAP_ACTION = http://webservice.org/
 GetImage;
         private static final String METHOD_NAME = GetImage;
         private static final String NAMESPACE = http://webservice.org/;;
         private static final String URL = http://10.1.26.21/Webservice/
 Service1.asmx;
         private Object resultRequestSOAP = null;

         /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState)
     {
         super.onCreate(savedInstanceState);
         //TextView tv = new TextView(this);
         ImageView tv = new ImageView(this);
         setContentView(tv);

         SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
         SoapSerializationEnvelope envelope = new
 SoapSerializationEnvelope
 (SoapEnvelope.VER11);
         envelope.dotNet = true;
         envelope.setOutputSoapObject( request );
         HttpTransportSE transport = new HttpTransportSE(URL);
         try
         {
             transport.call(SOAP_ACTION, envelope);
             resultRequestSOAP =  envelope.getResponse();

             String results = resultRequestSOAP.toString();
             byte[] bresult = results.getBytes();                  //
 everything is fine upto this point

             Bitmap bitmap ;
             bitmap = BitmapFactory.decodeByteArray(bresult , 0,
 bresult.length);                                                              
  //here I get a null
 bitmap

             ImageView img = (ImageView) findViewById
 (R.id.ImageView01);
             img.setImageBitmap(bitmap);

         }
         catch (Exception aE)
         {
          aE.printStackTrace ();
         }
     }

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

2009-01-12 Thread Alistair.

I have been playing around with the Geocoder. Take a look at this.

http://ccgi.arutherford.plus.com/blog/wordpress/?p=261

Al.

Faber Fedor wrote:
 Never mind. I found the Geocoder class!

 Now to figure out how it works...

 On Sun, Jan 11, 2009 at 7:58 PM, Faber Fedor faberfe...@gmail.com wrote:

  I've got maps running in my emulator (Yay!).  My next step is to take an
  address entered by the user and map it.  How?
 
  I thought I could do something like I do on the web and directly ask Google
  which would then return the latlong for the address, but I don't see
  anything in the API that would let me do that.
 
  --
 
  Faber Fedor
  Cloud Computing New Jersey
  http://cloudcomputingnj.com
 



 --

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



[android-developers] Re: Receive notification for onDestroy, onStop, and onPause etc in other applications?

2009-01-02 Thread Alistair.

Maybe your best best is to have a root around the Activity source code

http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/app/Activity.java;h=eafb0488490fd144fa6fac15cbd303dfd93eb894;hb=HEAD

Having said that the base activity doesn't seem to be signalling these
methods in any way so I think your plain out of luck.

Al.

On Jan 2, 4:26 pm, focuser linto...@gmail.com wrote:
 anyone please?

 On Jan 1, 10:26 am, focuser linto...@gmail.com wrote:

  Just to clarify: by this I meant to receive notification when
  onDestroy, onStop etc in other applications are called, i.e. somehow
  monitor the life cycle of apps running on the phone.

  On Dec 31 2008, 5:01 pm, focuser linto...@gmail.com wrote:

   Hi,

   Is there a way to programmatically receive notification onDestroy,
   onStop, and onPause etc in other applications on the phone?

   I see there's a READ_LOGS permission and guess this might be achieved
   by reading the system log.  But I couldn't find anything to access the
   system logs.

   Thanks and Happy New Year!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: getFromLocationName() broken?

2008-12-30 Thread Alistair.

Maybe this has been fixed in the latest sdk as I have been using it
and it seems to work for me.

http://code.google.com/p/netthreads-for-android/source/browse/trunk/place-finder/src/com/netthreads/android/command/GeoCodeCommand.java

Al.

On Dec 30, 6:06 pm, DMT droiddevelo...@gmail.com wrote:
 Hi All: anyone know if the Geocoder.getFromLocationName() method is
 currently working?
 Has anybody been able to get it to work?
 If not, when will it be fixed (in what android release)?
 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: Greasemonkey on steroids and grouping installed apps

2008-12-15 Thread Alistair.

Fantastic stuff, Jeff.

Thanks.

On Dec 15, 8:01 am, Jeffrey Sharkey jeffrey.shar...@gmail.com wrote:
 Hey, just wanted to drop a quick line about two Android projects that
 I just open-sourced.

 One is Greasemonkey on steroids, which lets websites reach into the
 Android intent world.  There's a video demo showinghttp://m.half.com
 with a Scan Barcode button added, and linking Wikipedia articles to
 Maps and Radar apps.

 http://www.jsharkey.org/blog/2008/12/15/oilcan-greasemonkey-on-steroi...

 The second is an app that groups all your installed apps using the
 categories shown in Android Market, making it much easier to find
 apps.  (My all-apps drawer on the homescreen was getting pretty
 crowded.)  Oh, and it offers long-press uninstall for any apps.  (This
 app is still a little rough around the edges.)

 http://www.jsharkey.org/blog/2008/12/15/grouphome-organize-your-andro...

 It also offers an example hack of showing app icons in a GridView
 style, but inside of a ExpandableListView, which isn't really possible
 out-of-the-box.  It does this by wrapping each row of icons into a
 horizontal LinearLayout, which it can then recycle correctly.  In
 particular, it needed this one-line gem:

 getExpandableListView().setItemsCanFocus(true);

 There are links on those blog posts to the full source code of both
 apps on Google Code, along with APKs ready to install and play
 with.  :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Anyone willing to share...

2008-12-15 Thread Alistair.

I had a sort of similar problem.

This has been discussed here:

http://groups.google.com/group/android-developers/browse_thread/thread/75dc91441a151039/557f1cb99c8f4f8d?lnk=gstq=java.lang.IllegalArgumentException+screen+orientation+#557f1cb99c8f4f8d



On Dec 15, 4:44 pm, Al Sutton a...@funkyandroid.com wrote:
 A code snippet which prevents an java.lang.IllegalArgumentException:
 View not attached to window manager being thrown when .dismiss() is
 called on  a progress dialogue box which is on screen when the device
 changes orientation.

 Thanks,

 Al.

 --
 ==
 Funky Android Limited is registered in England  Wales with the
 company number  6741909. The registered head office is Kemp House,
 152-160 City Road, London,  EC1V 2NX, UK.

 The views expressed in this email are those of the author and not
 necessarily those of Funky Android Limited, it's associates, or it's
 subsidiaries.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Problem with the onUpdate method of an SQLiteOpenHelper

2008-10-30 Thread Alistair.

Okay I fixed it. Not sure if the solution will apply to you.

In my 'onUpgrade' function the table name value was incorrect.

Basically it looks like you are not dropping the table you
subsequently then attempt to recreate. Check your defns.

Al.


On Oct 29, 8:16 pm, Frew [EMAIL PROTECTED] wrote:
 So I presume that no one else has seen this error?

 -fREW

 On Oct 27, 8:30 pm, Frew [EMAIL PROTECTED] wrote:

  Ok, so everything that I've been doing with my db has been fine until
  I changed it.  I made sure that the onUpgrade was right and I get
  errors nonetheless.  Here is my method:

          @Override
          public void onUpgrade(SQLiteDatabase db, int oldVersion, int
  newVersion) {
                  db.execSQL(DROP TABLE IF EXISTS  + TABLE_NAME);
                  db.execSQL(DROP TABLE IF EXISTS  + FIRST_RUN_TABLE);
                  onCreate(db);
          }

  and here is the error:

  android.database.sqlite.SQLiteException: Can't upgrade read-only
  database from version 1 to 2

  I can't seem to find my error.  Can you tell what I am doing wrong
  here?

  Thanks!
  -fREW

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



[android-developers] Re: Problem with the onUpdate method of an SQLiteOpenHelper

2008-10-30 Thread Alistair.

I am getting it as well. If I find out what the problem is I will post
it up.

Al.

On Oct 29, 8:16 pm, Frew [EMAIL PROTECTED] wrote:
 So I presume that no one else has seen this error?

 -fREW

 On Oct 27, 8:30 pm, Frew [EMAIL PROTECTED] wrote:

  Ok, so everything that I've been doing with my db has been fine until
  I changed it.  I made sure that the onUpgrade was right and I get
  errors nonetheless.  Here is my method:

          @Override
          public void onUpgrade(SQLiteDatabase db, int oldVersion, int
  newVersion) {
                  db.execSQL(DROP TABLE IF EXISTS  + TABLE_NAME);
                  db.execSQL(DROP TABLE IF EXISTS  + FIRST_RUN_TABLE);
                  onCreate(db);
          }

  and here is the error:

  android.database.sqlite.SQLiteException:Can'tupgraderead-only
 databasefrom version 1 to 2

  Ican'tseem to find my error.  Can you tell what I am doing wrong
  here?

  Thanks!
  -fREW

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



[android-developers] Re: my post is not appearing

2008-10-30 Thread Alistair.

This seems to be a common theme with this forum.

I have posted stuff which hasn't appeared until days later.

Al.

On Oct 30, 9:43 pm, Ernest Freund [EMAIL PROTECTED] wrote:
 Hi, my recent post to the Android 'Developer' group is not appearing.  I 
 posted it about 45 minutes ago.  my login is:

 [EMAIL PROTECTED]

 Please help.  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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: HOWTO: SimpleCursorAdapter with custom row display

2008-07-18 Thread Alistair.

After digging a bit further into this group and reading the
documentation some more I think I have even simpler mechanism than
that above.

1) Include the column(s) you want to convert into icons in the adapter
assignment. In this case the last column 'type' is a string which like
0, 1...etc.

TrafficDataAdapter trafficAdapter = new
TrafficDataAdapter(this,
 
R.layout.situation_row,
 mCursor,
 PROJECTION,
 new int[] { 
R.id.title,
R.id.description, R.id.type});

2) My sub-classed adapter is now:

public class TrafficDataAdapter extends SimpleCursorAdapter
{

public TrafficDataAdapter(Context context, int layout, Cursor
c,String[] from, int[] to)
{
super(context, layout, c, from, to);

setViewBinder(new TrafficDataViewBinder());
}

}


Note the call to setViewBinder.

3) The TrafficDataViewBinder class implements a setViewValue call
which according to the documentation:

This class can be used by external clients of SimpleCursorAdapter to
bind values fom the Cursor to views. You should use this class to bind
values from the Cursor to views that are not directly supported by
SimpleCursorAdapter or to change the way binding occurs for views
supported by SimpleCursorAdapter.

If I have understood this correctly the textviews will get handled
automatically. The imageview will trigger a call to the setViewValue
method in the binder where we can test for the column in question and
set an image based on the field value. i.e.

public class TrafficDataViewBinder implements
SimpleCursorAdapter.ViewBinder
{
@Override
public boolean setViewValue(View view, Cursor cursor, int
columnIndex)
{

  int nImageIndex = cursor.getColumnIndex(TrafficData.Strings.TYPE);
  if(nImageIndex==columnIndex)
  {
  ImageView typeControl = (ImageView)view;
  int type =
Integer.parseInt(cursor.getString(nImageIndex));
 
typeControl.setImageResource(TrafficData.getTypeResource(type));
  return true;
  }

  return false;
}

}

Al.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] HOWTO: SimpleCursorAdapter with custom row display

2008-07-12 Thread Alistair.

I have been playing around with Android for a couple of weeks and am
finally getting somewhere with a small application I have written
which downloads Yahoo traffic data according to the current GPS
position and a set radius.  In the process of this I have created a
content provider which holds the current traffic data. This was based
mostly on the Notepad example in the SDK.  The main activity is
subclassed from ListActivity and the row layout is:

?xml version=1.0 encoding=utf-8?
LinearLayout
 xmlns:android=http://schemas.android.com/apk/res/android;
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:orientation=horizontal

 TextView android:id=@+id/title
 android:textSize=16px
 android:textStyle=bold
 android:layout_width=140px
 android:layout_height=wrap_content/

 TextView android:id=@+id/description
 android:textSize=12px
 android:textStyle=italic
 android:layout_width=200px
 android:layout_height=wrap_content/
ImageView
android:id=@+id/type
android:layout_width=wrap_content
android:layout_height=wrap_content/
/LinearLayout

What I wanted was to be able to use managedQuery and point it at my
custom adapter which would handle populating the title, description
and ICON columns according to the values in the content provider.

The example here has a good explanation of the custom adapter but uses
a List to provide the row objects before mapping the type to a weather
icon.

http://mylifewithandroid.blogspot.com/2008/04/custom-widget-adapters.html

I wanted to subclass SimpleCursorAdapter which would let me use a
managedQuery to handle all the list stuff. I haven't seen this
anywhere else (I apologise if this seems blindingly obvious). The
secret to making a custom view for the list row is to override the
getView method and use the current Cursor to access the data
fields for the row. Here is my class:

public class TrafficDataAdapter extends SimpleCursorAdapter
{
private Context context;
private int layout;

public TrafficDataAdapter(Context context, int layout, Cursor
c,String[] from, int[] to)
{
super(context, layout, c, from, to);

this.context = context;
this.layout = layout;
}

/**
 * Custom view translates columns into appropriate text, images
etc.
 *
 * (non-Javadoc)
 * @see android.widget.CursorAdapter#getView(int,
android.view.View, android.view.ViewGroup)
 */
public View getView(int position, View convertView, ViewGroup
parent)
{
// Cursor to current item
Cursor cursor = getCursor();

ViewInflate inflate = ViewInflate.from(context);
View v = inflate.inflate(layout, parent, false, null);

TextView titleControl = (TextView) v.findViewById(R.id.title);
if (titleControl != null)
{
int index = cursor.getColumnIndex(TrafficData.Strings.TITLE);
String title = cursor.getString(index);
titleControl.setText(title);
}

TextView descriptionControl = (TextView)
v.findViewById(R.id.description);
if (descriptionControl != null)
{
int index =
cursor.getColumnIndex(TrafficData.Strings.DESCRIPTION);
String description = cursor.getString(index);
descriptionControl.setText(description);
}

ImageView typeControl = (ImageView) v.findViewById(R.id.type);
if (typeControl != null)
{
int index = cursor.getColumnIndex(TrafficData.Strings.TYPE);
int type = cursor.getInt(index);
 
typeControl.setImageResource(TrafficData.getTypeResource(type));
}

return v;
}
}


The helper method TrafficData.getTypeResource(type) takes the type
value and returns an image resource which is an icon to denote the
traffic event type (accident, roadworks etc).

public static int getTypeResource(int type)
{
switch (type)
{
case ACCIDENT:
return R.drawable.accident_panel_slight;
case RESTRICTION:
return R.drawable.restriction_panel_medium;
case ROADWORK:
return R.drawable.roadwork_panel_severe;
case TRANSPORT:
return R.drawable.transport_pane_medium;
case VISIBILITY:
return R.drawable.visibility_panel_slight;
case WEATHER:
return R.drawable.weather_sunny;
}

return android.R.drawable.unknown_image;
}

The call to set the adapter from the list activity is:

mCursor = managedQuery(getIntent().getData(), PROJECTION,
null, null);

TrafficDataAdapter trafficAdapter = new
TrafficDataAdapter(this,
 
R.layout.situation_row,