[android-developers] Problems simulating multi-touch on emulator

2013-01-06 Thread SChaser
I'm trying to simulate multi-touch on the emulator, but am unable to set 
the hardware option on the AVD manager to multi-touch. Instructions which 
seem to be out of date imply that this can be done in eclipse when setting 
up (or editing) an AVD. I have the latest version of the SDK and ADT 
plug-in, and no such option exists. Other comments suggest setting the 
option in the AVD's config.ini, but nowhere have I seen what the option 
format is - it will be hw.=true, but what is the 

Any help?

ADT:   Android Development Tools21.0.0.v201210310015-519525
com.android.ide.eclipse.adt.feature.group
SDK:

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

2013-01-06 Thread SChaser
I'm trying to simulate multi-touch on the emulator, but am unable to set 
the hardware option on the AVD manager to multi-touch. 

Instructions which seem to be out of date imply that this can be done in 
eclipse when setting up (or editing) an AVD. I have the latest version of 
the SDK and ADT plug-in, and no such option exists.

Other comments suggest setting the option in the AVD's config.ini, but 
nowhere have I seen what the option format is - it will be hw.=true, 
but what is the format of 

Thanks

ADT:   Android Development Tools21.0.0.v201210310015-519525
com.android.ide.eclipse.adt.
feature.group
SDK Tools:21.0.1
Android SDK Platform Tools: 16.0.1

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

2012-07-28 Thread SChaser
Thanks to you and Nikolay for the help - I had missed the how to although 
I pieced it together from stackoverflow. I had tried that before posting, 
unfortunately.  I'll take my future discussion to the ndk group so spooky 
won't embarrass himself further.

On Friday, July 27, 2012 5:33:00 PM UTC-7, goodG wrote:

 Start from here 
 http://developer.android.com/sdk/installing/installing-adt.html

 Using the URL provided in the Eclipse package manager you will see 2 
 options, 1 about generic development with Android, the second one about 
 Native development ( aka using the NDK )

 Install both of this 2 options, or make sure that you have correctly 
 installed this 2 plugins.

 The last thing to do is to set the path for your NDK in the settings menu:

 Window  Preferences  Android  NDK

 Now you have the NDK integrated with your Eclipse IDE. For each project 
 you have to manually enabled the native support, do it this way:

 right click on your project in the tree folder view  Android Tools  Add 
 native support

 now if you right click again on your project you will get the options that 
 you need to deal with C/C++ code under Android and the NDK build process.

 Il giorno sabato 28 luglio 2012 01:59:13 UTC+2, SChaser ha scritto:

 Does anyone know where to find instructions for using Eclipse for 
 generation of code and debugging the native part of a mixed Java/C project?

 I didn't see it in the r8b docs, which appear to be totally command line 
 oriented.

 Googling so far hasn't turned up anything that works for me (Windows, 
 Cygwin, Indigo).

 I have an existing app but have never been able to do breakpoint 
 debugging in the C part of the code (and yes, I need C for very high 
 performance for a little part of the app). I guess I could use gdb (if I 
 can get it to work, but would prefer to use eclipse).

 Is there a reason why this isn't documented? Is it not really ready for 
 use? Or am I just not finding the documents/

 Thanks in advance




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

[android-developers] Using eclipse with the NDK?

2012-07-27 Thread SChaser
Does anyone know where to find instructions for using Eclipse for 
generation of code and debugging the native part of a mixed Java/C project?

I didn't see it in the r8b docs, which appear to be totally command line 
oriented.

Googling so far hasn't turned up anything that works for me (Windows, 
Cygwin, Indigo).

I have an existing app but have never been able to do breakpoint debugging 
in the C part of the code (and yes, I need C for very high performance for 
a little part of the app). I guess I could use gdb (if I can get it to 
work, but would prefer to use eclipse).

Is there a reason why this isn't documented? Is it not really ready for 
use? Or am I just not finding the documents/

Thanks in advance


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

[android-developers] Re: OEM-Official ADB USB Driver support (rant)

2012-07-25 Thread SChaser
Same problem. I got the Nexus 7 to test my app on it. 

I'm running Windows 7 (64 bit).

The devices shows up in Windows device manager, but with no driver. So I 
told Windows 7 to update the driver and pointed it at the 
\extras\google\usb_driver\i386 directory.

Nothing found.

Other than getting an Apple or firing up Linux, is there a way to get this 
silly thing to work?

Google/Android... HELP!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: OEM-Official ADB USB Driver support (rant)

2012-07-25 Thread SChaser
Success... no sooner did I post that then I realized Windows could search 
all the subfolders, so I pointed it at the sdk main folder, checked the 
subfolders box, and it found a driver (somwhere in there) and installed it.

And... ADB is working.

Voila

On Wednesday, July 25, 2012 10:03:43 PM UTC-7, SChaser wrote:

 Same problem. I got the Nexus 7 to test my app on it. 

 I'm running Windows 7 (64 bit).

 The devices shows up in Windows device manager, but with no driver. So I 
 told Windows 7 to update the driver and pointed it at the 
 \extras\google\usb_driver\i386 directory.

 Nothing found.

 Other than getting an Apple or firing up Linux, is there a way to get this 
 silly thing to work?

 Google/Android... HELP!


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Eclipse dev/debug on different machine than where Android device is connected?

2012-06-09 Thread SChaser
Thanks for that link. However, the non-rooted version is not working
for me. Any clues?

Here is what I get on the Windows XP machine the device (Droid-X) is
plugged into:

14:46 /home/John:adb tcpip 
restarting in TCP mode port: 
14:46 /home/John:adb devices
List of devices attached
015EEAA012012345device
14:46 /home/John:adb devices
List of devices attached
015EEAA012012345device
14:47 /home/John:adb connect 192.168.0.5:
unable to connect to 192.168.0.5::
14:47 /home/John:adb shell
$

The fact that it cannot connect via TCP but can still give me the
shell is baffling. It would appear that adbd is not switching to
TCPIP.

On Jun 8, 11:06 am, JJ senat...@gmail.com wrote:
 This should help

 http://stackoverflow.com/questions/2604727/how-can-i-connect-to-andro...







 On Thursday, June 7, 2012 10:01:31 PM UTC-4, SChaser wrote:

  Good.

  But how do I do that? From Eclipse?

  My normal Eclipse debugging method is simple:

  1)Set a breakpoint or two

  2) Debug As-Android Application

  2a)... magic happens Eclipse arranges for the app to be installed
  and run with its debugger attached

  3) Voila. I'm there.

  How to I set up Eclipse to do this via TCP/IP?

  Thanks!

  On Jun 7, 5:52 pm, lbendlin l...@bendlin.us wrote:
   you can do debugging via TCP/IP, no need for a USB connection.

   On Thursday, June 7, 2012 4:23:28 PM UTC-4, SChaser wrote:

I would like to be able to debug (using Eclipse) an Android app when
the device is USB connected to a different machine.

Is this possible, and if so, how?

Reason:
  I'd like to have a single machine that contains my Android
development environment, but be able to access it (via Remote Desktop
for windows) from remote machines which would have the Android device
plugged in.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Eclipse dev/debug on different machine than where Android device is connected?

2012-06-09 Thread SChaser
Thanks for that link. However, the non-rooted version is not working
for me. Any clues?

Here is what I get on the Windows XP machine the device (Droid-X) is
plugged into:

14:46 /home/John:adb tcpip 
restarting in TCP mode port: 
14:46 /home/John:adb devices
List of devices attached
015EEAA012012345device
14:46 /home/John:adb devices
List of devices attached
015EEAA012012345device
14:47 /home/John:adb connect 192.168.0.5:
unable to connect to 192.168.0.5::
14:47 /home/John:adb shell
$

The fact that it cannot connect via TCP but can still give me the
shell is baffling. It would appear that adbd is not switching to
TCPIP.


On Jun 8, 11:06 am, JJ senat...@gmail.com wrote:
 This should help

 http://stackoverflow.com/questions/2604727/how-can-i-connect-to-andro...







 On Thursday, June 7, 2012 10:01:31 PM UTC-4, SChaser wrote:

  Good.

  But how do I do that? From Eclipse?

  My normal Eclipse debugging method is simple:

  1)Set a breakpoint or two

  2) Debug As-Android Application

  2a)... magic happens Eclipse arranges for the app to be installed
  and run with its debugger attached

  3) Voila. I'm there.

  How to I set up Eclipse to do this via TCP/IP?

  Thanks!

  On Jun 7, 5:52 pm, lbendlin l...@bendlin.us wrote:
   you can do debugging via TCP/IP, no need for a USB connection.

   On Thursday, June 7, 2012 4:23:28 PM UTC-4, SChaser wrote:

I would like to be able to debug (using Eclipse) an Android app when
the device is USB connected to a different machine.

Is this possible, and if so, how?

Reason:
  I'd like to have a single machine that contains my Android
development environment, but be able to access it (via Remote Desktop
for windows) from remote machines which would have the Android device
plugged in.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Eclipse dev/debug on different machine than where Android device is connected?

2012-06-09 Thread SChaser
Another clue: The procedure works with everything the same except
using a Xoom rather than a Droid-X!

Anyone have an idea why my Droid-X is being piggy?

Droid-X info: System 4.5.621.MB810 Verizon
Android 2.3.4
Kernel 2.6.32.9-g1282440
Build 4.5.1_57_DX8-5.1

On Jun 9, 2:56 pm, SChaser crotalistig...@gmail.com wrote:
 Thanks for that link. However, the non-rooted version is not working
 for me. Any clues?

 Here is what I get on the Windows XP machine the device (Droid-X) is
 plugged into:

 14:46 /home/John:adb tcpip 
 restarting in TCP mode port: 
 14:46 /home/John:adb devices
 List of devices attached
 015EEAA012012345        device
 14:46 /home/John:adb devices
 List of devices attached
 015EEAA012012345        device
 14:47 /home/John:adb connect 192.168.0.5:
 unable to connect to 192.168.0.5::
 14:47 /home/John:adb shell
 $

 The fact that it cannot connect via TCP but can still give me the
 shell is baffling. It would appear that adbd is not switching to
 TCPIP.

 On Jun 8, 11:06 am, JJ senat...@gmail.com wrote:







  This should help

 http://stackoverflow.com/questions/2604727/how-can-i-connect-to-andro...

  On Thursday, June 7, 2012 10:01:31 PM UTC-4, SChaser wrote:

   Good.

   But how do I do that? From Eclipse?

   My normal Eclipse debugging method is simple:

   1)Set a breakpoint or two

   2) Debug As-Android Application

   2a)... magic happens Eclipse arranges for the app to be installed
   and run with its debugger attached

   3) Voila. I'm there.

   How to I set up Eclipse to do this via TCP/IP?

   Thanks!

   On Jun 7, 5:52 pm, lbendlin l...@bendlin.us wrote:
you can do debugging via TCP/IP, no need for a USB connection.

On Thursday, June 7, 2012 4:23:28 PM UTC-4, SChaser wrote:

 I would like to be able to debug (using Eclipse) an Android app when
 the device is USB connected to a different machine.

 Is this possible, and if so, how?

 Reason:
   I'd like to have a single machine that contains my Android
 development environment, but be able to access it (via Remote Desktop
 for windows) from remote machines which would have the Android device
 plugged in.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Eclipse dev/debug on different machine than where Android device is connected?

2012-06-07 Thread SChaser
I would like to be able to debug (using Eclipse) an Android app when
the device is USB connected to a different machine.

Is this possible, and if so, how?

Reason:
  I'd like to have a single machine that contains my Android
development environment, but be able to access it (via Remote Desktop
for windows) from remote machines which would have the Android device
plugged in.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Eclipse dev/debug on different machine than where Android device is connected?

2012-06-07 Thread SChaser
Good.

But how do I do that? From Eclipse?

My normal Eclipse debugging method is simple:

1)Set a breakpoint or two

2) Debug As-Android Application

2a)... magic happens Eclipse arranges for the app to be installed
and run with its debugger attached

3) Voila. I'm there.

How to I set up Eclipse to do this via TCP/IP?

Thanks!

On Jun 7, 5:52 pm, lbendlin l...@bendlin.us wrote:
 you can do debugging via TCP/IP, no need for a USB connection.







 On Thursday, June 7, 2012 4:23:28 PM UTC-4, SChaser wrote:

  I would like to be able to debug (using Eclipse) an Android app when
  the device is USB connected to a different machine.

  Is this possible, and if so, how?

  Reason:
    I'd like to have a single machine that contains my Android
  development environment, but be able to access it (via Remote Desktop
  for windows) from remote machines which would have the Android device
  plugged in.

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


[android-developers] Re: License validation fails with ATT hotspot

2011-08-18 Thread SChaser
That's probably what it was. I'll have to use WireShark and see what it's up 
to.

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

2011-08-13 Thread SChaser
A customer reports (and I verified) that when the internet connectivity is 
provided by an ATT iPhone hotspot, the license validation fails (not 
licensed).

The same device through a residential DSL hotspot has not problems.

Any idea what's going on?

Workarounds?


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: eclipse HELIOS (3.6) Code Assist very slow

2010-10-16 Thread SChaser
If you are using the JEE edition of HELIOS, the assists can be speeded
up by turning off JAX-WS assist in the edit/advanced preference
(Window-Preferences-Java-Editor-Content Assist-Advanced.

It also appears that the assists cycle through a list of suggestion
sources, starting with a different one each time, which would explain
why the assists are not always slow.

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=317979

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

2010-10-16 Thread SChaser
An alternate approach is to use the view object's post(Runnable r)
method. Note that Kostya's also requires a reference - but to the
Activity object.

  myView.post(new Runnable() {...


On Oct 16, 12:00 pm, Kostya Vasilyev kmans...@gmail.com wrote:
   You can only access UI objects from the main (UI) thread.

 There are several ways to post UI operations to the UI thread.

 This one is probably the easiest: Activity.runOnUIThread(Runnable action)

[SChaser] This requires a reference to the activity, as it is not a
static method.


 http://developer.android.com/reference/android/app/Activity.html#runO...)


 16.10.2010 20:58, chcat пишет:



  I have an Activity with TextView that I am trying to update from
  different thread. To do that i pass TextView to the updater thread
  onCreate(..)
  ..
  txtStatus = (TextView)this.findViewById(R.id.status);
  // start udp server as separate thread and pass TextView to that
  thread to print text messages from udp socket

  new Thread(new TelemetryServer(txtStatus)).start();
  //see thread code below

  As a result i have thread error, even though updater is
  synchronized:
  ERROR/UDP(282): android.view.ViewRoot$CalledFromWrongThreadException:
  Only the original thread that created a view hierarchy can touch its
  views.
  Any other ideas how to solve this problem?
  Tnank you,
  -V

  public class TelemetryServer implements Runnable {
     public static final String SERVERIP = 127.0.0.1; // 'Within' the
  emulator!
     public static final int SERVERPORT = ;
     private TextView m_view;
     private DatagramSocket socket;
     private boolean loop;
     private synchronized void update( String msg)
     {
             m_view.append(\n);
             m_view.append(msg);
     }

     public TelemetryServer(TextView _view)
     {
             m_view = _view;
             loop = true;
     }
     public void run() {
             try {
                             InetAddress serverAddr = 
  InetAddress.getByName(SERVERIP);
                             Log.d(UDP, S: Connecting...);

                             socket = new DatagramSocket(SERVERPORT,
                                             serverAddr);
                             Log.i(TelemetryServer, started);
                             while(loop) {
                                     byte[] buf = new byte[1024];
                                     DatagramPacket packet = new 
  DatagramPacket(buf, buf.length);
                                     socket.receive(packet);
                                     update(new String(packet.getData()));
                             }

                     } catch (Exception e) {

                             Log.e(UDP, S: Error, e);

                     } // end of try
                     Log.d(UDP, S: Done.);
                     socket.close();
     }
  }

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

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


[android-developers] How to disable asset compression in eclipse builds?

2010-09-12 Thread SChaser
Does anyone know how to disable asset compression in eclipse builds?
In other words, how to cause the -0 flag to be set on aapt?

This is in order to put in a 1MB asset file, which requires
compression to be turned off.

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

2010-09-12 Thread SChaser
Tks

On an earlier thread, someone had tried that with no luck...But there
may be something in that direction.

This 1MB limit is a real nuisance when you have lots of data!

On Sep 12, 6:31 pm, Lance Nanek lna...@gmail.com wrote:
 It's a hack, but couldn't you just name it with one of the extensions
 that isn't compressed by default? .mp3, for example?

 On Sep 12, 7:51 pm, SChaser crotalistig...@gmail.com wrote:

  Does anyone know how to disable asset compression in eclipse builds?
  In other words, how to cause the -0 flag to be set on aapt?

  This is in order to put in a 1MB asset file, which requires
  compression to be turned off.

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

2010-09-12 Thread SChaser
Well, storing as .png does indeed keep it from being compressed,
although it is indeed a kludge.

I haven't had time to see if I can read the thing on the android.

On Sep 12, 7:50 pm, SChaser crotalistig...@gmail.com wrote:
 Tks

 On an earlier thread, someone had tried that with no luck...But there
 may be something in that direction.

 This 1MB limit is a real nuisance when you have lots of data!

 On Sep 12, 6:31 pm, Lance Nanek lna...@gmail.com wrote:

  It's a hack, but couldn't you just name it with one of the extensions
  that isn't compressed by default? .mp3, for example?

  On Sep 12, 7:51 pm, SChaser crotalistig...@gmail.com wrote:

   Does anyone know how to disable asset compression in eclipse builds?
   In other words, how to cause the -0 flag to be set on aapt?

   This is in order to put in a 1MB asset file, which requires
   compression to be turned off.

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

2010-09-12 Thread SChaser
Well, I tried making it a png, and successfully put a 3MB file into
assets, and read it okay in a test app in the emulator.

On Sep 12, 7:50 pm, SChaser crotalistig...@gmail.com wrote:
 Tks

 On an earlier thread, someone had tried that with no luck...But there
 may be something in that direction.

 This 1MB limit is a real nuisance when you have lots of data!

 On Sep 12, 6:31 pm, Lance Nanek lna...@gmail.com wrote:

  It's a hack, but couldn't you just name it with one of the extensions
  that isn't compressed by default? .mp3, for example?

  On Sep 12, 7:51 pm, SChaser crotalistig...@gmail.com wrote:

   Does anyone know how to disable asset compression in eclipse builds?
   In other words, how to cause the -0 flag to be set on aapt?

   This is in order to put in a 1MB asset file, which requires
   compression to be turned off.

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

2010-09-07 Thread SChaser
I am also considering going the C route - although even there one must
beware of Endian issues in future products.

However, I started the thread because I was hoping to do it in Java.
Endian issues could be handled by just having to sets of data, and
reading the right one.

However, its unclear to me the relationship between native C arrays
(which underlies the glSurfaceView API) and the Java code needed to
fill them. I currently use several lines of java to take a byte array
and make it into an Int array, which is rather mysterious to me. There
is a method to just wrap an array, but its never worked for me.

Can anyone shed clarity on this?

On Sep 7, 2:43 am, Robert Green rbgrn@gmail.com wrote:
 Lance,

 That's a good idea, though often times for 3D Models you'll need a few
 different object groups of given name to be loadable.  You can simple
 insert them into a HashMap and serialize the whole thing.  It
 deserializes surprisingly fast, especially if all you're storing are
 ints or floats for the data.

 If your data is less structured or more linear, you could certainly
 write up something to generate a java source file with the data in it
 like you said.  It's probably going to load nearly the fastest, though
 it requires a little more programming than serialization does.

 I'm moving on to proprietary binary file formats in C now though since
 they are the smallest and I ran into a major asset size issue on
 Deadly Chambers which wouldn't have happened had I used my own format.

 On Sep 7, 2:48 am, Lance Nanek lna...@gmail.com wrote:

  One bizarre option you might want to consider is pre-generating Java
  files with arrays in them. It benchmarked faster than reading files in
  via Java NIO when I tested it for my purposes. I'm only doing 2D,
  though. I use a script that takes a bunch of individual graphics files
  and puts them into a couple atlas textures, then pre-generates the
  texture coordinates for the two triangles needed to draw each graphic.
  So each pre-generated atlas texture has a pre-generated Java file with
  an array of all the useful texture coordinate sets for it, and
  constants for the offset into the array to use to get them for a
  particular graphic.

  On Sep 6, 7:33 pm, SChaser crotalistig...@gmail.com wrote:

   My app has large vertex arrays that are pre-computed before I even
   build the app for distribution. I'd like to store these in assets
   (recognizing the size limits of asset files) and read them in with
   minimal computation.

   Can I store them in binary, and just read them into an NIO buffer, and
   then wrap it for GL, or do I have to go through the whole compute
   intensive (?) process of reading it in, making a byte array, and
   converting that to an integer (in this case) array?

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

2010-09-06 Thread SChaser
My app has large vertex arrays that are pre-computed before I even
build the app for distribution. I'd like to store these in assets
(recognizing the size limits of asset files) and read them in with
minimal computation.

Can I store them in binary, and just read them into an NIO buffer, and
then wrap it for GL, or do I have to go through the whole compute
intensive (?) process of reading it in, making a byte array, and
converting that to an integer (in this case) array?

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

2010-08-15 Thread SChaser
IV - thanks for your response.

You are correct that if LINE_SMOOTH is disabled, the bug does not show
up.

An important point is the all the lines in this example have the same
slope (0) and yet their width varies - with the position of the X
coordinates.

That is a very odd result, that I don't think can be explained as an
artifact of emulation (an in a philosophical sense, if the emulator
can produce a display that far off, it just isn't emulating very well
in any case)

However, I tried your suggestion - I multiplied the second Y
coordinate by a variable (tried 1.1 and 1.5). In both cases, the slope
is visibly not 0, and the width of the overly wide lines is narrower,
but still WAY too wide.

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

2010-08-13 Thread SChaser
The Emulator draws line widths VERY incorrectly in OpenGL
(GLSurfaceView).

See http://www.flickr.com/photos/53002...@n03 for a comparison of the
lines drawn correctly (in JOGL) and incorrectly in the emulator. The
code also draws correctly on a real device (G1) - looks just like the
JOGL screen shot.

I believe this is a bug. However, I'm not an OpenGL GURU. Hence I have
posted a concise version of the code to demonstrate this problem at at
http://gist.github.com/523955 and http://gist.github.com/523961. I
hope I am proven wrong about a bug in the emulator, and can find a way
to use the emulator for what I want to do.

Specifically, line widths vary based on the end point locations of
lines, under the following conditions (and maybe others):

-ortho projection

-line smoothing enabled

Note: I started this thread as a continuation of thread
http://groups.google.com/group/android-developers/browse_thread/thread/9cd619ea5f2fcc99
because I think it is of general interest and worth a new start.

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

2010-08-13 Thread SChaser
I created a new thread for this topic, with better examples and screen
shots.

It is at 
http://groups.google.com/group/android-developers/browse_thread/thread/42efe5ae8acbc308

On Aug 4, 10:50 am, SChaser crotalistig...@gmail.com wrote:
 On Aug 3, 10:06 pm, Robert Green rbgrn@gmail.com wrote: Have you tried 
 different values of gl.glLineWidthx()?  0x1 is 1 in
  hex, which, given in fixed converted to float = 0.1 = super,
  super, super tiny.  I'd start with 65536 (0x if you really like
  using hex to represent FP) and see how it does.

 Yeah, I have since my last post. If I use a very wide line (, it does
 show up on the emulator, as a wide (not 1 px) line. On the phone, it
 still shows up as a 1px wide line. Go figure.

 There is something else fishy on the emulator that hints at an issue
 in the transformations - when I do make a huge line, it isn't in the
 right place. Instead of having an X in the middle of the screen (among
 other things), I have a vertical line that extends from somewhat below
 the middle of the screen to the top of the screen.

 Code is now:
   public void onDrawFrame(GL10 gl) {
     float fOrthoScale = 1;
     int lineWidth = 0x1;
     _hgt2width = (float) MyApp._width / MyApp._height;
     gl.glClearColor(0,0,.2f, 1f);
     gl.glDisable(GL10.GL_CULL_FACE);
     gl.glShadeModel(GL10.GL_FLAT);
     gl.glDisable(GL10.GL_DEPTH_TEST);
     gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
 //    gl.glViewport(0, 0, MyApp._width/2, MyApp._height/2);
     gl.glMatrixMode(GL10.GL_PROJECTION);
     gl.glLoadIdentity();
     GLU.gluOrtho2D(gl, -_hgt2width*fOrthoScale,
 _hgt2width*fOrthoScale, -1*fOrthoScale, 1*fOrthoScale);
     gl.glMatrixMode(GL10.GL_MODELVIEW);
     gl.glLoadIdentity();
 //    gl.glEnable(GL10.GL_BLEND);
     gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
     gl.glEnable(GL10.GL_LINE_SMOOTH);
     gl.glDisableClientState(GL10.GL_COLOR_ARRAY);

     gl.glScalef(1, _hgt2width, 1);
 //    gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);
     gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);

     float lscale = .002f*MyApp._curScale;

     gl.glPushMatrix();
     gl.glColor4f(1f, 1f, 0f, 1f);
     gl.glTranslatef(.375f, .5f, 0f);
     gl.glRotatef(30, 0, 0, 1);
     gl.glScalef( lscale, lscale, 1f);
     gl.glVertexPointer(2, GL10.GL_FIXED, 0, _lineVertices);
     gl.glLineWidthx(lineWidth);
     drawArrays(gl);
     gl.glPopMatrix();

     gl.glPushMatrix();
     gl.glColor4f(1f, 1f, 1f, 1.0f);
     gl.glScalef( lscale*8, lscale*8, 1f);
     gl.glVertexPointer(2, GL10.GL_FIXED, 0, _lineVertices);
     gl.glLineWidthx(lineWidth);
     drawArrays(gl);
     gl.glPopMatrix();

   }
   void drawArrays(GL10 gl) {
     gl.glDrawArrays(GL10.GL_LINE_STRIP, 0, 5); //small square
     gl.glDrawArrays(GL10.GL_LINE_STRIP, 5, 5); //medium square
     gl.glDrawArrays(GL10.GL_LINE_STRIP, 10, 5);//large square
     gl.glDrawArrays(GL10.GL_LINE_STRIP, 15, 2);//x axis
     gl.glDrawArrays(GL10.GL_LINE_STRIP, 17, 2);//y axis
     gl.glDrawArrays(GL10.GL_LINE_STRIP, 19, 2);//X half
     gl.glDrawArrays(GL10.GL_LINE_STRIP, 21, 2);//X half
   }

   void makeLines() {
     int hlf = 0x08000;
     int one = 0x1;
     int sml = one/8;
     int med = one*8;
     int big = 0x1000;
     Log.d(===jrm, String.format(one:%x   big:%x, one, big));
     int vertices[] = {
        -sml     ,         sml,    //0 start square - scale 1/10
         sml     ,         sml,    //1
         sml     ,        -sml,    //2
        -sml     ,        -sml,    //3
        -sml     ,         sml,    //4

        -one     ,         one,    //5 start square - scale 1
         one     ,         one,    //6
         one     ,        -one,    //7
        -one     ,        -one,    //8
        -one     ,         one,    //9

        -med     ,         med,    //10 start square - scale 10
         med     ,         med,    //11
         med     ,        -med,    //12
        -med     ,        -med,    //13
        -med     ,         med,    //14

        -big     ,           0,    //15 start coord axes over huge area
         big     ,           0,    //16

           0     ,         big,    //17
           0     ,        -big,    //18

        -big     ,        -big,    //19 start X over huge dimensions
         big     ,         big,    //20

        -big     ,         big,    //21
         big     ,        -big,    //22
         med     ,         one     // BUT? Without this line, blows up
 if openGL debug is enabled

     };
     this.numLines = vertices.length/2;

     ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length*4);
     vbb.order(ByteOrder.nativeOrder());
     _lineVertices = vbb.asIntBuffer();
     _lineVertices.put(vertices);
     _lineVertices.position(0);
   }

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers

[android-developers] Re: How to test OpenGL?

2010-08-04 Thread SChaser
On Aug 3, 10:06 pm, Robert Green rbgrn@gmail.com wrote:
 Have you tried different values of gl.glLineWidthx()?  0x1 is 1 in
 hex, which, given in fixed converted to float = 0.1 = super,
 super, super tiny.  I'd start with 65536 (0x if you really like
 using hex to represent FP) and see how it does.

Yeah, I have since my last post. If I use a very wide line (, it does
show up on the emulator, as a wide (not 1 px) line. On the phone, it
still shows up as a 1px wide line. Go figure.

There is something else fishy on the emulator that hints at an issue
in the transformations - when I do make a huge line, it isn't in the
right place. Instead of having an X in the middle of the screen (among
other things), I have a vertical line that extends from somewhat below
the middle of the screen to the top of the screen.

Code is now:
  public void onDrawFrame(GL10 gl) {
float fOrthoScale = 1;
int lineWidth = 0x1;
_hgt2width = (float) MyApp._width / MyApp._height;
gl.glClearColor(0,0,.2f, 1f);
gl.glDisable(GL10.GL_CULL_FACE);
gl.glShadeModel(GL10.GL_FLAT);
gl.glDisable(GL10.GL_DEPTH_TEST);
gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
//gl.glViewport(0, 0, MyApp._width/2, MyApp._height/2);
gl.glMatrixMode(GL10.GL_PROJECTION);
gl.glLoadIdentity();
GLU.gluOrtho2D(gl, -_hgt2width*fOrthoScale,
_hgt2width*fOrthoScale, -1*fOrthoScale, 1*fOrthoScale);
gl.glMatrixMode(GL10.GL_MODELVIEW);
gl.glLoadIdentity();
//gl.glEnable(GL10.GL_BLEND);
gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
gl.glEnable(GL10.GL_LINE_SMOOTH);
gl.glDisableClientState(GL10.GL_COLOR_ARRAY);

gl.glScalef(1, _hgt2width, 1);
//gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);

float lscale = .002f*MyApp._curScale;

gl.glPushMatrix();
gl.glColor4f(1f, 1f, 0f, 1f);
gl.glTranslatef(.375f, .5f, 0f);
gl.glRotatef(30, 0, 0, 1);
gl.glScalef( lscale, lscale, 1f);
gl.glVertexPointer(2, GL10.GL_FIXED, 0, _lineVertices);
gl.glLineWidthx(lineWidth);
drawArrays(gl);
gl.glPopMatrix();

gl.glPushMatrix();
gl.glColor4f(1f, 1f, 1f, 1.0f);
gl.glScalef( lscale*8, lscale*8, 1f);
gl.glVertexPointer(2, GL10.GL_FIXED, 0, _lineVertices);
gl.glLineWidthx(lineWidth);
drawArrays(gl);
gl.glPopMatrix();


  }
  void drawArrays(GL10 gl) {
gl.glDrawArrays(GL10.GL_LINE_STRIP, 0, 5); //small square
gl.glDrawArrays(GL10.GL_LINE_STRIP, 5, 5); //medium square
gl.glDrawArrays(GL10.GL_LINE_STRIP, 10, 5);//large square
gl.glDrawArrays(GL10.GL_LINE_STRIP, 15, 2);//x axis
gl.glDrawArrays(GL10.GL_LINE_STRIP, 17, 2);//y axis
gl.glDrawArrays(GL10.GL_LINE_STRIP, 19, 2);//X half
gl.glDrawArrays(GL10.GL_LINE_STRIP, 21, 2);//X half
  }

  void makeLines() {
int hlf = 0x08000;
int one = 0x1;
int sml = one/8;
int med = one*8;
int big = 0x1000;
Log.d(===jrm, String.format(one:%x   big:%x, one, big));
int vertices[] = {
   -sml , sml,//0 start square - scale 1/10
sml , sml,//1
sml ,-sml,//2
   -sml ,-sml,//3
   -sml , sml,//4

   -one , one,//5 start square - scale 1
one , one,//6
one ,-one,//7
   -one ,-one,//8
   -one , one,//9

   -med , med,//10 start square - scale 10
med , med,//11
med ,-med,//12
   -med ,-med,//13
   -med , med,//14

   -big ,   0,//15 start coord axes over huge area
big ,   0,//16

  0 , big,//17
  0 ,-big,//18

   -big ,-big,//19 start X over huge dimensions
big , big,//20

   -big , big,//21
big ,-big,//22
med , one // BUT? Without this line, blows up
if openGL debug is enabled


};
this.numLines = vertices.length/2;

ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length*4);
vbb.order(ByteOrder.nativeOrder());
_lineVertices = vbb.asIntBuffer();
_lineVertices.put(vertices);
_lineVertices.position(0);
  }

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

2010-08-03 Thread SChaser
Robert Green, thanks again for your informative answer.

I added the MODELVIEW mode right after setting the viewport, and did a
loadIdentity  after that. No change, but I agree its the correct thing
to do.

Still zero lines visible on the emulator (even when I scale up its
display). Looks fine on the G1.

Off to read the manuals again ;-(

Per your question:
gl.glScalef(1, _hgt2width, 1);

 float lscale = .002f*MyApp._curScale;

It could be that I just don't understand what this is supposed to do
but magic multipliers like .002 never look good to me when you're
having issues with drawing precision.

I am drawing in a geographical coordinate space, not pixel space. So
the scaling is used to transform from that space to the viewing space.
In my geographical space, my coordinates are in (projected) lat/long
specified with higher precision than even float can deal with (which,
fortunately, isn't a problem with this app).

My test case uses simple coordinates, but I left in the same scaling
as in the real app.

// ditch the fixed point (it's only faster on first-gen devices and
only in certain cases)

For now, I'll keep it because a bunch of code is in it, and I am
testing on a first gen device.

// now if you want a line 1px wide on the 10th line, draw a line with
x on 9.5f

I just want my lines to show up, and my reading of the openGl
documents indicates that they should, if drawn with a line width of 1,
no matter where I put them. Of course, offsetting them from pixel
edges would be a good idea, except I am not drawing in pixel
coordinate space.

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

2010-08-03 Thread SChaser


On Aug 3, 4:33 pm, Indicator Veritatis mej1...@yahoo.com wrote:
 But I am surprised no one has mentioned: your settings for glOrtho's
 near_val and far_val are odd, to say the least. The default is exactly
 the other way around with near_val=-1.0 and far_val=+1.0. Your values
 put the near plane behind the viewer, but the far plane in front. Is
 this really what you want?

Thanks for pointing this out. I have reversed them (no effect) as a
result of your suggestion.

I threw them in at the last moment, well into this thread. Originally
they were at 0,0 (I'd drawing in 2D), but when I turned on debugging,
it showed me this was causing a divide by zero (duh - if I'd looked at
the resulting transform matrix I'd have seen that). So I just added
the values, and got them backwards.

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

2010-08-02 Thread SChaser
It is entirely possible that I am doing something confused (not being
that much of an OGL person), but even then, I would expect to see the
same results on the emulator and the G1. In answer to another
question, the demos work fine on the emulator.

Is it possible that disappearing lines are caused by the emulator
pixels not matching exactly the Windows pixels to which they are
ultimately rendered?

The varying width lines didn't appear until I used extremely large
(but within the FP range) coordinates on a few lines.


I'll post the code when I get home and have access to it.

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


[android-developers] Re: How to test OpenGL?

2010-08-02 Thread SChaser
Source code is below.

Robert Green provides some helpful information, for which I am
thankful.

However, I am not clear on two of the points.

 I currently have the situation where no lines at all show on the
emulator (the background color does) and things work perfectly on the
G1.

On Aug 2, 11:26 am, Robert Green rbgrn@gmail.com wrote:

 1)  You are in a native resolution to the screen you're rendering on
 (turn all the density and screen-size stuff on in the manifest to
 avoid compat mode)

Are these the  attributes on the support-screens tag? I did not have
that tag, but adding it and turning on all the attributes in the check-
boxes did not solve the problem.

 2)  You draw the lines centered on their pixel, so they look a half
 pixel off.
 -- To draw a horizontal line across the top row of pixels, you need to
 make the line with 1.0f and have y be 0.5f (because it will draw from
 0 to 1 that way)

I am drawing in fixed point projection(?) space, so the relationship
of the lines to pixels is not clear. Also, I don't want to have to
redraw the lines when the scale changes - I want to be able to zoom
and pan easily. Is there a way to achieve that and have the lines
show?

 3)  Make sure you don't have any z-fighting.  Drawing 2 things on the
 exact same plane with depth-test turned on causes bad results on many
 opengl implementations.
Depth test turned off. I'm doing 2D only, so I think I'm clear there.

Again, thanks for the help.

 CODE SNIPS ==

- Create glSurfaceView ---
  private GLSurfaceView makeGLSurfaceView(GLSurfaceView.Renderer
renderer, Context context) {
GLSurfaceView view = new GLSurfaceView(context);
view.setDebugFlags(GLSurfaceView.DEBUG_CHECK_GL_ERROR |
GLSurfaceView.DEBUG_LOG_GL_CALLS);
view.setEGLConfigChooser(false);
if ( renderer != null ) {
  view.setRenderer(renderer);
  view.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
}
view.getHolder().setFormat(PixelFormat.OPAQUE);
return view;
  } // make gl surface view

 onDrawFrame --

// Everything stuffed into onDrawFrame to make it easy to read on
forum
  @Override
  public void onDrawFrame(GL10 gl) {
gl.glClearColor(0,0,.2f, 1f);
gl.glDisable(GL10.GL_CULL_FACE);
gl.glShadeModel(GL10.GL_FLAT);
gl.glDisable(GL10.GL_DEPTH_TEST);
gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
gl.glMatrixMode(GL10.GL_PROJECTION);
gl.glLoadIdentity();
gl.glViewport(0, 0, MyApp._width, MyApp._height);
gl.glEnable(GL10.GL_BLEND);
gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
gl.glEnable(GL10.GL_LINE_SMOOTH);
gl.glDisableClientState(GL10.GL_COLOR_ARRAY);
_hgt2width = (float) MyApp._width / MyApp._height;
gl.glOrthof(-_hgt2width, _hgt2width, -1, 1, 1, -1);

gl.glScalef(1, _hgt2width, 1);
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);

float lscale = .002f*MyApp._curScale;

gl.glPushMatrix();
gl.glColor4f(1f, 1f, 0f, 1f);

gl.glTranslatef(.375f, .5f, 0f);
gl.glScalef( lscale, lscale, 1f);
gl.glVertexPointer(2, GL10.GL_FIXED, 0, _lineVertices);
gl.glLineWidthx(0x1);
drawArrays(gl);
gl.glPopMatrix();

gl.glPushMatrix();
gl.glColor4f(1f, 1f, 1f, 1.0f);
gl.glScalef( lscale*8, lscale*8, 1f);
gl.glVertexPointer(2, GL10.GL_FIXED, 0, _lineVertices);
gl.glLineWidthx(0x1);
drawArrays(gl);
gl.glPopMatrix();


  }
  void drawArrays(GL10 gl) {
gl.glDrawArrays(GL10.GL_LINE_STRIP, 0, 5); //small square
gl.glDrawArrays(GL10.GL_LINE_STRIP, 5, 5); //medium square
gl.glDrawArrays(GL10.GL_LINE_STRIP, 10, 5);//large square
gl.glDrawArrays(GL10.GL_LINE_STRIP, 15, 2);//x axis
gl.glDrawArrays(GL10.GL_LINE_STRIP, 17, 2);//y axis
gl.glDrawArrays(GL10.GL_LINE_STRIP, 19, 2);//X half
gl.glDrawArrays(GL10.GL_LINE_STRIP, 21, 2);//X half
  }

  void makeLines() {
int hlf = 0x08000;
int one = 0x1+hlf;
int sml = one/8;
int ten = one;
int big = 0x4000;
Log.d(===jrm, String.format(one:%x   big:%x, one, big));
int vertices[] = {
   -sml , sml,//0 start square - scale 1/10
sml , sml,//1
sml ,-sml,//2
   -sml ,-sml,//3
   -sml , sml,//4

   -one , one,//5 start square - scale 1
one , one,//6
one ,-one,//7
   -one ,-one,//8
   -one , one,//9

   -ten , ten,//10 start square - scale 10
ten , ten,//11
ten ,-ten,//12
   -ten ,-ten,//13
   -ten , ten,//14

   -big ,   0,//15 start coord axes over huge area
big ,   0,//16

  0 , big,//17
  0 ,-big,//18

   -big ,   

[android-developers] Re: OpenGL missing pixels?

2010-08-01 Thread SChaser
I have tried setting the line size to 1 using glLineWidthf and also
glLineWidthx. Other attempts (see below) use glLineWidthx value of
0x1 (1 in Android GL fixed point)

Some lines simply do not render, others blow up really big on larger
scales. It is clearly scaling the lines.

I put all the OGL code in one place (below) - Anyone know what I'm
doing wrong?

  @Override
  public void onDrawFrame(GL10 gl) {
gl.glClearColor(0,0,.2f, 1f);
gl.glDisable(GL10.GL_CULL_FACE);
gl.glShadeModel(GL10.GL_FLAT);
gl.glDisable(GL10.GL_DEPTH_TEST);
gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
gl.glMatrixMode(GL10.GL_PROJECTION);
gl.glLoadIdentity();
gl.glViewport(0, 0, MyApp._width, MyApp._height);
gl.glEnable(GL10.GL_BLEND);
gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
gl.glEnable(GL10.GL_LINE_SMOOTH);
gl.glDisableClientState(GL10.GL_COLOR_ARRAY);
_hgt2width = (float) MyApp._width / MyApp._height;
gl.glOrthof(-_hgt2width, _hgt2width, -1, 1, 0, 0);

gl.glScalef(1, _hgt2width, 1);
//  gl.glEnable(GL10.GL_DITHER);
//  gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT,
GL10.GL_FASTEST);
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl.glOrthof(-_hgt2width, _hgt2width, -1, 1, 0, 0);

float lscale = .002f*MyApp._curScale; // default _curScale = 2f

gl.glPushMatrix();
gl.glColor4f(1f, 1f, 0f, 1f);

gl.glTranslatef(.25f, .5f, 0f);
gl.glScalef( lscale, lscale, 1f);
gl.glVertexPointer(2, GL10.GL_FIXED, 0, _lineVertices);
gl.glLineWidthx(0x1);
//gl.glDrawArrays(GL10.GL_LINE_STRIP, 0, numLines);
drawArrays(gl);
gl.glPopMatrix();
}

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

2010-08-01 Thread SChaser

DISCOVERY: The same code, run on my G1, does exactly what I want it to
do!

Apparently the emulator is buggy (Mine was set up as a simple 1.6
device)

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

2010-08-01 Thread SChaser
After a frustrating day of having the Emulator render lines strangely,
and then discovering that my G1 renders them exactly as I expect, I am
left to wonder how to test OpenGL (using GLSurfaceView).

Is the emulator sufficient to test code for correctness? I ask because
I experienced the following on the emulator, but not on the G1, all
using Ortho projection.

1) Line width depending on length! I drew a series of lines, most
fairly short but several with endpoints close to the edge of the fixed-
point number range. The long lines were rendered as wide. The short
lines were rendered as 1 pixel wide.

2) Lines exploding to fill the whole screen when not appropriate to
the scale (double the scale, line goes from 1/10th screen width to
filling screen (or more).

3) Lines not appearing at all if horizontal.

Is the emulator a correct openGL implementation? If I see problems on
the emulator, am I likely to see them on some hardware platforms?

Can I use my G1 as a reference platform?

Or do I need a whole slew of phones to verify that an openGl app
(scientific graphics, not animated) works across all platforms?

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

2010-07-29 Thread SChaser
I am drawing lines in OpenGL on an app that will zoom way in and out
on the surface. I would like the lines to always be visible.

Currently, when the line widths are small, at certain angles, the
lines don't render. Specifically, I have a case where diagonal lines
show but a horizontal one does not. The line width is way less than a
pixel, but there is nothing else in the area of the pixels that are
not being colored.

Is there a way to force sub-pixel elements to cause the enclosing
pixel (otherwise empty - nothing drawn there) to render the color of
the sub-pixel element?

What is the rendering algorithm that causes the sub-pixel line to
render when at an angle but not when horizontal (and hence, at the
same position in every pixel)? Can I change it?

Is there any way to do this other than changing the line width based
on the scaling I am doing to the underlying model as I display it on
the surface?

Tks

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: NDK OpenGL - Mixing Java and Native (C) calls to OpenGL API?

2010-07-26 Thread SChaser


On Jul 25, 4:25 pm, Indicator Veritatis mej1...@yahoo.com wrote:
 Although I think there is a way of making this work, I have to
 question why you would want to do this. It is the Java interface
 (including JSR-239)that is well tested in Android.

 Recall,http://developer.android.com/sdk/ndk/index.html#overviewsays:

 The NDK will not benefit most applications. ... Typical good
 candidates for the NDK are self-contained, CPU-intensive operations
 that don't allocate much memory, such as signal processing, physics
 simulation, and so on.

I am processing large amounts of data and generating complex graphics
from it. Most of the work can be self contained in C, but it is useful
to add some non-computationally-intensive stuff in Java. Believe me, I
wouldn't go to NDK if I didn't have to - I made my living as a C
programmer before I made it as a Java programmer, and I far prefer
Java.

I have run performance tests and C is *dramatically* faster for my app
- in the compute-intensive areas.

BTW... I did an experiment since posting the question and the C and
Java co-existed quite well.

I suspect the GL object handed to the GLSurfaceView callback is just a
handle to the OpenGL library, with no context associated with it. If
that's true, the answer to my question is: YES.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] NDK OpenGL - Mixing Java and Native (C) calls to OpenGL API?

2010-07-24 Thread SChaser
I would like to be able to use the OpenGL API from both Java and C
(via NDK).

In Java, there is a GL object passed, which has all GL methods on it.

In C, you just talk to the native library.

In a single onDrawFrame callback (for which Java is passed a GL), can
I use methods on the GL object, and also call NDK methods which access
the openGL library?

In other words, is the GL object just a wrapper for the same instance
of the native library?

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

2010-07-14 Thread SChaser
I have experienced the same problems. Deleting the workspace is not an
option.

Is there a way to reset it? I'd hate to have to back up an eclipse
version just for this.

On Jun 28, 12:44 pm, Xavier Ducrohet x...@android.com wrote:
 The Android plug-ins are compatible with Eclispe 3.6

 Make sure you had Contact all update sites during install to find
 required software checked in when you installed them.

 I would delete the workspace (or try with a different one) to see if that 
 helps.



 On Sun, Jun 27, 2010 at 8:04 PM, SChaser crotalistig...@gmail.com wrote:
  Are folks having success withHelios(Eclipse 3.6) and the latest SDK
  (r_06)?

  I am havingproblemsgetting the Eclipse DDMS to work;. It is missing
  most of its views (such as logcat) and complained about that the first
  time I ran it (but not since, so I don't have a list of what is going
  on.

  I had a previous working version with a prior Eclipse, but started
  from scratch with this one. The steps were:

  *Download and install (via unzip)Helios

  *Download and unzip files for SDK

  *Run SDK setup and download everything it would download.
  **It complained that some packages available were incompatible and it
  wouldn't download (or list) them

  *Install the Eclipse plug-in fromhttps://dl-ssl.google.com/android/eclipse/
  using the Eclipse new software dialog

  IsHeliosincompatible? Or am I doing something wrong?

  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

 --
 Xavier Ducrohet
 Android SDK Tech Lead
 Google Inc.

 Please do not send me questions directly. 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: Android SDK and Helios - compatibility problems?

2010-07-14 Thread SChaser
BTW... just checked - I have the latest plugins in helios.

On Jul 14, 8:14 pm, SChaser crotalistig...@gmail.com wrote:
 I have experienced the sameproblems. Deleting the workspace is not an
 option.

 Is there a way to reset it? I'd hate to have to back up an eclipse
 version just for this.

 On Jun 28, 12:44 pm, Xavier Ducrohet x...@android.com wrote:

  The Android plug-ins are compatible with Eclispe 3.6

  Make sure you had Contact all update sites during install to find
  required software checked in when you installed them.

  I would delete the workspace (or try with a different one) to see if that 
  helps.

  On Sun, Jun 27, 2010 at 8:04 PM, SChaser crotalistig...@gmail.com wrote:
   Are folks having success withHelios(Eclipse 3.6) and the latest SDK
   (r_06)?

   I am havingproblemsgetting the Eclipse DDMS to work;. It is missing
   most of its views (such as logcat) and complained about that the first
   time I ran it (but not since, so I don't have a list of what is going
   on.

   I had a previous working version with a prior Eclipse, but started
   from scratch with this one. The steps were:

   *Download and install (via unzip)Helios

   *Download and unzip files for SDK

   *Run SDK setup and download everything it would download.
   **It complained that some packages available were incompatible and it
   wouldn't download (or list) them

   *Install the Eclipse plug-in 
   fromhttps://dl-ssl.google.com/android/eclipse/
   using the Eclipse new software dialog

   IsHeliosincompatible? Or am I doing something wrong?

   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

  --
  Xavier Ducrohet
  Android SDK Tech Lead
  Google Inc.

  Please do not send me questions directly. 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] Android SDK and Helios - compatibility problems?

2010-06-27 Thread SChaser
Are folks having success with Helios (Eclipse 3.6) and the latest SDK
(r_06)?

I am having problems getting the Eclipse DDMS to work;. It is missing
most of its views (such as logcat) and complained about that the first
time I ran it (but not since, so I don't have a list of what is going
on.

I had a previous working version with a prior Eclipse, but started
from scratch with this one. The steps were:

*Download and install (via unzip) Helios

*Download and unzip files for SDK

*Run SDK setup and download everything it would download.
**It complained that some packages available were incompatible and it
wouldn't download (or list) them

*Install the Eclipse plug-in from https://dl-ssl.google.com/android/eclipse/
using the Eclipse new software dialog

Is Helios incompatible? Or am I doing something wrong?

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] Can I use OpenGL to make Bitmap without GLSurfaceView

2010-05-02 Thread SChaser
I would like to be able to use OpenGL in the Android to render into a
bitmap (or any other sort of buffer I can turn into one), without
actually displaying a GLSurfaceView.

The purpose is to dynamically create very complex images using OpenGL,
and then drawing those images on the canvas of a MapView.

I have tried overlaying a translucent GLSurfaceView over a MapView, my
preferred approach, but it has some problems:

1) I have complex menus I need to display from either the MapView or
the GLSurfaceView. I have been doing this using a ListView with its
own activity. Unfortunately, that activity pushes the MapView down the
stack. The result is a bit of flickering when the ListView activity
finishes, popping the MapView back to the top. Even worse, if I use
the ListView to overlay the GLSurfaceView (giving it the same complex
menu capabilities), when it finishes, the GLSurfaceView reappears but
the MapView doesn't display.

2)As soon as the GLSurfaceView is created, the MapView stops fetching
and rendering tiles. There seems to be no way to know when the MapView
is complete, so I have to delay an arbitrary interval before creating
the surfaceview.

3) When the GLSurfaceView is present, the MapView's built-in user
interface functions are obscured.

Anyone know if there is a way around any of these problems?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: onActivityResult not being called in Activity that uses GLSurfaceView

2010-04-26 Thread SChaser
The sub-activity has the same characteristics when started by the map-
view activity, where it reports a result back, as when started by the
GLSurfaceView activity, where it does not report back. It is the same
sub-activity, started by the same code, with the same arguments to the
intent.

BTW, how do you set something singleTask or singleInstance? I
don't have a setting like either.

Thanks for your response!

SChaser

On Apr 26, 6:59 am, Streets Of Boston flyingdutc...@gmail.com wrote:
 What are the launch-properties of your sub-activity?
 Is it a 'singleTask' or 'singleInstance'? If so, the sub-activity
 won't report a result to your main-activity's 'onActivityResult()'.

 I ask this, because i was struggling with this same issue for a while
 until i discovered that my sub-activity was set to 'singleTask'

 On Apr 25, 11:27 pm, SChaser crotalistig...@gmail.com wrote:



  Help!

  I have an activity that, instead of getting a response back from a
  startActivityForResult, is destroyed (with no callbacks) when the
  responding activity finishes!

  The activity (call it GL) subclasses Activity and sets its contentView
   to be a GLSurfaceView. This Activity overlays a MapView and uses
  translucency to draw OpenGL objects over the Map.

  Here are the details:
  The  app that uses Intents for a menu system.

  An activity needing a menu does:

  ...startActivityForResult(intent, 0)

  to fire off the menu (a ListView).

  When the menu item is selected, the menu sets a result with:

  setResult(Activity.RESULT_OK, intent); menuActivity.finish();

  In the originating activity, the onActivityResult  should be called
  with the results.

  I have two activities - one where that works, one where it doesn't.
  Both use the same common method to do the setActivityForResult call.

  The first a MapActivity which is also the starting activity of my app.
  It has no problem using the menu system to get results.

  The second is the GL Activity, an Activity which sets it content to be
  a GLSurfaceView.

  This activity never sees onActivityResult after it sends the menu
  intent, and it also vanishes without a trace (no lifecycle methods
  called other than suspend()).

  So the flow is like this:

  MapView   intent --- MenuActivity
                                     displays list of choices
                                     receives a click on a choice
                                     sets a response
                                     calls finish()
  mapview.onActivityResult -- called with result

  mapview --- intent ---    Activity using GLSurfaceView
                                     renders shape
                                     gets a click
                                     sends an intent 
  ---intent-MenuActivity

                                     onSuspend called
  displays list of choices

  receives a click on a choice

  sets a response

  calls finish()
                          surfaceview activity vanishes 
  unexplained magic 

  Something odd is going on here!

  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 
  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] onActivityResult not being called in Activity that uses GLSurfaceView

2010-04-25 Thread SChaser
Help!

I have an activity that, instead of getting a response back from a
startActivityForResult, is destroyed (with no callbacks) when the
responding activity finishes!

The activity (call it GL) subclasses Activity and sets its contentView
 to be a GLSurfaceView. This Activity overlays a MapView and uses
translucency to draw OpenGL objects over the Map.


Here are the details:
The  app that uses Intents for a menu system.

An activity needing a menu does:

...startActivityForResult(intent, 0)

to fire off the menu (a ListView).

When the menu item is selected, the menu sets a result with:

setResult(Activity.RESULT_OK, intent); menuActivity.finish();

In the originating activity, the onActivityResult  should be called
with the results.

I have two activities - one where that works, one where it doesn't.
Both use the same common method to do the setActivityForResult call.

The first a MapActivity which is also the starting activity of my app.
It has no problem using the menu system to get results.

The second is the GL Activity, an Activity which sets it content to be
a GLSurfaceView.

This activity never sees onActivityResult after it sends the menu
intent, and it also vanishes without a trace (no lifecycle methods
called other than suspend()).


So the flow is like this:

MapView   intent --- MenuActivity
   displays list of choices
   receives a click on a choice
   sets a response
   calls finish()
mapview.onActivityResult -- called with result

mapview --- intent ---Activity using GLSurfaceView
   renders shape
   gets a click
   sends an intent ---intent-
MenuActivity
   onSuspend called
displays list of choices
 
receives a click on a choice
 
sets a response
 
calls finish()
surfaceview activity vanishes 
unexplained magic 

Something odd is going on here!

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] Google Map drawing stops when GLSurfaceVIew overlay started

2010-04-23 Thread SChaser
I have an application that uses a the Google Maps API to create a map
in a MapView. It then uses an intent to start an activity which uses a
transparent GLSurfaceView as its content - to overlay OGL content on
the map.

When the GLSurfaceView activity is started, the map stops fetching and
rendering tiles. If I pause a while before starting the surface view,
everything works fine - the map renders, and the view draws over the
map appropriately (with the map showing through transparent parts).

That, however, is not a very satisfactory solution. I can't tell when
the map is fully rendered, and also, I would rather have the map
loading tiles while the OGL work is in process.

Is there any way to make this work other than the kludge of just
waiting a couple of seconds before firing off the activity for the
GLSurfaceView?

Is there a different way to use a GLSurfaceView over a MapView than
with two activities?

Tks in advance

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


[android-developers] Re: How do I overlaying transparent gifs

2010-01-10 Thread SChaser
Answering my own question:

If using the draw method on an ImageView, the transparent color is
treated as transparent. No extra effort is required. The Z-order is in
order of the draw operations (not surprising).

Example code:
  if ( bm1 != null ) {
  canvas.drawBitmap(bm1, (Rect)null, r, new Paint());
}
if ( bm2 != null ) {
  canvas.drawBitmap(bm2, (Rect)null, r, new Paint());
}
  }

On Jan 9, 3:19 pm, SChaser crotalistig...@gmail.com wrote:
 I have an app that downloads several gifs and then needs to overlay
 them (not all centered at the same point), honoring the transparency
 of the images.

 I am currently planning to subclass ImageView.

 What is an efficient way to do the overlay/merge?
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 do I overlaying transparent gifs

2010-01-09 Thread SChaser
I have an app that downloads several gifs and then needs to overlay
them (not all centered at the same point), honoring the transparency
of the images.

I am currently planning to subclass ImageView.

What is an efficient way to do the overlay/merge?
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Overlaying graphics on a camera preview?

2009-10-06 Thread SChaser

Thank you. I shall have to try that.

On Oct 4, 5:52 am, Mark Murphy mmur...@commonsware.com wrote:
  1) draw graphics over a camerapreviewwhen it is the whole view for
  the activity?

  2)do the same thing with a camerapreviewin a layout shared with
  other (small) views?

 Step #1: Put the camerapreview'sSurfaceView in a RelativeLayout.

 Step #2: Put the other widgets in the same RelativeLayout, after the
 SurfaceView in the XML, such that those widgets will overlap the
 SurfaceView.

 Step #3: There is no step #3.

 RelativeLayout and FrameLayout support overlapping widgets; RelativeLayout
 is usually more useful when you have one thing that is the full screen and
 stuff that overlaps portions of it.

 You can see an example of this technique here, where I use SurfaceView for
 playing back video and have pop-up panels activated by on-screen taps:

 http://github.com/commonsguy/vidtry

 It is conceivable that somehow the camerapreview'sSurfaceView will fail
 at this where the MediaPlayer's SurfaceView succeeds, but that would
 surprise me.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Overlaying graphics on a camera preview?

2009-10-03 Thread SChaser

I am interested in putting some simple graphics (lines, a bit of text,
etc) over a live camera preview.

I've looked at the examples, and fiddled around a bunch, but just
don't see how to do it.

The examples use a GLSurfaceView as a camera preview surface, but in
that mode the view apparently cannot be drawn on. They also fill the
whole screen with it.

I tried putting it in a normal layout, rather that setting it as the
content view, but it does't work.

Anyone know how to:
1) draw graphics over a camera preview when it is the whole view for
the activity?
2)do the same thing with a camera preview in a layout shared with
other (small) views?

Thanks in advance

P.S. - asked this in beginners forum and got no answers.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Two SurfaceViews in a FrameLayout

2009-09-20 Thread SChaser

How would one render the overlay in the main window while the other
views are active (or at all, for that matter)? I am interesting in
overlaying OpenGL over a camera preview. What is the way to get the
GLSurfaceView object when it is an overlay?


On Jul 30, 6:40 am, Dianne Hackborn hack...@android.com wrote:
 It's probably not the best way, but right now you simply can not have
 multiple overlapping surface views in a window, so the only way to achieve
 this is to render the overlay in the main window.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Two SurfaceViews in a FrameLayout

2009-09-20 Thread SChaser

Thanks for the prompt response.

How does one do augmented reality, then?

On Sep 20, 6:56 pm, Dianne Hackborn hack...@android.com wrote:
 Multiple active overlapping surface views, of any sort, are not currently
 supported by the framework.  You may get them to work, but it is mostly due
 to luck -- the view hierarchy does not define the Z-ordering of those
 surfaces, nor try to ensure they are Z-ordered in any particular way, so
 this may change for whatever reason.

 On Sun, Sep 20, 2009 at 6:14 PM, SChaser crotalistig...@gmail.com wrote:

  How would one render the overlay in the main window while the other
  views are active (or at all, for that matter)? I am interesting in
  overlaying OpenGL over a camera preview. What is the way to get the
  GLSurfaceView object when it is an overlay?

  On Jul 30, 6:40 am, Dianne Hackborn hack...@android.com wrote:
   It's probably not the best way, but right now you simply can not have
   multiple overlapping surface views in a window, so the only way to
  achieve
   this is to render the overlay in the main window.

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

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Trouble with GLSurfaceView

2009-09-12 Thread SChaser



On Sep 12, 9:27 am, David Minor davemi...@gmail.com wrote:
 What do you mean by stops working?


When the application becomes visible again, everything is okay except
that the GLSurfaceVIew is invisible. It's normal red background
doesn't show, and none of the graphics objects are visible. Even so,
the TouchListener on that GLSurfaceView is still active (it still
generates appropriate callbacks to the listener object - see trace).

Here is a trace starting with a restart of the 1.5 EMulator. Lines
starting with D/== are my logging of events in the (very simple)
application. The PID of the application is 713.

D/AndroidRuntime(  706):
D/AndroidRuntime(  706):  AndroidRuntime START

D/AndroidRuntime(  706): CheckJNI is ON
D/AndroidRuntime(  706): --- registering native functions ---
I/jdwp(  706): received file descriptor 19 from ADB
I/ActivityManager(  570): Starting activity: Intent { flags=0x1000
comp={com.tinyvital.android.apps.arotatingshapes/
com.tinyvital.android.apps.arotatingshapes.MainActivity} }
D/AndroidRuntime(  706): Shutting down VM
D/dalvikvm(  706): DestroyJavaVM waiting for non-daemon threads to
exit
I/ActivityManager(  570): Start proc
com.tinyvital.android.apps.arotatingshapes for activity
com.tinyvital.android.apps.arotatingshapes/.MainActivity: pid=713
uid=10031 gids={}
D/dalvikvm(  706): DestroyJavaVM shutting VM down
D/dalvikvm(  706): HeapWorker thread shutting down
D/dalvikvm(  706): HeapWorker thread has shut down
D/jdwp(  706): JDWP shutting down net...
D/jdwp(  706): +++ peer disconnected
I/dalvikvm(  706): Debugger has detached; object registry had 1
entries
D/dalvikvm(  706): VM cleaning up
D/dalvikvm(  706): LinearAlloc 0x0 used 639228 of 4194304 (15%)
I/jdwp(  713): received file descriptor 10 from ADB
D/===jrm  (  713): onCreate(null)
D/===jrm  (  713): Main.onStart
D/===jrm  (  713): onResume
E/GLLogger(  713): couldn't load libhgl.so library (Cannot find
library)
D/SurfaceFlinger(  570): pid 713 requesting gpu surface (current owner
= -1)
E/MemoryHeapBase(  570): error opening /dev/pmem_gpu0: No such file or
directory
E/MemoryHeapBase(  570): error opening /dev/pmem_gpu1: No such file or
directory
E/MemoryHeapBase(  570): error opening /dev/hw3d: No such file or
directory
D/SurfaceFlinger(  570): pid 713 requesting gpu surface (current owner
= -1)
E/MemoryHeapBase(  570): error opening /dev/pmem_gpu0: No such file or
directory
E/MemoryHeapBase(  570): error opening /dev/pmem_gpu1: No such file or
directory
E/MemoryHeapBase(  570): error opening /dev/hw3d: No such file or
directory
I/ActivityManager(  570): Displayed activity
com.tinyvital.android.apps.arotatingshapes/.MainActivity: 968 ms
I/ARMAssembler(  713): generated
scanline__0077:03010144__ [ 11 ipp] (45 ins) at
[0x1a6328:0x1a63dc] in 5069638 ns
D/dalvikvm(  612): GC freed 2491 objects / 143496 bytes in 86ms
D/===jrm  (  713):  onTouch:MotionEvent{435b4d70 action=0 x=25.0
y=138.0 pressure=1.0 size=0.0}
D/===jrm  (  713):  onTouch:MotionEvent{435b4d70 action=1 x=25.0
y=138.0 pressure=1.0 size=0.0}
I/ActivityManager(  570): Starting activity: Intent
{ action=android.intent.action.MAIN categories=
{android.intent.category.HOME} flags=0x1020 comp=
{com.android.launcher/com.android.launcher.Launcher} }
D/===jrm  (  713): onSaveInstanceState(Bundle
[{android:viewHierarchyState=Bundle
[{android:views=android.util.sparsear...@435c71c0}]}])
D/===jrm  (  713): Main.onPause
D/===jrm  (  713): Main.onStop

[NOTE: Activity stopping when Home button pressed]

D/dalvikvm(  713): GC freed 2812 objects / 144792 bytes in 162ms
I/ActivityManager(  570): Starting activity: Intent
{ action=android.intent.action.MAIN categories=
{android.intent.category.LAUNCHER} flags=0x1020 comp=
{com.tinyvital.android.apps.arotatingshapes/
com.tinyvital.android.apps.arotatingshapes.MainActivity} }

[NOTE: Activity restarting when selected from applications menu]

D/===jrm  (  713): onCreate(null)
D/===jrm  (  713): Main.onStart
D/===jrm  (  713): onResume
D/SurfaceFlinger(  570): pid 713 requesting gpu surface (current owner
= -1)
E/MemoryHeapBase(  570): error opening /dev/pmem_gpu0: No such file or
directory
E/MemoryHeapBase(  570): error opening /dev/pmem_gpu1: No such file or
directory
E/MemoryHeapBase(  570): error opening /dev/hw3d: No such file or
directory
D/SurfaceFlinger(  570): pid 713 requesting gpu surface (current owner
= -1)
W/IInputConnectionWrapper(  612): showStatusIcon on inactive
InputConnection
E/MemoryHeapBase(  570): error opening /dev/pmem_gpu0: No such file or
directory
E/MemoryHeapBase(  570): error opening /dev/pmem_gpu1: No such file or
directory
E/MemoryHeapBase(  570): error opening /dev/hw3d: No such file or
directory
I/ActivityManager(  570): Displayed activity
com.tinyvital.android.apps.arotatingshapes/.MainActivity: 405 ms
D/===jrm  (  713):  onTouch:MotionEvent{435b4d70 action=0 x=163.0
y=52.0 pressure=1.0 size=0.0}
D/===jrm  (  713):  

[android-developers] 1.5 Example GLSurfaceViewActivity.java fails after stop/resume

2009-09-12 Thread SChaser

I am having trouble with the example for use of GLSurfaceView (see
http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/graphics/GLSurfaceViewActivity.html
).

I created a normal Android project in the Eclipse IDE, added the
GLSurfaceViewActivity class and related from the sample directory, set
the activity to GLSurfaceViewActivity, and ran it on the emulator.

It worked. Then I hit the home button, launched another app, hit home
again, and launched my test app again. This time, I got a blank screen
(with now exceptions thrown in logcat);.

Any ideas?

I was motivated to try this example because if have been having the
same trouble with my own app - discussed
iathttp://groups.google.com/group/android-developers/browse_thread/thread/b1b97aa8e18e6b04
.

My application has Log.d calls that show the following sequence:
onCreate
onStart
onResume
...working app with rendering on the GLSurface...
onStop
onCreate
onStart
onResume
...everything works but the GLSurfaceView rendering. (see related
discussion)
(onStop-onCreate-onStart-onResume).

That app is careful to call the notification methods on the surface
when when system state change callbacks in the view are called.



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: 1.5 Example GLSurfaceViewActivity.java fails after stop/resume

2009-09-12 Thread SChaser

I take it back! Now it works (but my app doesn't - it has a big
difference - see the discussion at
http://groups.google.com/group/android-developers/browse_thread/thread/b1b97aa8e18e6b04.
Go figure. I'd delete the thread if I could :-(

On Sep 12, 3:08 pm, SChaser crotalistig...@gmail.com wrote:
 I am having trouble with the example for use of GLSurfaceView 
 (seehttp://developer.android.com/guide/samples/ApiDemos/src/com/example/a...
 ).

 I created a normal Android project in the Eclipse IDE, added the
 GLSurfaceViewActivity class and related from the sample directory, set
 the activity to GLSurfaceViewActivity, and ran it on the emulator.

 It worked. Then I hit the home button, launched another app, hit home
 again, and launched my test app again. This time, I got a blank screen
 (with now exceptions thrown in logcat);.

 Any ideas?

 I was motivated to try this example because if have been having the
 same trouble with my own app - discussed
 iathttp://groups.google.com/group/android-developers/browse_thread/threa...
 .

 My application has Log.d calls that show the following sequence:
 onCreate
 onStart
 onResume
 ...working app with rendering on the GLSurface...
 onStop
 onCreate
 onStart
 onResume
 ...everything works but the GLSurfaceView rendering. (see related
 discussion)
 (onStop-onCreate-onStart-onResume).

 That app is careful to call the notification methods on the surface
 when when system state change callbacks in the view are called.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Trouble with GLSurfaceView (more info: works if only view, but not as one of several)

2009-09-12 Thread SChaser

More information:

It works if it is the ONLY view on the page, as done by

_surfaceView = new GLSurfaceView(this);
setContentView(_surfaceView);

However, if I make it part of the app framework, it fails as described
above in this discussion:
setContentView(R.layout.main);
_surfaceView = (GLSurfaceView)this.findViewById(R.id.SurfaceView);

See below for main.xml

Odd, eh?

Thanks in advance

-- main.xml --
?xml version=1.0 encoding=utf-8?
LinearLayout
  xmlns:android=http://schemas.android.com/apk/res/android;
  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=Put text here /
  LinearLayout
android:id=@+id/LinearLayout01
android:layout_width=wrap_content
android:layout_height=wrap_content
Button
  android:text=Solid
  android:id=@+id/SolidWireButton
  android:layout_width=wrap_content
  android:layout_height=wrap_content/Button
Button
  android:text=Sphere
  android:id=@+id/SphereButton
  android:layout_width=wrap_content
  android:layout_height=wrap_content/Button
Button
  android:text=Cube
  android:id=@+id/CubeButton
  android:layout_width=wrap_content
  android:layout_height=wrap_content/Button

  /LinearLayout
  android.opengl.GLSurfaceView
android:id=@+id/SurfaceView
android:layout_height=fill_parent
android:layout_width=fill_parent/android.opengl.GLSurfaceView
/LinearLayout



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

2009-09-11 Thread SChaser

I've been messing around with GLSurfaceView, first with just my own
code, and then with the demo framework from Pro Android.

In both cases, the view stops working after the application has been
paused (say, by bringing up the home screen, and then selecting the
application and running it again). I am calling the onPause and
onResume methods on the GLSurface view object, but it still doesn't
restart. The rest of the app recovers - the buttons are visible and
they work.

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



[android-developers] Re: Testing OpenGL rendering in Java outside of Android?

2009-08-30 Thread SChaser

I took a look at that. I am not sure of all incompatibilities, but it
does not provide the GL10 object, which I believe is required for
Android JOGL apps.

Ideas?

On Aug 29, 9:33 pm, Romain Guy romain...@google.com wrote:
 I think thatJOGL2 supports OpenGL ES 1.0 and 2.0. You could try with this.

 On Sat, Aug 29, 2009 at 9:28 PM, SChasercrotalistig...@gmail.com wrote:

  I would like to write OpenGL classes and test them in java outside of
  an Android device or emulator, and then use these in the Android.

  Has anybody done this?: If so, are thereJOGLimplementations that are
  directly compatible?

  I tried doing this onWindowsusingJOGLand writing wrappers, etc,
  but it turned out to be a real mess. I finally gave up when I didn't
  know how to get a GLU instance for a frustrum call.

  Thanks

 --
 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] Testing OpenGL rendering in Java outside of Android?

2009-08-29 Thread SChaser

I would like to write OpenGL classes and test them in java outside of
an Android device or emulator, and then use these in the Android.

Has anybody done this?: If so, are there JOGL implementations that are
directly compatible?

I tried doing this on Windows using JOGL and writing wrappers, etc,
but it turned out to be a real mess. I finally gave up when I didn't
know how to get a GLU instance for a frustrum call.

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: Keeping graphics running through orientation change

2009-08-19 Thread SChaser



On Aug 19, 3:11 am, String sterling.ud...@googlemail.com wrote:
 On Aug 19, 2:59 am, Dianne Hackborn hack...@android.com wrote:

  And is the status bar actually changing orientation when this happens?  My
  guess would be that they force the screen into one orientation, and just
  rotate their window's drawing based on the current sensor data they receive.

Sorry I didn't communicate that more clearly. That's exactly what I
want to be able to do, and the reason I started this thread.

Thanks for the answer.


I just tried android:screenOrientation=portrait and it now
completely ignores orientation changes, which is good!

It still cycles the activity when the keyboard is opened/shut. Can
that also be prevented?

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: Keeping graphics running through orientation change

2009-08-18 Thread SChaser



On Aug 18, 9:35 am, Dianne Hackborn hack...@android.com wrote:
 You can't stop the screen from dimming/blurring.  This is always done

I downloaded an application which never dims/blurs, so they must have
figured out how.

It is called Bubble and is a simple level. It has three orientations
(horizontal level, vertical level, surface circular leel) that it
switches between depending on orientation. But the switch is
instantaneous and it never burs.

Any idea how it is done?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Keeping graphics running through orientation change

2009-08-17 Thread SChaser

I forgot to add the log showing three of these events:

I/WindowManager(   60): Setting rotation to 1, animFlags=1

I/WindowManager(   60): Config changed: { scale=1.0 imsi=0/0
locale=en_US touch=3 key=2/1/1 nav=3 orien=2 }

D/===jrm  (16551): MainActivity.onConfigurationChanged - orientation:2

D/===jrm  (16551): MainActivity.drawGraphics(onConfigurationChanged)

D/===jrm  (16551): LevelView.surfaceDestroyed

D/StatusBar(   60): updateResources

D/===jrm  (16551): LevelView.()

D/===jrm  (16551): new DataLoggerThread()

D/===jrm  (16551): LevelView.surfaceCreated

D/===jrm  (16551): LevelView.surfaceChanged
(holder,format,width=480,height=203

D/===jrm  (16551): LevelThread.setSurfaceSize

D/dalvikvm(   60): GC freed 827 objects / 36240 bytes in 329ms

I/WindowManager(   60): Setting rotation to 0, animFlags=1

I/WindowManager(   60): Config changed: { scale=1.0 imsi=0/0
locale=en_US touch=3 key=2/1/2 nav=3 orien=1 }

D/===jrm  (16551): MainActivity.onConfigurationChanged - orientation:1

D/===jrm  (16551): MainActivity.drawGraphics(onConfigurationChanged)

D/===jrm  (16551): LevelView.surfaceDestroyed

D/StatusBar(   60): updateResources

D/===jrm  (16551): LevelView.()

D/===jrm  (16551): new DataLoggerThread()

D/===jrm  (16551): LevelView.surfaceCreated

D/===jrm  (16551): LevelView.surfaceChanged
(holder,format,width=320,height=363

D/===jrm  (16551): LevelThread.setSurfaceSize

D/dalvikvm(16551): GC freed 420 objects / 86400 bytes in 149ms

W/SurfaceComposerClient(16551): lock_layer timed out (is the CPU
pegged?) layer=1, lcblk=0x41f280a0, state=0003 (was 0042)

W/SurfaceComposerClient(16551): lock_layer() timed out but didn't
appear to need to be locked and we recovered (layer=1,
lcblk=0x41f280a0, state=0003)

D/dalvikvm(   60): GC freed 924 objects / 41760 bytes in 350ms

I/WindowManager(   60): onOrientationChanged, rotation changed to 1

I/WindowManager(   60): Setting rotation to 1, animFlags=0

I/WindowManager(   60): Config changed: { scale=1.0 imsi=0/0
locale=en_US touch=3 key=2/1/2 nav=3 orien=2 }

D/===jrm  (16551): MainActivity.onConfigurationChanged - orientation:2

D/===jrm  (16551): MainActivity.drawGraphics(onConfigurationChanged)

D/===jrm  (16551): LevelView.surfaceDestroyed

D/StatusBar(   60): updateResources

D/===jrm  (16551): LevelView.()

D/===jrm  (16551): new DataLoggerThread()

D/===jrm  (16551): LevelView.surfaceCreated

D/===jrm  (16551): LevelView.surfaceChanged
(holder,format,width=480,height=203

D/===jrm  (16551): LevelThread.setSurfaceSize

D/dalvikvm(   60): GC freed 784 objects / 34728 bytes in 323ms

D/===jrm  (16551): LevelThread.setCenter()

I/WindowManager(   60): onOrientationChanged, rotation changed to 0

I/WindowManager(   60): Setting rotation to 0, animFlags=0

I/WindowManager(   60): Config changed: { scale=1.0 imsi=0/0
locale=en_US touch=3 key=2/1/2 nav=3 orien=1 }

D/===jrm  (16551): MainActivity.onConfigurationChanged - orientation:1

D/===jrm  (16551): MainActivity.drawGraphics(onConfigurationChanged)

D/===jrm  (16551): LevelView.surfaceDestroyed

D/StatusBar(   60): updateResources

D/===jrm  (16551): LevelView.()

D/===jrm  (16551): new DataLoggerThread()

D/===jrm  (16551): LevelView.surfaceCreated

D/===jrm  (16551): LevelView.surfaceChanged
(holder,format,width=320,height=363

D/===jrm  (16551): LevelThread.setSurfaceSize


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

2009-08-17 Thread SChaser



On Aug 3, 11:29 am, Mark Murphy mmur...@commonsware.com wrote:


 http://wiki.andmob.org/samplecode

 Look in there for the links to the Rotational Forces series of blog
 posts. This one covers what you need:

 http://androidguys.com/?p=2723

 In your case, you would detect the rotation and change how you draw on
 your canvas to match.

Thanks. I tried that and it still doesn't do the trick.

I have a simple layout - a couple of buttons in a listview, a couple
of text fields in a listview, and a custom SurfaceView.

The problem is that when I rotate the device (changing orientation),
even with the hacks ( and logging to verify that the
onConfigurationChange method of my activity is being called), there is
still half a second where the screen goes grayish and my SurfaceView
is inaccessible to draw on.

Oddly, popping the keyboard in and out also results in an orientation
change, but nothing goes gray.

In both cases, based on the log, my methods get called in the same
order.and the time from surface destroyed to surface created is
virtually identical at about 450 msec.

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

2009-08-09 Thread SChaser

I wrote a little test program that has a custom SurfaceView class and
some buttons to let me cause various operations on them (draw bitmap
over all of it - white or black, draw a circle on it, draw blue bitmap
and circle).

In each case, the drawing is done on a canvas obtained with
getHolder.lockCanvas().

If I draw the white background in one op, then draw the red circle,
the background vanishes. If I draw the red circle again, the white
background re-appears behind it.

Other operations have similar results - it's as if there is a toggle
on the background pixels (those untouched by the circle drawing) -
draw the circle once - get one background, draw it again, get
another.

Obviously I don't understand the semantics of SurfaceView.

Any pointers?


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

2009-08-03 Thread SChaser

How does one create a graphics canvas that is visible by the user
through orientation (port-land-port) changes? If one defines layout
land and port, there is a noticeable pause during the switch. Yet, I
downloaded a bubble level application that never pauses as orientation
changes - even when it switches from a circular level (gravity vector
through back of device) to a flat level (gravity vector through side
or bottom edge). How is this done?

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

2009-08-02 Thread SChaser

I created an android project in eclipse that had a custom
MySurfaceView object that was a subclass of SurfaceView and was
declared in the layout. I refactored this project several times.

When I tried to run it, it blew up immediately.

I used adb.exe logcat to look at the logs and it was having trouble
“inflating” MySurfaceView - couldn’t find the class.

After wasting lots of time, I suspected that the project wasn’t being
built correctly. I created a new ASurfaceView class and put all the
MySurfaceView stuff in it so it was identical except for the name. I
then deleted MySurfaceView.java. I changed the layout xml to refer to
the new ASurfaceView.

The problems was fixed

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