[android-developers] What's the best place to find Android Developers willing to participate in a Startup?

2012-08-06 Thread Bart Burg
I'm looking for someone that would like to build an Android product together 
with me, and bring that product on the market. What would be the best place to 
look for Android Developers that also have affinity in entrepreneurship? 

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

2011-08-16 Thread Bart
Hi,

The battery usage stats in Android are great, but it would be even
more usefull if I would be able to see the average battery usage an
hour for each app.
Now you can use an app the whole day and for example use 30% of your
battery. If you call for half an hour and use 20% of your battery, it
looks like the app you used the whole day is less battery efficient
than calling.
So it would be very usefull to have an average battery usage an hour
for each app added to the battery usage stats. This would help finding
what drains your battery the fastest.

Thanks for looking at this request!
Bart Tiemersma

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Racoon is not initiating a connection with x509 L2TP/IPSec

2011-04-08 Thread Bart
Hello all,

I am trying to setup a VPN connection on Android v2.2.2. I am
currently unable to connect to my VPN server.

The VPN server is Openswan which is running with xl2tpd. I am using X.
509 certificates to identify clients.

Android does not seem to initiate a connection to the VPN server, the
logs on the server show no entries of any clients connecting. This
setup works on my telephone when running windows mobile 6.5, or when
connecting with computers running windows or OSX.

The logs from android show that racoon is not able to create a key
socket.

Can anyone please point me in the right direction to solve this
problem?

Greetings,

Bart

The logs below are from android:


I/ActivityManager( 1331): Starting activity: Intent
{ act=android.intent.action.MAIN
cmp=com.android.settings/.vpn.VpnSettings }
D/VpnManager( 1409): succeeded to connect to VPN service
D/VpnSettings( 1409): received connectivity: 129.125.102.34:
connected? IDLE   err=0
I/ActivityManager( 1331): Displayed activity
com.android.settings/.vpn.VpnSettings: 480 ms (total 480 ms)
I/keystore( 1315): uid: 1000 action: t - 1 state: 1 - 1 retry: 4
I/keystore( 1315): uid: 1000 action: e - 1 state: 1 - 1 retry: 4
I/keystore( 1315): uid: 1000 action: e - 1 state: 1 - 1 retry: 4
D/dalvikvm( 1649): GC_EXPLICIT freed 3326 objects / 192224 bytes in
130ms
D/VpnManager( 1409): succeeded to connect to VPN service
D/com.android.settings.vpn.AuthenticationActor( 1409): ~~
connect() succeeded!
I/SProxy_mtpd( 1734): Stop VPN daemon: mtpd
D/SProxy_mtpd( 1734): mtpd is stopped after 0 msec
D/SProxy_mtpd( 1734): stopping mtpd, success? true
I/SProxy_racoon( 1734): Stop VPN daemon: racoon
D/SProxy_racoon( 1734): racoon is stopped after 0 msec
D/SProxy_racoon( 1734): stopping racoon, success? true
D/VpnService( 1734):   Local IP: 10.15.104.141, if: ppp0
D/VpnService( 1734):VPN UP: down
I/SProxy_racoon( 1734): Start VPN daemon: racoon
D/VpnSettings( 1409): received connectivity: 129.125.102.34:
connected? CONNECTING   err=0
D/SProxy_racoon( 1734): racoon is running after 200 msec
D/SProxy_racoon( 1734): service not yet listen()ing; try again
D/dalvikvm( 1396): GC_EXTERNAL_ALLOC freed 2710 objects / 121312 bytes
in 100ms
D/racoon  ( 2025): Waiting for control socket
D/racoon  ( 2025): Received 5 arguments
E/racoon  ( 2025): Cannot create KEY socket
I/SProxy_racoon( 1734): got data from control socket: -1
E/VpnService( 1734): onError()
E/VpnService( 1734): java.io.IOException: socket error, result from
service: -1
E/VpnService( 1734): at
com.android.server.vpn.DaemonProxy.sendCommand(DaemonProxy.java:89)
E/VpnService( 1734): at
com.android.server.vpn.VpnDaemons.startIpsecForL2tp(VpnDaemons.java:
70)
E/VpnService( 1734): at
com.android.server.vpn.L2tpIpsecService.connect(L2tpIpsecService.java:
37)
E/VpnService( 1734): at
com.android.server.vpn.VpnService.onConnect(VpnService.java:135)
E/VpnService( 1734): at com.android.server.vpn.VpnServiceBinder
$2.run(VpnServiceBinder.java:114)
E/VpnService( 1734): at java.lang.Thread.run(Thread.java:1096)
I/VpnService( 1734): disconnecting VPN...
D/VpnSettings( 1409): received connectivity: 129.125.102.34:
connected? DISCONNECTING   err=0
I/SProxy_mtpd( 1734): Stop VPN daemon: mtpd
D/SProxy_mtpd( 1734): mtpd is stopped after 0 msec
D/SProxy_mtpd( 1734): stopping mtpd, success? true
I/SProxy_racoon( 1734): Stop VPN daemon: racoon
D/SProxy_racoon( 1734): racoon is stopped after 0 msec
D/SProxy_racoon( 1734): stopping racoon, success? true
D/VpnService( 1734): onFinalCleanUp()
I/VpnService( 1734): restore original suffices -- null
D/VpnSettings( 1409): received connectivity: 129.125.102.34:
connected? IDLE   err=101
D/VpnSettings( 1409): create reconnect dialog for event 101
E/Tethering( 1331): attempting to remove unknown iface (usb0),
ignoring
E/Tethering( 1331): attempting to remove unknown iface (usb0),
ignoring
D/VpnSettings( 1409):onIdle()

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

2011-03-07 Thread Bart
I searched but could not find info about this:

Situation:

1. GL used + Looping sounds (soundpool)
2. want to prevent leaving user to reboot to get rid of looping sound
in case of app error.

In onDrawFrame, a try-catch block catches exceptions, and stops the
sounds.
So-far, so-good.

But: cant rethrow exception (cant change GLSurfaceView.Renderer
prototype).

Therefore, can't propagate exception to OS, disabling the ability to
get stack traces from users by means of the developer console.

Result: sound stops, but UI thread happily runs (and depending on the
exception the render thread as well).

This is a serious issue: either I cant get stacktraces, or leave users
of the app with looping sounds which ia (a) annoying to reboot, (b)
drains battery.

Anyone know a way around this (besides not getting exceptions...).

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: Text in a circle that rotates on touch

2010-03-06 Thread Bart
Thanks alot. I sort of had it working yesterday, but I think my math
was a little off, which caused some strange behavior. So I will try
your code.


On 5 mrt, 22:56, Nathan nathan.d.mel...@gmail.com wrote:
 On Mar 5, 3:25 am, Bart bvandep...@gmail.com wrote:

  Hi, I'd like to display a given String in a circle (so bend the string
  so that the end of the string touches the beginning of the string).
  And Then I'd like to let the userrotatethe circle by grabbing and
  dragging it clockwise or counterclockwise.
  Do you guys know what would be the best (simplest, smoothest) way to
  do this? I already saw that using drawOnPath i can drawtextin a
  circle. Do you have any tips on how to proceed with dragging and
  rotating the textcircle?

 I've done this, and as mentioned, Canvas.translate and canvas.rotate
 are the way to go.

 If you are just using a hold and drag, you wouldn't have to worry so
 much about angular velocity. Code like this would work:

         @Override
         public boolean onTouchEvent(MotionEvent e) {
         float x = e.getX();
         float y = e.getY();
         switch (e.getAction()) {
         case MotionEvent.ACTION_MOVE:
             //find an approximate angle between them.

                 float dx = x-cx;
             float dy = y-cy;
             double a=Math.atan2(dy,dx);

             float dpx= mPreviousX-cx;
             float dpy= mPreviousY-cy;
             double b=Math.atan2(dpy, dpx);

             double diff  = a-b;
             this.bearing -= Math.toDegrees(diff);
             this.invalidate();
         }
         mPreviousX = x;
         mPreviousY = y;
         return true;
         }

 Nathan

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


[android-developers] Re: Text in a circle that rotates on touch

2010-03-06 Thread Bart
I tested it and it works like a charm :)
I only had to change the -= in this.bearing -= Math.toDegrees(diff)
to +=, otherwise the rotation was inverted.

How do you do the rotation exactly? If I just draw the text onto the
canvas in onDraw(Canvas canvas), and then call canvas.rotate,  then
nothing seems to happen. But if i do canvas.drawBitmap(bitmap,
matrix,paint) where matrix is a rotation matrix, then it does work.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Failed binder transaction when passing byte[] (from camera) between intents

2010-02-17 Thread Bart
So I can never make camera images that are higher resolution then
277x184? :S
If I stuff all the camera code into my main activity, then it should
work. But that's a little messy. Are you sure there isn't another way
to pass the camera images?

Thanks


On Feb 16, 10:05 pm, Streets Of Boston flyingdutc...@gmail.com
wrote:
 Binary data works upto about 100KByte. Anything larger, you very
 likely get that error.

 For images in RGB_565, this is about 277 x 184 pixels max (277 x 184 *
 2 = 101936)

 On Feb 16, 4:17 am, Bart bvandep...@gmail.com wrote:

  Hi, I have a problem with an app that lets the user take a picture.
  I've posted it on some forums already, but nobody seems to recognize
  the problem. Hopefully someone here knows a solution :)

  I've put the code of taking a picture in a seperate activity. Then I
  call the camera intent from my main activity using activityForResult.
  In the camera intent, I use putExtra to return the camera image (as a
  byte[] without doing anything to it). But when the program transitions
  back from the camera intent to the parent intent that called it I get
  aFailedBinderTransaction error in the logcat because the byte[] is
  too big. But I don't understand this, because the image is not even
  taken using the maximum resolution :S

  The code of my camera intent is:

  package example.imaging.ape;

  import java.io.IOException;
  import java.util.Iterator;
  import java.util.Set;

  import android.app.Activity;
  import android.content.Intent;
  import android.graphics.Bitmap;
  import android.graphics.BitmapFactory;
  import android.graphics.PixelFormat;
  import android.hardware.Camera;
  import android.hardware.Camera.AutoFocusCallback;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.MotionEvent;
  import android.view.SurfaceHolder;
  import android.view.SurfaceView;
  import android.view.View;
  import android.view.Window;
  import android.view.WindowManager;
  import android.view.View.OnTouchListener;

  public class TakePicture extends Activity implements
  SurfaceHolder.Callback{
       Camera mCamera;
       Boolean mPreviewRunning = false;
       int imageLayoutHeight;
       int imageLayoutWidth;

      �...@override
       public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);

            //setup camera surface
            getWindow().setFormat(PixelFormat.TRANSLUCENT);
            requestWindowFeature(Window.FEATURE_NO_TITLE);

  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
  WindowManager.LayoutParams.FLAG_FULLSCREEN);
            setContentView(R.layout.cameralayout);

            SurfaceView mSurfaceView = (SurfaceView)
  findViewById(R.id.hist_surface_camera);
            SurfaceHolder mSurfaceHolder = mSurfaceView.getHolder();
            mSurfaceHolder.addCallback(this);

  mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
            Bundle extras = getIntent().getExtras();
            imageLayoutHeight = extras.getInt(layoutHeight);
            imageLayoutWidth = extras.getInt(layoutWidth);

            OnTouchListener touchListener = new View.OnTouchListener() {
                 public boolean onTouch(View v, MotionEvent e) {

                      System.out.println(MAKING PICTURE);
                      mCamera.autoFocus(cb);
                      return false;
                 }
            };

            //setup touch listener
            mSurfaceView.setOnTouchListener(touchListener);

       }

       AutoFocusCallback cb = new AutoFocusCallback() {
            public void onAutoFocus(boolean success, Camera c) {
                 c.takePicture(null, null, mPictureCallback);
            }
       };

       Camera.PictureCallback mPictureCallback = new
  Camera.PictureCallback() {
            public void onPictureTaken(byte[] imageData, Camera c) {
                 System.out.println(Picture taken, now
  returning);
                 Intent resultIntent = new Intent();
                 resultIntent.putExtra(cameraImage, imageData);
                 System.out.println(put Extra);
                 setResult(Activity.RESULT_OK, resultIntent);
                 finish();
            }
       };

       //initialize camera
       public void surfaceCreated(SurfaceHolder holder) {
            mCamera = Camera.open();
       }

       public void surfaceChanged(SurfaceHolder holder, int format, int
  w, int h) {
            if (mPreviewRunning) {
                 mCamera.stopPreview();
            }

            Camera.Parameters p = mCamera.getParameters();

            p.setPreviewSize(h, w);
            System.out.println(PreviewSize:  + h + , + w);
            p.setPictureSize(h*3,w*3); // is around 1200x900
            p.set(rotation, 90);
            mCamera.setParameters(p);

            try {
                 mCamera.setPreviewDisplay(holder);
            } catch (IOException e) {
                 e.printStackTrace

[android-developers] Re: Failed binder transaction when passing byte[] (from camera) between intents

2010-02-17 Thread Bart
Thanks, that seems to work :)

On Feb 17, 4:24 pm, Streets Of Boston flyingdutc...@gmail.com wrote:
 In onPictureTaken, save the camera to a file and insert into the media
 content provider.
 Then, when the image has been inserted, instead of sending the raw
 binary data of the bitmap, send back the content-Uri of the image you
 took.

 On Feb 17, 3:07 am, Bart bvandep...@gmail.com wrote:

  So I can never make camera images that are higher resolution then
  277x184? :S
  If I stuff all the camera code into my main activity, then it should
  work. But that's a little messy. Are you sure there isn't another way
  to pass the camera images?

  Thanks

  On Feb 16, 10:05 pm, Streets Of Boston flyingdutc...@gmail.com
  wrote:

   Binary data works upto about 100KByte. Anything larger, you very
   likely get that error.

   For images in RGB_565, this is about 277 x 184 pixels max (277 x 184 *
   2 = 101936)

   On Feb 16, 4:17 am, Bart bvandep...@gmail.com wrote:

Hi, I have a problem with an app that lets the user take a picture.
I've posted it on some forums already, but nobody seems to recognize
the problem. Hopefully someone here knows a solution :)

I've put the code of taking a picture in a seperate activity. Then I
call the camera intent from my main activity using activityForResult.
In the camera intent, I use putExtra to return the camera image (as a
byte[] without doing anything to it). But when the program transitions
back from the camera intent to the parent intent that called it I get
aFailedBinderTransaction error in the logcat because the byte[] is
too big. But I don't understand this, because the image is not even
taken using the maximum resolution :S

The code of my camera intent is:

package example.imaging.ape;

import java.io.IOException;
import java.util.Iterator;
import java.util.Set;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.PixelFormat;
import android.hardware.Camera;
import android.hardware.Camera.AutoFocusCallback;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.OnTouchListener;

public class TakePicture extends Activity implements
SurfaceHolder.Callback{
     Camera mCamera;
     Boolean mPreviewRunning = false;
     int imageLayoutHeight;
     int imageLayoutWidth;

    �...@override
     public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);

          //setup camera surface
          getWindow().setFormat(PixelFormat.TRANSLUCENT);
          requestWindowFeature(Window.FEATURE_NO_TITLE);

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
          setContentView(R.layout.cameralayout);

          SurfaceView mSurfaceView = (SurfaceView)
findViewById(R.id.hist_surface_camera);
          SurfaceHolder mSurfaceHolder = mSurfaceView.getHolder();
          mSurfaceHolder.addCallback(this);

mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
          Bundle extras = getIntent().getExtras();
          imageLayoutHeight = extras.getInt(layoutHeight);
          imageLayoutWidth = extras.getInt(layoutWidth);

          OnTouchListener touchListener = new View.OnTouchListener() {
               public boolean onTouch(View v, MotionEvent e) {

                    System.out.println(MAKING PICTURE);
                    mCamera.autoFocus(cb);
                    return false;
               }
          };

          //setup touch listener
          mSurfaceView.setOnTouchListener(touchListener);

     }

     AutoFocusCallback cb = new AutoFocusCallback() {
          public void onAutoFocus(boolean success, Camera c) {
               c.takePicture(null, null, mPictureCallback);
          }
     };

     Camera.PictureCallback mPictureCallback = new
Camera.PictureCallback() {
          public void onPictureTaken(byte[] imageData, Camera c) {
               System.out.println(Picture taken, now
returning);
               Intent resultIntent = new Intent();
               resultIntent.putExtra(cameraImage, imageData);
               System.out.println(put Extra);
               setResult(Activity.RESULT_OK, resultIntent);
               finish();
          }
     };

     //initialize camera
     public void surfaceCreated(SurfaceHolder holder) {
          mCamera = Camera.open();
     }

     public void

[android-developers] FaceDetector class

2010-02-17 Thread Bart
Hi, I want to use the FaceDetector class, which also has a pose
function for the headpose, but it seems that the head pose is not
implemented because it always returns 0.
It does return the distance between the eyes, and the point between
the two eyes, so im guessing that at some point in the face detection,
the coordinates of the eyes are known. So i'm now checking out the
source code to see if i can output the eye coordinates myself, but it
seems that the actual face detection is done by calling a seperate
function called ff_detect for which i cannot find any code.

Do you guys know how i can get this code, or how i can get the head
pose otherwise?

Thanks very 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] Failed binder transaction when passing byte[] (from camera) between intents

2010-02-16 Thread Bart
Hi, I have a problem with an app that lets the user take a picture.
I've posted it on some forums already, but nobody seems to recognize
the problem. Hopefully someone here knows a solution :)

I've put the code of taking a picture in a seperate activity. Then I
call the camera intent from my main activity using activityForResult.
In the camera intent, I use putExtra to return the camera image (as a
byte[] without doing anything to it). But when the program transitions
back from the camera intent to the parent intent that called it I get
a Failed Binder Transaction error in the logcat because the byte[] is
too big. But I don't understand this, because the image is not even
taken using the maximum resolution :S

The code of my camera intent is:

package example.imaging.ape;

import java.io.IOException;
import java.util.Iterator;
import java.util.Set;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.PixelFormat;
import android.hardware.Camera;
import android.hardware.Camera.AutoFocusCallback;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.OnTouchListener;

public class TakePicture extends Activity implements
SurfaceHolder.Callback{
 Camera mCamera;
 Boolean mPreviewRunning = false;
 int imageLayoutHeight;
 int imageLayoutWidth;

 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  //setup camera surface
  getWindow().setFormat(PixelFormat.TRANSLUCENT);
  requestWindowFeature(Window.FEATURE_NO_TITLE);
 
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
  setContentView(R.layout.cameralayout);

  SurfaceView mSurfaceView = (SurfaceView)
findViewById(R.id.hist_surface_camera);
  SurfaceHolder mSurfaceHolder = mSurfaceView.getHolder();
  mSurfaceHolder.addCallback(this);
 
mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
  Bundle extras = getIntent().getExtras();
  imageLayoutHeight = extras.getInt(layoutHeight);
  imageLayoutWidth = extras.getInt(layoutWidth);

  OnTouchListener touchListener = new View.OnTouchListener() {
   public boolean onTouch(View v, MotionEvent e) {

System.out.println(MAKING PICTURE);
mCamera.autoFocus(cb);
return false;
   }
  };

  //setup touch listener
  mSurfaceView.setOnTouchListener(touchListener);

 }

 AutoFocusCallback cb = new AutoFocusCallback() {
  public void onAutoFocus(boolean success, Camera c) {
   c.takePicture(null, null, mPictureCallback);
  }
 };

 Camera.PictureCallback mPictureCallback = new
Camera.PictureCallback() {
  public void onPictureTaken(byte[] imageData, Camera c) {
   System.out.println(Picture taken, now
returning);
   Intent resultIntent = new Intent();
   resultIntent.putExtra(cameraImage, imageData);
   System.out.println(put Extra);
   setResult(Activity.RESULT_OK, resultIntent);
   finish();
  }
 };

 //initialize camera
 public void surfaceCreated(SurfaceHolder holder) {
  mCamera = Camera.open();
 }

 public void surfaceChanged(SurfaceHolder holder, int format, int
w, int h) {
  if (mPreviewRunning) {
   mCamera.stopPreview();
  }

  Camera.Parameters p = mCamera.getParameters();

  p.setPreviewSize(h, w);
  System.out.println(PreviewSize:  + h + , + w);
  p.setPictureSize(h*3,w*3); // is around 1200x900
  p.set(rotation, 90);
  mCamera.setParameters(p);

  try {
   mCamera.setPreviewDisplay(holder);
  } catch (IOException e) {
   e.printStackTrace();
  }

  mCamera.startPreview();
  mPreviewRunning = true;
 }

 public void surfaceDestroyed(SurfaceHolder holder) {
  mCamera.stopPreview();
  mPreviewRunning = false;
  mCamera.release();
 }

}

And this is how I call the camera activity:

Intent intent = new Intent(mainActivity.this, TakePicture.class);
intent.putExtra(layoutWidth,layoutWidth);
intent.putExtra(layoutHeight,layoutHeight);
startActivityForResult(intent,0);

The onActivityResult is never reached because the error occurs during
the transition between intents.

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

[android-developers] modify active intentfilter

2009-10-20 Thread Bart van Wissen

Let's say that I have a BroadcastReceiver that has already been
registered, and I want to change its IntentFilter at that moment (add
a new data authority for example). Is this at all possible?
Or do I have to unregister it first, and then re-register it with the
updated IntentFilter?


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

2009-09-10 Thread Bart van Wissen

I would like to detect shake movement in a service that is running in
the background, even when the phone is not currently being used.
Is it true that the only way to do this is to hold a wake lock? I
suppose this would consume a lot of energy and drain the battery very
fast.

Is there no way to wake up the phone whenever a shake movement occurs?
Maybe with the native sdk? I would imagine the accelerometer causing
some kind of interrupt.

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] running emulator on a remote machine

2009-09-08 Thread Bart van Wissen

Is there any way to connect the debugger to an emulator running on a
remote machine?
It's using TCP so I suppose it shouldn't be too difficult, but I can't
figure out how.

I would like to run the emulator on my (fast) laptop and do my coding
on my (slow, but with bigger screen) desktop machine.



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

2009-09-08 Thread Bart van Wissen

I'm sorry, I don't understand.
I would like the emulator running on the laptop to show up in the list
of devices in DDMS on my desktop, and receive its logcat output, etc.
How could I use NFS for that?

On 9 sep, 01:01, Roman ( T-Mobile USA) roman.baumgaert...@t-
mobile.com wrote:
 If your systems support NFS then start the emulator remotely over NFS.

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

 On Sep 8, 2:38 pm, Bart van Wissen bartvanwis...@gmail.com wrote:

  Is there any way to connect the debugger to an emulator running on a
  remote machine?
  It's using TCP so I suppose it shouldn't be too difficult, but I can't
  figure out how.

  I would like to run the emulator on my (fast) laptop and do my coding
  on my (slow, but with bigger screen) desktop machine.


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



[android-developers] Re: how to make sound hz?

2009-09-01 Thread Bart van Wissen


On 1 sep, 10:01, guruk ilovesi...@gmail.com wrote:
 thanks for all comments.
 does anyone have a simple source demo.
 I could try that
 buffer[i] = (short) ( Math.sin((2. * Math.PI * i * f) / samplerate) *
 Short.MAX_VALUE )
 ... and what afterwards, how to play it?

 I am just wondering ( please i am a total newbie in sound)
 when I fill always a buffer like above... how long is that sound??

That depends on how many samples you write. The AudioTrack object
plays samples at a certain rate, for example 22050 Hz. To create a 1
second tone, you would thus have to write 22050 samples.

I am not familiar with android's AudioTrack interface, but I'm sure
the reference manual will help you there. I suppose when you call play
() it will start playing as soon as you write enough data to it with
write(). So you can generate the tone while it's playing.

It's not a completely trivial subject as you have to get into how
digital audio actually works, so if you're completely new to that you
might want to try to find some kind of library to help you out.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Constructor problem

2009-08-31 Thread Bart van Wissen

The problem is that renvoi_liste_recette_xml() throws an Exception
(you shouldn't do this - either make it more specific or catch the
exception within the method) and the initialization section of your
Activity cannot handle this, because the constructor of Activity
doesn't throw Exception.

Move the initialization of your member variables to (a try/catch block
within) the onCreate callback.


On 31 aug, 15:07, sweet junkybr...@gmail.com wrote:
 Eclipse say that for the line:
 ArrayList listeRecette = renvoi_liste_recette_xml();
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: how to make sound hz?

2009-08-31 Thread Bart van Wissen

You will have to create the wave data yourself using a sine-function.
Fill a buffer of shorts (for 16 bit audio) with something like this:

buffer[i] = (short) (Math.sin(((double) i / samplerate) * f) *
Short.MAX_VALUE);

(please correct me if I'm wrong)

If you need a 5 seconds tone, I suppose you could just fill a buffer
of size 5 * samplerate, but you could also try something smart with a
loop and repeatedly feed the same buffer to the AudioTrack object.
Just be aware of rounding errors and aliasing.



On 31 aug, 20:28, Eduardo Aquiles dudu...@gmail.com wrote:
 You could use AudioTrack. But you will need to create the data to send
 to it.

 On Aug 31, 2:19 pm, guruk ilovesi...@gmail.com wrote:

  sorry i just dont find that simple thing.
  how to create a tone lets say 10khz / 5 secs

  something like that,, just play a individual created sound, not
  playing a mpg or so?

  any example will be helpful

  thx
  chri


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



[android-developers] Re: how to make sound hz?

2009-08-31 Thread Bart van Wissen

I'm sorry, the formula is wrong.
I think it's

buffer[i] = (short) ( Math.sin((2. * Math.PI * i * f) / samplerate) *
Short.MAX_VALUE )

But I'm not sure. I guess 3 AM is not the time to think about this.
Anyway it should give you an idea of how to do it.

On 1 sep, 02:23, Bart van Wissen bartvanwis...@gmail.com wrote:
 You will have to create the wave data yourself using a sine-function.
 Fill a buffer of shorts (for 16 bit audio) with something like this:

 buffer[i] = (short) (Math.sin(((double) i / samplerate) * f) *
 Short.MAX_VALUE);

 (please correct me if I'm wrong)

 If you need a 5 seconds tone, I suppose you could just fill a buffer
 of size 5 * samplerate, but you could also try something smart with a
 loop and repeatedly feed the same buffer to the AudioTrack object.
 Just be aware of rounding errors and aliasing.

 On 31 aug, 20:28, Eduardo Aquiles dudu...@gmail.com wrote:

  You could use AudioTrack. But you will need to create the data to send
  to it.

  On Aug 31, 2:19 pm, guruk ilovesi...@gmail.com wrote:

   sorry i just dont find that simple thing.
   how to create a tone lets say 10khz / 5 secs

   something like that,, just play a individual created sound, not
   playing a mpg or so?

   any example will be helpful

   thx
   chri


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

2009-08-10 Thread Bart van Wissen

I have a parcelable class whose writeToParcel() method puts some data
in a Bundle and writes it to the parcel.
This parcel gets sent from a client process to a service process.

At the side of the service, the readFromparcel() method tries to read
this Bundle from the parcel. A strange thing happens here.

First of all, I got a ClassNotFoundException for one of the objects
inside the Bundle. I fixed this by using readBundle(this.getClass
().getClassloader()) to force it to use the application's
classloader.

After this, I no longer got the ClassNotFoundException, but I did get
a different bundle, containing only the following entry:
mParcelledData.dataSize=376

This is not what's supposed to be in the bundle.

In the sourcecode Parcel.java I see this, in the readBundle
(Classloader) method:

final Bundle bundle = new Bundle(this, length);
if (loader != null) {
  bundle.setClassLoader(loader);
}


So the classloader is set after reading the bundle, instead of before.
Shouldn't that be the other way around?


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

2009-08-10 Thread Bart van Wissen

I noticed that the mParcelledData thing was the result of
Bundle.toString() when the Bundle hasn't been unparcelled yet, so I
decided to stick in a bundle.containsKey(something) before I printed
the toString to force it to unparcel first, but then I got a
NullPointerException. And I did check if bundle was not null.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] referencing projects in eclipse

2009-07-27 Thread Bart van Wissen

I'm working on two projects. One is essentially a library, and the
other is an application using that library.
Now from the application project, I want to use the library's classes,
so I added that project to the required projects under java build
path.
It seems to compile fine, but at runtime, I get this error:

07-27 11:26:57.037: ERROR/dalvikvm(741): Could not find class
'interdroid.contextframework.ContextManager', referenced from method
com.bartvanwissen.contextframeworktest.MainActivity.onCreate

Apparently, the library project's classes are not added to the apk
file. How can I make sure they are included? Is this at all possible?

Since I'm working on both projects at the same time, I would like to
prevent having to create a jar file every time I want to test
something.


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

2009-07-25 Thread Bart van Wissen

I'm building a service that sends a broadcast intent when some value
changes.
The service sends the broadcast like this:

Intent broadcastIntent = new Intent();
broadcastIntent.setAction(nl.vu.contextframework.NEWREADING);
broadcastIntent.setData(Uri.parse(context://+cer.getKey()));
broadcastIntent.putExtra(reading,cer);
broadcastIntent.addCategory(nl.vu.contextframework.CONTEXT);
sendBroadcast(broadcastIntent);


In some Activity (in a different process), I'm tryint to receive this
broadcast as follows:


IntentFilter intentFilter = new IntentFilter();
intentFilter.addDataScheme(context);
intentFilter.addCategory(CATEGORY_CONTEXT);

registerReceiver(new BroadcastReceiver() {
  public void onReceive(Context context, Intent intent) {
Log.d(TAG,Received intent +intent);
  }
}, intentFilter);


The intent is never received though. What am I doing wrong? Does my
intentfilter not match the intent?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: sending / receiving custom broadcast intent

2009-07-25 Thread Bart van Wissen

On 25 jul, 14:00, Mark Murphy mmur...@commonsware.com wrote:
  Could it be that I'm using a non-existent scheme?
  I invented context:// myself, maybe this is not a good idea?

 In theory that should work, though I haven't tried it myself.

 I take an Occam's Razor approach to intents and filters: they should be as
 simple as possible, but no simpler.

 In your case, unless you are creating a content provider, I don't know the
 value of your inventing schemes and using setData(). Just put the values
 you need in the extras and filter on your action.


I'm using the data because it allows me to receive only updates to
specific keys by including them in the IntentFilter. Many of these
intents may be fired and different applications may want to filter
most of them out.

Anyway, just to see if it helps, I tried not using the data and
putting everything in the extras:

Intent broadcastIntent = new Intent();
broadcastIntent.setAction(nl.vu.contextframework.NEWREADING);
broadcastIntent.putExtra(reading,cer);
broadcastIntent.putExtra(key, cer.getKey());
broadcastIntent.addCategory(nl.vu.contextframework.CONTEXT);
sendBroadcast(broadcastIntent);


and in the activity:

IntentFilter intentFilter = new IntentFilter();
intentFilter.addCategory(CATEGORY_CONTEXT);
registerReceiver(new BroadcastReceiver() {
  public void onReceive(Context context, Intent intent) {
Log.d(TAG,Received intent +intent);
  }
}, intentFilter);


But I'm still not receiving anything.

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

2009-07-22 Thread Bart van Wissen

I'm writing a program that uses a LocationListener to listen for
location updates.
I'm playing a GPX file that I recorded, which contains a route. I know
for sure that this file is correct.
My program seems to only receive 1 location update, and then nothing.
I have both minimum time and distance set to 0.
I thought it may be a bug in my own program, so I decided to test the
same GPX file with google maps. In google maps, I don't see 'my
location'  moving. However, when I switch to the home screen and back,
my location is updated.
It seems that the last known location is fetched correctly, but
realtime updates are not coming through.

Is this a known problem?

I'm working on a Windows Vista 32 bit system with Android SDK 1.5 r3
My number format settings are set to English. (I know this is required
to send mock locations from DDMS).


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Tree of parcelables: Class not found when unmarshalling

2009-07-21 Thread Bart van Wissen

So should I submit this as a bug?


On 20 jul, 13:07, Bart van Wissen bartvanwis...@gmail.com wrote:
 I'm using a tree structure in my application, which has to be passed
 to a service. All nodes in the tree are of the type ExpressionTree,
 which is an interface.
 All nodes are also Parcelable.

 Now in my setup I have these types (all implement ExpressionTree and
 Parcelable):
 - ExpressionTreeRoot, a class with a reference to an ExpressionTree.
 - AndTree, a class with two ExpressionTree references.
 - StringCondition, a leafnode in the tree

 Now I'm passing a tree with an ExpressionTreeRoot referencing an
 AndTree referencing two StringConditions to a service, running in
 another process.

 ExpressionTreeRoot - AndTree - 2 StringConditions
 The parcel that is sent to the service is thus a flattened version of
 this tree, containing 3 parcels.

 When unmarshalling, the service process throws a
 ClassNotFoundException:

 07-20 10:44:16.431: ERROR/Parcel(1355): Class not found when
 unmarshalling: nl.vu.contextframework.conditions.AndTree, e:
 java.lang.ClassNotFoundException:
 nl.vu.contextframework.conditions.AndTree

 I can see in my log output that ExpressionTreeRoot.readFromParcel() is
 called, which in its turn calls parcel.readFromParcel to read the
 included parcel, which is in this case a parceled AndTree. This is
 where the ClassNotFoundException is thrown.
 The parcel seems to be reading the class type correctly from the
 parcel,  otherwise it wouldn't be printing the name
 nl.vu.contextframework.conditions.AndTree. But somehow it is unable
 to find this class, even though I'm sure it exists.

 Can anyone tell me what's going on, or give me some tips on how to
 investigate further?
 I'm using the default classloader by the way.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Tree of parcelables: Class not found when unmarshalling

2009-07-21 Thread Bart van Wissen

On 21 jul, 11:13, Dianne Hackborn hack...@android.com wrote:
 There isn't enough information here to know if it is a bug in the
 platform...  off-hand, I would guess not, since most of the logic in
 marshalling/unmarshalling such things needs to be written by the developer
 and doesn't come from the platform.  Plus there isn't a
 Parcel.readFromParcel() method so it is even harder to tell...  if this is
 actually Parcel.readParcelable(), you need to make sure you are using the
 class loader for -your- app, which is the one that knows about your class
 loader.  The system class loader only knows about the core framework
 classes.

Thank you.
Yes, I meant readParcelable(), sorry about that.
I guess I need to pass the right classloader then. I thought that
'default' meant the classloader for my app.



 That all side, a possibly larger question is...  do you need to do this at
 all?  If the service is not explicitly running in its own process but just
 in the normal same process as the rest of the app, there is no reason to use
 aidl at all.  If it has been set up to run in another process, is there
 really a good reason to do this instead of just using the much simpler (and
 usually more efficient) approach of running locally?



It's necessary, because it is a service that communicates with a
number of applications simultaneously.
Also note that passing this tree is not something that needs to be
done a lot of times, usually just once for an application, so it's not
really an issue if it's an expensive operation.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Tree of parcelables: Class not found when unmarshalling

2009-07-21 Thread Bart van Wissen

Alright, I fixed it by changing

tree = parcel.readParcelable(null);

into

tree = parcel.readParcelable(getClass().getClassLoader());

Thanks again.

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

2009-07-17 Thread Bart van Wissen

On Jul 16, 6:52 pm, Dianne Hackborn hack...@android.com wrote:
 Just use ArrayListParcelable as your data type.


Putting ListParcelable in my aidl file resulted in the following
errors:

The method writeBinderList(ListIBinder) in the type Parcel is not
applicable for the arguments (ListParcelable)
for this line in the automatically generated Proxy:
_data.writeBinderList(conditionList);

Type mismatch: cannot convert from ArrayListIBinder to
ListParcelable
for this line:
_arg0 = data.createBinderArrayList();
in the onTransact method of the Stub

Apparently the AIDL compiler thinks a ListParcelable is a
ListIBinder?

I ended up just making it a List with no type at all, and verifying
the type in the service implementation. This works for me.



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

2009-07-16 Thread Bart van Wissen

 2. Use a generic Parcelable class type, in which case the marshalling code
 will inspect the class type, included that in the marshalled data, and use
 that to re-construct it on the other side.


I don't understand this.

My program deals with Condition objects, which can be put in a list to
specify a series of search conditions. There are specific classes like
StringCondition, TimeCondition, LocationCondition, etc. They are all
subclasses of Condition, but they all have their specific sets of
fields.

A list of those has to be passed to a service. Now how would I use a
generic Parcelable class for this? To be honest I don't have much
experience with generic classes.

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

2009-07-15 Thread Bart van Wissen

On Jul 15, 5:21 pm, Streets Of Boston flyingdutc...@gmail.com wrote:
 It looks like your Animal class is abstract and should never be
 constructed. Declare Animal 'abstract' and see if you get an
 instantiation error.

It should be abstract, but I cannot make it abstract because then I
cannot add the CREATOR to it, which is needed to implement
Parcelable.
So now it is just an empty superclass.



 Have your tried to put the 'public static final Parcelable.Creator
 CREATORCat' and 'public static final Parcelable.Creator
 CREATORDog' variables and definitions in both Cat and Dog (and not
 in Animal)? This will make sure that the factory-method
 createFromParcel creates the appropriate subclass (Cat or Dog, and not
 Animal).

I did that, but it doesn't work. Those CREATORs are never actually
called.
The AIDL compiler sees the ListAnimal and assumes that every element
in the list is an Animal, and no subclass of it, and it creates the
unmarshalling code accordingly.


 About the readFromParcel().
 If Cat and Dog both implement readFromParcel() it should work fine.
 Are you sure that the variable 'a' is not an Animal instance?


That was my mistake, I didn't properly override the method (one was
private and the other was public). I deleted my post when I noticed
this. Unfortunately this was while you were typing your reply.



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Documentation inconsistency in Service.onBind() intent extras availability

2009-07-02 Thread Bart van Wissen

Is the MyPool object actually passed by reference here, from the
service to the client?
So changes to the object are reflected at the service side and at any
clients that may share the same reference?

On 2 jul, 11:15, Dianne Hackborn hack...@android.com wrote:
 No, have a method on the top-level interface that returns another
 object/interface based on whatever parameters you give it:

 interface MyPool {
   void doSomething();

 }

 interface MyService {
   MyPool getPool(int sel1, String sel2);

 }

 If needed you can have a release() method on MyPool for the client to
 indicate when they are done with it.



 On Wed, Jul 1, 2009 at 11:45 PM, Gert gsch...@gmail.com wrote:

  That would mean prefixing all the methods with their dynamic
  identifiers to select the correct serivice object, such as:
   void myPoolMethod(poolId, real parameters)
   void myCollabMethod(poolId, collabId, real parameters);
  and then looking up the specific instance with a global lock in some
  form of registry. The poolId and collabId need to be unique over
  (undesired) service destruction, which means lookups of strings in
  hashtables...
   getOrCreatePool(poolid).getOrCreate(collabId).myMethod(...);
  Do you know how expensive is it to keep another connection object
  around (well, setting it up most likely) versus 1-2 hashtable lookups
  in every RPC call?

  I chose this design since the expectation is 0-1 bindings to a single
  pool and, depending on the activity, one-few bindings to one of those
  collaboration objects per activity. You could compare the basic
  structure to the more traditional content (provider) based apps that
  work with a list of items (pool), and specific item (collab
  thing). Not all activities will need a binding to the pool, or more
  then one collab object.

  Also, if you bind to a binder linked to a specific pool/collabobject,
  you can do easy refcounting allowing for dynamic destruction of the
  server object trees, else I think you'll have to force the client app
  to not only unbind the service, but also remove their references. This
  might not be an real point though, just more bookkeeping.

  On Jul 2, 1:11 am, Dianne Hackborn hack...@android.com wrote:
   You may want to seriously consider just having a single service and
  Binder
   interface, with calls on to that top-level binder interface to get the
   secondary interface(s) the client wants.  In general I find this cleaner
   than setting things up where there are an unbounded number of Intent
  objects
   you can bind to (keep in mind that the activity manager needs to set up
  and
   hold a new kind of connection object for each of these), or ending up
  with
   multiple service components.

   Once you have a binder interface, you have a mechanism for very rich
   interaction between the service and client through whatever API you want
  to
   describe in aidl.

   On Wed, Jul 1, 2009 at 3:56 PM, Gert gsch...@gmail.com wrote:

For completeness, I ended up going this:

My service is maintaining (dynamic) pools of (dynamic) collaberation
objects, so I ended up with 2 services:
MyPoolService, bound with:
 action=package.IMyPoolSerivice
 data=package:poolname
and MyCollaberationService, bound with:
 action=package.IMyCollaberationService
 data=package:poolname#id

This way I return a binder per pool, and a binder per pool-
collaberation pair, and I can keep (and dynamically create) the state,
in the binders. Perhaps using the data Uri to select a specific
(binder) instance isn't the way this is intended, but it does map well
to this service operates on that data.

Regards,
 Gert Scholten

On Jul 1, 11:57 pm, Dianne Hackborn hack...@android.com wrote:
 Good point, you can make up whatever action string you want (provided
  it
has
 your appropriate namespace); it is a convenient convention for this
  to be
 the fully qualified name of the interface that is being requested.

 On Wed, Jul 1, 2009 at 1:42 PM, Bart van Wissen 
  bartvanwis...@gmail.com
wrote:

  I think you can actually use the Intent's action to select the
  implementation stub that you need. In the examples, the class name
  is
  used, but I think you can use anything you want, as long as you
  create
  the appropriate intent filter for the service.

  On 1 jul, 20:33, Gert gsch...@gmail.com wrote:
   I have a service working with selectable backends internally, and
  the
   user is able to select which on to bind to. I was hoping to
  optimize
a
   bit by have that selection made by the bindService call, and just
keep
   a single Binder per backend implementation. Guess I'll just
  create a
   new Binder per bindService, and point it to the backend to use.

   Anyway, thanks for the information - following the the
  documentation
   it is :)

   Regards,
     Gert Scholten

   On Jul 1, 6:24 pm, Dianne

[android-developers] Re: Documentation inconsistency in Service.onBind() intent extras availability

2009-07-01 Thread Bart van Wissen

I think you can actually use the Intent's action to select the
implementation stub that you need. In the examples, the class name is
used, but I think you can use anything you want, as long as you create
the appropriate intent filter for the service.


On 1 jul, 20:33, Gert gsch...@gmail.com wrote:
 I have a service working with selectable backends internally, and the
 user is able to select which on to bind to. I was hoping to optimize a
 bit by have that selection made by the bindService call, and just keep
 a single Binder per backend implementation. Guess I'll just create a
 new Binder per bindService, and point it to the backend to use.

 Anyway, thanks for the information - following the the documentation
 it is :)

 Regards,
   Gert Scholten

 On Jul 1, 6:24 pm, Dianne Hackborn hack...@android.com wrote:

  Yeah that is a little wrong...  the extras are very complicated, because the
  bind is cached in various places.  So you will see the extras for -some-
  request to bind, but not necessarily the current one.

  I would strongly strongly strongly urge against using extras here.  There
  really is no need at all -- you will be getting back a full IPC interface to
  the object, through which you can do whatever interaction and data passing
  you want.  The Intent in this API is intended -only- to identify which
  interface you are interested in.  (I think I had intended the code to strip
  out the extras because of how undefined it is about what you will get, but
  apparently had forgotten to do that.)

  On Tue, Jun 30, 2009 at 11:25 AM, Gert gsch...@gmail.com wrote:

   Hi,

   I have a question about the availability of the extras in an intent
   passed to Service.onBind(). The documentation at

  http://developer.android.com/reference/android/app/Service.html#onBin...)http://developer.android.com/reference/android/app/Service.html#onBin...
   specifically states Note that any extras that were included with the
   Intent at that point will not be seen here.. However, extras are
   available (emulator, SDK 1.5).

   Is the documentation off/outdated and are the extras available
   intentionally, or are they unintentionally exposed to the onBind
   method? Can we rely on extras remaining available at this point?

   Regards,
    Gert

  --
  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] Expression Evaluation library that works in Dalvik

2009-05-26 Thread Bart van Wissen

I'm looking for a library that will let me evaluate expressions at
runtime. Required:

- basic logical expressions (AND, OR, NOT operators)
- custom functions
- some mechanism to resolve variables (I want to link some variables
to some entities in a ContentProvider)

I have tried a number of libraries including MVEL and Juel, which
would be perfect but they do not seem to work under Dalvik. I couldn't
really figure out why, but it looks like they rely on some class
loading mechanism which seems to be problematic in Dalvik. There was
also some problem with libraries checking the java runtime version
(System.getProperty(java.version)) which is 0 in Dalvik for some
unknown reason.

I have also looked at BeanShell, but I think this is not really
suitable because it is a full blown scripting engine (which leads to
some security issues in this case) and all I need is evaluation of
simple expressions.

Any suggestions?

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

2009-02-05 Thread Bart

Hi everybody.

Does anywone knows where the Wikitude application get it's content
from?
It says in the Marketplace description 'Wikipedia' and 'Panoramio'.
I'd like to know what wikipedia pages are used as a source.

Cheers
Bart

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