[android-developers] Bluetooth background discovery without Activity

2010-01-26 Thread steff
Hi there,

I'm looking for a way to implement a 'background' bluetooth discovery.
The app should periodically scan for nearby bluetooth devices (no
connection required) without user interaction.
Discovering devices works fine when I use it within an Activity. But
how can I set up the BroadcastReceiver within a standard Java class?

Thanks in advance,
steff

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

2010-01-13 Thread steff
I've implemented multitouch on Motorola Milestone and it seems to be
working fine. Moreover, I didn't find it too complicated. See the
source below. It can't guarantee that this is 100% correct but at
least it's straight forward:

@Override
public boolean onTouch(View v, MotionEvent event) {
for (int i=0; ievent.getPointerCount(); i++) {
Log.d(Pointer, Pointer +(i+1)+: x=+event.getX(i)+,
y=+event.getY(i));
}
}

I'd be glad to hear if this works for anyone else.

On 26 Dez. 2009, 20:49, rageman nene...@gmail.com wrote:
 Trying once more, all replies seems to end up in the void :-(

 Unfortunately the design of the multi touch api requires new api calls
 introduced in 2.0.
 In my opinion it would be nicer to have added a index for the move
 event in the same way as on the up/down event.
 This would have leave the api fully backwards compatible.

 We would like to support platform 1.5 - 2.x with the same SKU and
 support multi-touch on the 2.x devices and single touch on the other.
 Is this still possible when using function calls introduced in 2.0?
 In C/C++ even objective C you could use weak pointers, is this also
 possible in Java on Android?

 Any help would be very appreciated :-).

 Cheers,

 On Dec 26, 7:33 pm, Dianne Hackborn hack...@android.com wrote:



  There is currently no official sample code, but you can look at the
  PointerLocation (from Dev Tools) code:

 http://android.git.kernel.org/?p=platform/development.git;a=blob;f=ap...

  On Thu, Dec 24, 2009 at 10:30 PM, pcm2a reeeye...@gmail.com wrote:
   Are there any multitouch code examples that Google provides for SDK
   levels 2.0 or higher?  I do searches on here and on google and come up
   empty.

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

  --
  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] JmDNS/zeroconf/Bonjour with Android SDK 2.0

2010-01-11 Thread steff
Hi everyone,

JmDNS is giving me a hard time. I was wondering if anyone successfully
implemented it on Android SDK 2.0 (+).
In my attempt to figure out what goes wrong I tried out TunesRemote
from the Market. Since its source code is available (http://
dacp.jsharkey.org/) I also compiled it myself. Neither version works
on my phone (Motorola Milestone/Droid). The emulator doesn't work as
well.

So here's what's (not) happening: I can set up everything as needed
but unfortunately the ServiceListener never responds to anything. I
know that there's a ton of services available in this network so this
can not be the issue.

I've already written Jeffrey Sharkey an email but he hasn't responded
(yet). He seems to be very busy since he is working for Google.
Moreover, his TunesControl project is from 2008, i.e. far from being
tested on SDK 2.0.

So I was wondering if anybody was able to get it working. Maybe
there's some code available...

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

[android-developers] Re: Why are onCreate() onStart() etc. called when handset orientation is changed?

2009-12-19 Thread steff
Thanks everyone, this helped me a lot in understanding the concept
behind activities. great work, guys.

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


[android-developers] Re: Why are onCreate() onStart() etc. called when handset orientation is changed?

2009-12-16 Thread steff
My app is working fine and also works when onCreate() is (re)called.
But I'm sending accelerometer and orientation (as well as touch
position) data from the hardware sensors. And re-instantiating the app
causes a (small) lag in which no data is send. I'm using UDP via OSC
since transmission is time critical.
On the other hand, I don't want to keep on sending all sensor data
when the app is no longer open (a.k.a. in the background). This
would drain your battery really fast. That's why I'd like to end it.

On 15 Dez., 20:45, Dianne Hackborn hack...@android.com wrote:
 On Tue, Dec 15, 2009 at 11:16 AM, steff stefan.dierd...@googlemail.comwrote:

  Having solved this, a new question arises: how can I securely exit the
  app when it loses focus, i.e. the user returns to the homescreen? I
  don't want no background process.

 You don't.  That's not how Android works.

 And please be aware -- if you are using android:configChanges because your
 app doesn't work when it rotates, then this is NOT a fix.  You are just
 hiding the problem, which will show up in other cases such as when the user
 leaves your app, its process needs to be killed, and they later return to
 it.

 Please don't just use android:configChanges to band-aid over problems in
 your app.  Fix your app.

 --
 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] Why are onCreate() onStart() etc. called when handset orientation is changed?

2009-12-15 Thread steff
Hi everyone,

I got my hands on Android which is really fun. But at some point I
don't seem to understand the concept. I've got a Main class which
reads like this:

public class Main extends Activity implements SensorEventListener
{ ... }

in the onCreate(...)  I set the layout to
setContentView(R.layout.main);
and add an OnTouchEvent Listener to the sole View in main.xml:
myView.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {...

As you can see I also implemented a SensorEventListener which is used
if required. All works fine so far.

But my problem is this (at this point my misunderstanding kicks in):
whenever I rotate the device the onCreate(), onStart() etc. methods
are called, causing my app to act as if it just started. Furthermore,
I feel unable to implement an onSizeChanged(int w, int h, int oldw,
int oldh) { ... } Listener.

Can anyone please explain where my error in reasoning is? I am working
on a tiny app which is more or less done, except for the just
mentioned bug(s). Maybe I got it all wrong but it does what it is
supposed to do (i.e. sending touch positions and accelerometer data
over the network via UDP).

Thanks for any help.
Regards,
Steff

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


[android-developers] Why are onCreate() onStart() etc. called when handset orientation is changed?

2009-12-15 Thread steff
Hi everyone,

I got my hands on Android which is really fun. But at some point I
don't seem to understand the concept. I've got a Main class which
reads like this:

public class Main extends Activity implements SensorEventListener
{ ... }

in the onCreate(...)  I set the layout to
setContentView(R.layout.main);
and add an OnTouchEvent Listener to the sole View in main.xml:
myView.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {...

As you can see I also implemented a SensorEventListener which is used
if required. All works fine so far.

But my problem is this (at this point my misunderstanding kicks in):
whenever I rotate the device the onCreate(), onStart() etc. methods
are called, causing my app to act as if it just started. Furthermore,
I feel unable to implement an onSizeChanged(int w, int h, int oldw,
int oldh) { ... } Listener.

Can anyone please explain where my error in reasoning is? I am working
on a tiny app which is more or less done, except for the just
mentioned bug(s). Maybe I got it all wrong but it does what it is
supposed to do (i.e. sending touch positions and accelerometer data
over the network via UDP).

Thanks for any help.
Regards,
Steff

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


[android-developers] Re: Why are onCreate() onStart() etc. called when handset orientation is changed?

2009-12-15 Thread steff
First I got to apologize for that double posting. I got impatient
since it took so long for the message to appear.

In the meantime I figured it out myself, indeed using
android:configChanges
within the Activity tag in the AndroidManifest. Now it works like a
charm.

Having solved this, a new question arises: how can I securely exit the
app when it loses focus, i.e. the user returns to the homescreen? I
don't want no background process.

Thanks to all,
Steff

On 15 Dez., 19:29, G ghack...@gmail.com wrote:
 You need to check the Activity's entry in the Manifest and alter the
 android:configChanges to include keyboardHidden and orientation
 Then you need to override OnConfigurationChanged() method in your
 activity.

 More details 
 here...http://developer.android.com/guide/topics/manifest/activity-element.h...

 On Dec 15, 7:10 am, steff stefan.dierd...@googlemail.com wrote:



  Hi everyone,

  I got my hands on Android which is really fun. But at some point I
  don't seem to understand the concept. I've got a Main class which
  reads like this:

  public class Main extends Activity implements SensorEventListener
  { ... }

  in the onCreate(...)  I set the layout to
  setContentView(R.layout.main);
  and add an OnTouchEvent Listener to the sole View in main.xml:
  myView.setOnTouchListener(new OnTouchListener() {
                          @Override
                          public boolean onTouch(View v, MotionEvent event) 
  {...

  As you can see I also implemented a SensorEventListener which is used
  if required. All works fine so far.

  But my problem is this (at this point my misunderstanding kicks in):
  whenever I rotate the device the onCreate(), onStart() etc. methods
  are called, causing my app to act as if it just started. Furthermore,
  I feel unable to implement an onSizeChanged(int w, int h, int oldw,
  int oldh) { ... } Listener.

  Can anyone please explain where my error in reasoning is? I am working
  on a tiny app which is more or less done, except for the just
  mentioned bug(s). Maybe I got it all wrong but it does what it is
  supposed to do (i.e. sending touch positions and accelerometer data
  over the network via UDP).

  Thanks for any help.
  Regards,
  Steff

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

2009-12-01 Thread Steff
Hi

I am running monkey test on my G1 with the following coniguration set
with different seeds:

# monkey -v -v --monitor-native-crashes 10  data/monkeylog.txt

Unfortunately the crash reports are not piped to the file on the
internal file system but are for some reason displayed in the adb
shell on the PC side instead.

This would not have been a problem if it wasnt because of the fact
that the monkey sometimes disconnects USB debugging under Settings/
Applications/Development. In these cases the crash info will be lost.

Is there a way of preventing the monkey from disconnecting USB
debugging when using monkey test or is there another way to save the
crash reports on the phone?

/Steff

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

2009-10-27 Thread Steff

 Keep in mind that the
 emulator doesn't have the OpenGL hardware of an HTC handset, so it's
 not going to behave the same.

Hmmm, it shouldnt be like that. OpenGL hardware should improve
performace, but the sematics should be the same on all devices/
emulators with og without different kinds of hardware.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: White screen in my OpenGL application

2009-10-25 Thread Steff

 Do you need that pixel format so that you can draw translucently onto
 an existing background or is it for some other purpose?

The pixelformat is exactly for drawing translucently onto and existing
background.

Regards, Steff

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

2009-10-24 Thread Steff

Hi

Well I use my own GLSurfaceView:
public class GLSurfaceView extends SurfaceView implements
SurfaceHolder.Callback

I did not know that a GLSurfaceView was added to the SDK. I will
consider starting to use that, but I am pretty sure that it is not the
problem right now. Or do you think it is? Remember that my own
GLSurfaceView used to work, and it still works without
PixelFormat.RGBA_.

Regards, Per Steffensen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: White screen in my OpenGL application

2009-10-24 Thread Steff

I have tried to install the application on my HTC magic with
mGLSurfaceView.getHolder().setFormat(PixelFormat.RGBA_);. I
works perfectly. When I comment out the line the graphics looks very
strange on my HTC magic, but that is where it looks fine in the
emulator. If the emulator cannot be trusted to work as real devices,
then it is not worth much?!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] White screen in my OpenGL application

2009-10-23 Thread Steff

Hi

I've just dusted off an application I did for Android half a year ago.
I upgraded to the latest SDK and Eclipse ADT. After some struggeling I
get the application to run again. When I debug it I can see that all
the right code are executed the right way.

The application shows a OpenGL surface and animates stuff on it. It
used to work perfectly (I even have it running on my HTC Magic
device), but in the new emulator the screen is just white?!? Any
explanation?!?

Regards, Per Steffensen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: White screen in my OpenGL application

2009-10-23 Thread Steff

My app used to work in the emulation of the SDK I used to use. It was
downloaded almost a year ago. I believe it was 1.2 or something. So
the app works in 1.2 emulator AND on my 1.5 firmware HTC magic. But it
does not work on the 1.5 emulator of the 1.6 SDK downloaded today.

I dont know if my textures are a power of 2 and square?!?
I danish we have two different words for four-gons. One when all four
sides have the same length, and another when they have have the same
length two and two. I am not totally sure what square means in
english? Does it mean a four-gon where all four sides have the same
length? If yes, I dont think my textures are square, but I will find
out. If no, then how can textures not be square?

If you by are power of 2 mean that the sides must have length equal
to a power of 2, I am pretty sure that they do not. But why should
that be a problem? It wasn't before!

Regards, Per Steffensen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: White screen in my OpenGL application

2009-10-23 Thread Steff

Hi

I tried to remove all usage of texture in the app. That did not help.

Now I have narrowed it down:
My application contains this line mGLSurfaceView.getHolder().setFormat
(PixelFormat.RGBA_);. If I comment out that line, then the OpenGL
rendering works again. But I need that line, because else something
else does not work. Why will the emulator not work with
PixelFormat.RGBA_?

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

2009-01-08 Thread Steff

So whats the conclution?

Is SlideMe safe. Not as in 100% safe - that will never happen. I just
want to secure that not everyone with alittle IT knowledge and a
filebrowsing application on Android can copy my application installed
with SlideMe's SAM. You have to be in top 5% of hackers to do it, if I
should be satisfied :-)

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

2009-01-08 Thread Steff

Thats ok. My daily job is, to a high degree, to be critical about
others solutions in application development.

I will use Mogees for now. I acutally I would like to use something
else, cause Mogees requires the application to ask for different
premissions no the phone, and i fear that it will scare alot away from
even trying the app.

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

2009-01-08 Thread Steff

 For our solution, you will also need to use
 android.permission.READ_PHONE_STATE to be able to handle forward locking.
 We require this permission on SAM as well. I'm not sure if Mogees goes
 beyond this in required permissions, as it has larger scope and usage rules.

Mogees requires:
uses-permission android:name=android.permission.INTERNET /
uses-permission android:name=android.permission.READ_PHONE_STATE /
uses-permission
android:name=android.permission.ACCESS_FINE_LOCATION /

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



[android-developers] Re: Secrity with SlideMe

2009-01-08 Thread Steff

 For our solution, you will also need to use
 android.permission.READ_PHONE_STATE to be able to handle forward locking.
 We require this permission on SAM as well.

Ohhh, I was hoping that it would be enough to give SAM the permission.
Why should the installed app (my app for instance) need the permission
as well?

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

2009-01-08 Thread Steff

 Since
 the app directory is wide open, you will need to have something embedded in
 the app itself to prevent forwarding.

How can the app prevent itself form being forwarded? Why cant SAM do
that to the application after the Android installer have installede
the application for SAM.

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

2009-01-08 Thread Steff

 How can the app prevent itself form being forwarded? Why cant SAM do
 that to the application after the Android installer have installede
 the application for SAM.

I thing it would be great if SlideMe would strech to find a solution
where the apps does not need to require any permissions.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Secrity with SlideMe

2009-01-07 Thread Steff

Hi

I am thing about releasing my application on SlideMe. I have talked to
someone with SlideMe, and they tell me that priced application is just
installed on the device itself. I asked them how they prevent people
from just copying the application to another phone - for instance
using some filebrowser app for Andoid. They tell me that the
applications are stored as private and that they cannot be copied,
but I dont quit understand. Is there some feature in Android letting
applications (for instance SlideMe's SAM), copy files to the device,
files that cannot be copied, but can be loaded to run?
If yes, please direct me to some documentation/explanation of that
feature!

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

2009-01-07 Thread Steff

Apple should release an iPhone with an Android platform. Guess
not :-(
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Blending between views

2008-12-13 Thread Steff

Hi

I have a layout with two fullscreen views on top of each other. The
bottom view just shows a .png picture. The top view shows some OpenGL
rendered graphics. When some translucent objects on the top view moves
over a non-black area of the bottom view, blending is real bad
- example1: blue in bottom view and translucent yellow/red (fire) in
top view, turns out to be shiny green!?!)
- example2: gray in bottom view and translucent yellow/red (fire) in
top view, also turns out to be shiny green!?!)
How can I improve???
Blending internally in the top view (OpenGL) works fine.

Selected code:

Bottom view:
Fields
  private Bitmap mBackgroundImage;
  private SurfaceHolder mSurfaceHolder;
In view constructor:
  mSurfaceHolder = getHolder();
  mBackgroundImage = BitmapFactory.decodeResource(res,
R.drawable.mypic);
In doDraw
  Canvas c = mSurfaceHolder.lockCanvas(null);
  c.drawBitmap(mBackgroundImage, 0, 0, null);

Top view:
Fields
  EGL10 mEgl;
  EGLDisplay mEglDisplay;
  EGLSurface mEglSurface;
  EGLConfig mEglConfig;
  EGLContext mEglContext;
Initializing:
  int[] configSpec = {
EGL10.EGL_RED_SIZE,  8,
EGL10.EGL_GREEN_SIZE,8,
EGL10.EGL_BLUE_SIZE, 8,
EGL10.EGL_ALPHA_SIZE,8,
EGL10.EGL_DEPTH_SIZE,   16,
EGL10.EGL_NONE
};
  mEgl = (EGL10) EGLContext.getEGL();
  mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
  int[] version = new int[2];
  mEgl.eglInitialize(mEglDisplay, version);
  EGLConfig[] configs = new EGLConfig[1];
  int[] num_config = new int[1];
  mEgl.eglChooseConfig(mEglDisplay, configSpec, configs, 1,
num_config);
  mEglConfig = configs[0];
  mEglContext = mEgl.eglCreateContext(mEglDisplay, mEglConfig,
EGL10.EGL_NO_CONTEXT, null);
  mEglSurface = mEgl.eglCreateWindowSurface(mEglDisplay, mEglConfig,
holder, null);
  mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface,
mEglContext);
In doDraw:
   do the OpenGL drawing 
  mEgl.eglSwapBuffers(mEglDisplay, mEglSurface);




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

2008-11-27 Thread Steff

Hi

I dont know if this is the right forum, but I will try anyway.

Do any og you know if I am aloud to use the android logo (the robot
and the strange android text) on my private android-related webpage?

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



[android-developers] Emulator on webpage

2008-11-27 Thread Steff

Hi

I would like to alow people on my website to try out android
applications before download. Will I be able to make the emulator run
on my website to let users try out applications in it.
Any other solutions?

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



[android-developers] Re: OpenGL light strange behaviour

2008-10-30 Thread Steff

Hi

I found out myself that I needed to give normal-vectors to the OpenGL
engine. I went back to this question to explain what my solution was,
just to see that someone already had explained what the problem was.
Thanks anyway.

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



[android-developers] OpenGL light strange behaviour

2008-10-29 Thread Steff

Hi

I am playing with OpenGL and especially light in OpenGL. I have tried
to set light in the GLSurfaceView application in ApiDemos (Under
Graphics / OpenGL ES).

I just try to set the light as simple as I can. Therefore I just add a
few lines to CubeRenderer.drawFrase so that it looks as shown below. I
get some light effect, but it does not look like the light is
constantly comming from one direction. I looks like the light source
is also flying around. Why is that?

public void drawFrame(GL10 gl) {
/*
 * Usually, the first thing one might want to do is to clear
 * the screen. The most efficient way of doing this is to use
 * glClear().
 */

gl.glClear(GL10.GL_COLOR_BUFFER_BIT |
GL10.GL_DEPTH_BUFFER_BIT);

/*
 * Now we're ready to draw some 3D objects
 */

gl.glMatrixMode(GL10.GL_MODELVIEW);
gl.glLoadIdentity();


// Here start of lines I have added to get light
gl.glEnable(gl.GL_LIGHTING);
gl.glEnable(gl.GL_LIGHT0);

float ambientLight[] = { 0.0f, 0.0f, 0.0f, 1.0f };
float diffuseLight[] = { 1.0f, 1.0f, 1.0f, 1.0f };
float specularLight[] = { 1.0f, 1.0f, 1.0f, 1.0f };
float position[] = { 3.0f, 3.0f, 3.0f };

gl.glLightfv(gl.GL_LIGHT0, gl.GL_POSITION, position, 0);
gl.glLightfv(gl.GL_LIGHT0, gl.GL_AMBIENT, ambientLight, 0);
gl.glLightfv(gl.GL_LIGHT0, gl.GL_DIFFUSE, diffuseLight, 0);
gl.glLightfv(gl.GL_LIGHT0, gl.GL_SPECULAR, specularLight, 0);
// Here end of lines I have added to get light

gl.glTranslatef(0, 0, -3.0f);
gl.glRotatef(mAngle,0, 1, 0);
gl.glRotatef(mAngle*0.25f,  1, 0, 0);

gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl.glEnableClientState(GL10.GL_COLOR_ARRAY);

mCube.draw(gl);

gl.glRotatef(mAngle*2.0f, 0, 1, 1);
gl.glTranslatef(0.5f, 0.5f, 0.5f);

mCube.draw(gl);

mAngle += 1.2f;
}

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



[android-developers] Re: OpenGL light strange behaviour

2008-10-29 Thread Steff

I also use:
gl.glEnable(gl.GL_COLOR_MATERIAL);


On Oct 29, 6:31 pm, Steff [EMAIL PROTECTED] wrote:
 Hi

 I am playing with OpenGL and especially light in OpenGL. I have tried
 to set light in the GLSurfaceView application in ApiDemos (Under
 Graphics / OpenGL ES).

 I just try to set the light as simple as I can. Therefore I just add a
 few lines to CubeRenderer.drawFrase so that it looks as shown below. I
 get some light effect, but it does not look like the light is
 constantly comming from one direction. I looks like the light source
 is also flying around. Why is that?

     public void drawFrame(GL10 gl) {
         /*
          * Usually, the first thing one might want to do is to clear
          * the screen. The most efficient way of doing this is to use
          * glClear().
          */

         gl.glClear(GL10.GL_COLOR_BUFFER_BIT |
 GL10.GL_DEPTH_BUFFER_BIT);

         /*
          * Now we're ready to draw some 3D objects
          */

         gl.glMatrixMode(GL10.GL_MODELVIEW);
         gl.glLoadIdentity();

         // Here start of lines I have added to get light
         gl.glEnable(gl.GL_LIGHTING);
         gl.glEnable(gl.GL_LIGHT0);

         float ambientLight[] = { 0.0f, 0.0f, 0.0f, 1.0f };
         float diffuseLight[] = { 1.0f, 1.0f, 1.0f, 1.0f };
         float specularLight[] = { 1.0f, 1.0f, 1.0f, 1.0f };
         float position[] = { 3.0f, 3.0f, 3.0f };

         gl.glLightfv(gl.GL_LIGHT0, gl.GL_POSITION, position, 0);
         gl.glLightfv(gl.GL_LIGHT0, gl.GL_AMBIENT, ambientLight, 0);
         gl.glLightfv(gl.GL_LIGHT0, gl.GL_DIFFUSE, diffuseLight, 0);
         gl.glLightfv(gl.GL_LIGHT0, gl.GL_SPECULAR, specularLight, 0);
         // Here end of lines I have added to get light

         gl.glTranslatef(0, 0, -3.0f);
         gl.glRotatef(mAngle,        0, 1, 0);
         gl.glRotatef(mAngle*0.25f,  1, 0, 0);

         gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
         gl.glEnableClientState(GL10.GL_COLOR_ARRAY);

         mCube.draw(gl);

         gl.glRotatef(mAngle*2.0f, 0, 1, 1);
         gl.glTranslatef(0.5f, 0.5f, 0.5f);

         mCube.draw(gl);

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



[android-developers] OpenGL light strange behaviour

2008-10-29 Thread Steff

Hi

I am playing with OpenGL and especially light in OpenGL. I have tried
to set light in the GLSurfaceView application in ApiDemos (Under
Graphics / OpenGL ES).

I just try to set the light as simple as I can. Therefore I just add a
few lines to CubeRenderer.drawFrase so that it looks as shown below. I
get some light effect, but it does not look like the light is
constantly comming from one direction. I looks like the light source
is also flying around. Why is that?

public void drawFrame(GL10 gl) {
/*
 * Usually, the first thing one might want to do is to clear
 * the screen. The most efficient way of doing this is to use
 * glClear().
 */

gl.glClear(GL10.GL_COLOR_BUFFER_BIT |
GL10.GL_DEPTH_BUFFER_BIT);

/*
 * Now we're ready to draw some 3D objects
 */

gl.glMatrixMode(GL10.GL_MODELVIEW);
gl.glLoadIdentity();


// Here start of lines I have added to get light
gl.glEnable(gl.GL_LIGHTING);
gl.glEnable(gl.GL_LIGHT0);

float ambientLight[] = { 0.0f, 0.0f, 0.0f, 1.0f };
float diffuseLight[] = { 1.0f, 1.0f, 1.0f, 1.0f };
float specularLight[] = { 1.0f, 1.0f, 1.0f, 1.0f };
float position[] = { 3.0f, 3.0f, 3.0f };

gl.glLightfv(gl.GL_LIGHT0, gl.GL_POSITION, position, 0);
gl.glLightfv(gl.GL_LIGHT0, gl.GL_AMBIENT, ambientLight, 0);
gl.glLightfv(gl.GL_LIGHT0, gl.GL_DIFFUSE, diffuseLight, 0);
gl.glLightfv(gl.GL_LIGHT0, gl.GL_SPECULAR, specularLight, 0);
// Here end of lines I have added to get light

gl.glTranslatef(0, 0, -3.0f);
gl.glRotatef(mAngle,0, 1, 0);
gl.glRotatef(mAngle*0.25f,  1, 0, 0);

gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl.glEnableClientState(GL10.GL_COLOR_ARRAY);

mCube.draw(gl);

gl.glRotatef(mAngle*2.0f, 0, 1, 1);
gl.glTranslatef(0.5f, 0.5f, 0.5f);

mCube.draw(gl);

mAngle += 1.2f;
}

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



[android-developers] More highlevel 3D development

2008-10-27 Thread Steff

Hi

As I understand it, the only 3D graphics related thing that comes with
Android, is the raw OpenGL ES.

I would like to work with my 3D applications for Android at a little
higher level. For instance I would like to have a GLUT layer ontop of
OpenGL ES. Does anyone know if that is possible? If someone have done
it?

If GLUT is not possible, what is then used out there? What is the best
way (in your opinion) to effeciently devoplor 3D apps for Android.

Thanks

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



[android-developers] GLUT or something like that in Android

2008-10-27 Thread Steff

Hi

Android ships with en OpenGL ES implementation. OpenGL ES is alittle
low-level.

I would like to be able to use some more high-level 3D tool. I have
some expirence with GLUT.
Has anyone been successfull using/converting GLUT to java/Android?
Can anyone tell me what layer above OpenGL ES is the state-of-art og
defacto-standard when you want to do 3D graphics on Android.
Any comment is welcome.

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