[android-developers] debugging with a different keystore

2010-01-29 Thread guich
Hi,

I know that, to be able to sign a package with your own keystore, you
have to use the export from eclipse.

However, its not easy to keep doing this when you're still debugging
the application. Since i have external libraries that uses another
keystore and use the shareUserId, it would be reasonable to let, in
eclipse plugin, you debug an application using any keystore.

Any tips of how to make debugging easy with a private keystore?

thx

   guich

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


[android-developers] changing the background color of an activity

2010-01-31 Thread guich
Hi,

When i launch Activity A, the screen goes black, then dark-gray. Then
A launches B, and the screen goes black and dark-gray again.

Is there a way to set the default background color to black? Activity
A has no screen, its just a stub that calls B.

thanks and regards

guich

-- 
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: changing the background color of an activity

2010-01-31 Thread guich
Hi,

Thanks for the answer. I also use

 android:theme="@android:style/Theme.NoTitleBar" >

Can i use Black *and* NoTitleBar at the same time?

thx

 guich

-- 
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: changing the background color of an activity

2010-02-01 Thread guich
Already found the answer:

 android:theme="@android:style/Theme.Black.NoTitleBar" >

Works great, thanks!

guich

-- 
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] listing /data/data device's contents

2010-02-01 Thread guich
Hi,

I'm trying to get a list of folders in /data/data that starts with
"totalcross". Is this possible? All i get is "permission denied".

All these folders are signed with the same key and have the same user
id.

thanks

   guich

-- 
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: listing /data/data device's contents

2010-02-01 Thread guich
Well, i'll add a RFE so that it could list at least the folders with
the same user id.

guich

-- 
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: Performance issue: Dalvik VM is >20x slower than most modern Java VMs

2010-02-01 Thread guich
> Just following up to my initial post, I have implemented the above
> look in native code using Android's SDK.  The native code performs in
> a few milliseconds as hoped.  This goes to confirm that for compute
> intensive tasks, Dalvik can be hundreds of times slower than native.

Hi,

Can you provide me with your Java test code? I just finished porting
TotalCross to Android and i would like to know how fast is my virtual
machine comparing with Dalvik's. And your program could be a good
start.

You can send me it privately.

cheers

 guich
 http://www.totalcross.com

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


[android-developers] Re: OpenGL poor performance with textures?

2010-02-01 Thread guich
Hi Federico,

I tried during weeks to get a working code for the opengles. The idea
was to draw an offscreen bitmap into the screen (i do all the graphics
rendering by myself). Then someone told me that using textures for
this was not a good idea, because it takes time to make the texture
get into the video card and then displayed.

Since my knowledge of opengl is near 0, i gave up and used the
SurfaceView approach. I also published the code here:

This goes at surfaceChanged:

  sScreenBuff = ShortBuffer.allocate(w * h);
  sScreenBitmap = Bitmap.createBitmap(w, h,
Bitmap.Config.RGB_565);

And this is my updateScreen method:

   static void updateScreen()
   {
  try
  {
 if (sScreenBitmap == null)
return;
 Canvas canvas = surfHolder.lockCanvas();
 if (canvas == null)
return;
 instance.nativeOnDraw(sPixels); // call Native C code
 sScreenBuff.put(sPixels);
 sScreenBuff.rewind();
 sScreenBitmap.copyPixelsFromBuffer(sScreenBuff);
 canvas.drawBitmap(sScreenBitmap, 0, 0, null);
 surfHolder.unlockCanvasAndPost(canvas);
  }
  catch (Throwable t)
  {
 debug(Log.getStackTraceString(t));
  }
   }

Have you done something different to achieve the 60fps?

Btw, i can test your code in two devices, the G2 Ion and the Motorola
Milestone (A853).

thanks and regards,

   guich

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


[android-developers] changing the default theme of an intent that is being launched

2010-02-01 Thread guich
Hi Folks,

I have activity A that calls intent B.

The user may set A to full screen, so currently i pass a parameter to
B (which, by default, is NOT fullscreen) in order to make it
fullscreen. This works fine, except that the top bar disappears,
appears and then disappears again.

Is there a way to, programatically, change the Theme attribute of an
intent that is being called?

thanks

   guich

-- 
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] "Force clearing orientation change". bug in G2?

2010-02-01 Thread guich
1 22:04:41.970 I/DEBUG   ( 3489): bee28768  bc48  [heap]
02-01 22:04:41.970 I/DEBUG   ( 3489): bee2876c  ad017630  /system/
lib/libdvm.so
02-01 22:04:43.210 W/WindowManager(   75): Window freeze timeout
expired.
02-01 22:04:43.210 W/WindowManager(   75): Force clearing orientation
change: Window{4331c058 totalcross.android/totalcross.android.Loader
paused=false}

As you can see, there's no mention to my C code above.

This can be easily reproduced. Should i consider it a bug in G2? May i
open a bug issue? Or someone thinks is something in my own code?

cheers

guich

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


[android-developers] Re: ANDROID_ID always null on devices

2010-02-02 Thread guich
Hi,

Is there a way to populate the id without having to get into the
market? This sounds a very strange policy. Seems that google only
thinks that the consumer will use Android, and they forgot about the
companies that will just install their applications and nothing else
(example: Sales Force Application). :-(

thanks

guich

-- 
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] getting the serial number

2010-02-02 Thread guich
Hi,

Yes, i know this was already often asked, but no one ever posted the
solution. Seems that the "android id" is NOT the serial number,
because it requires you to access the Market before it is assigned.
The serial number is displayed when you type:
> adb devices

The number displayed **is** the serial number of the device. I could
confirm that because the same number that appears in the adb list is
written behind the battery as "S/N".

Does someone know how to get access to that number in the device?
There must be a way...

thanks

   guich

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


[android-developers] Re: getting the serial number

2010-02-02 Thread guich
Hummm... i'm trying to find the adbd (adb daemon) sources that runs at
the device. Maybe the solution is written there. However, not even
google is able to find this code. Can someone point me to it?

I really can't understand why isn't this available through the api...

thx

   guich

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


[android-developers] Re: getting the serial number

2010-02-02 Thread guich
Hi,

Can you post the code so i can test in the devices i have here? I
never used this command...

thx

   Guich

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


[android-developers] Re: getting the serial number

2010-02-03 Thread guich
Hey, thanks

Worked fine on G2. This is the code i used:

#include "sys/system_properties.h"
  char buf[32];
  buf[0] = 0;
  __system_property_get("ro.serialno",buf);

Interestingly enough, i also tried this:

   char buf[2048];
   if ((in = open("/proc/cpuinfo", O_RDONLY)) < 0)
  debug("can't open"); // 2mb at least, or some litebase tests
will just skip over.
   else
  {
   if (read(in, buf, sizeof(buf)) < 4)
  debug("can't read");
   else
   close(in);

and it outputs:

can't read
Processor  : ARMv6-compatible processor rev 2 (v6l)
BogoMIPS   : 383.38
Features   : swp half thumb fastmult edsp java
CPU implementer: 0x41
CPU architecture: 6TEJ
CPU variant: 0x1
CPU part   : 0xb36
CPU revision   : 2

Hardware   : sapphire
Revision   : 0080
Serial : 

The interesting thing is that Serial is 0!

cheers, guich

-- 
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] concept of "user name"

2010-02-03 Thread guich
Hi,

Is there a concept of "user name" in Android? Windows Mobile lets you
enter a description of the owner of the phone; Palm OS has the concept
of user name. But i couldn't find anything about this in Android.

best,

guich

-- 
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] what are the possible connections?

2010-02-03 Thread guich
Hi,

What kind of connections can we open on Android? Which of the
following is possible?

- USB
- Serial port
- Infrared

I know that Bluetooth is possible, but are the other ones too?

And if yes, which classes i have to use?

thanks for the feedback

guich

-- 
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: concept of "user name"

2010-02-03 Thread guich
Yep, good idea, thanks.

guich

-- 
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] moving the softkeyboard from place

2010-02-06 Thread guich
Hi,

When i have a text editor in the bottom of screen, i would like to
move the IM to the top. I can easily do this in windows mobile. Is
there a way in Android?

thanks

   guich

-- 
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] persisting application data that will remain after app removal

2010-02-06 Thread guich
Hi,

I want to add a flag that will tell how much time my application is
running. This flag will have to stay even after the application is
removed. And, if its installed back, i must have a way to recover this
flag.

What's a way to implement this?

thanks

guich

-- 
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: moving the softkeyboard from place

2010-02-06 Thread guich
Thanks. Do you know how to *programatically* force the inputmethod to
be shown in fullscreen?

regards

   guich

-- 
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: persisting application data that will remain after app removal

2010-02-06 Thread guich
Hi Mark,

Very strange that Android don't support shareware applications. Note
that, then, is fairly easy that the user installs a 30-day trial
application, remove it and install again.

guich

-- 
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: persisting application data that will remain after app removal

2010-02-06 Thread guich
Hi,

We already have the application working this way in many other
platforms. Its just very strange that Android don't allow such
approach.

Is the sd card the only way? I guess that the SharedPreferences is not
a good place...

thx

   guich

-- 
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] unicode chars not being dispatched from IM

2010-02-06 Thread guich
Hi,

I'm opening the ImputMethod to be able to catch keys into my app.

When the user press standard keys, its ok. I get things like:
0 33 101
1 33 101
(action type, keycode, unicode)

However, when i long-press a char like A and choose à (ã), i
get only:
2 0 0

Any tips of what's going on?

thanks

guich

-- 
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: unicode chars not being dispatched from IM

2010-02-06 Thread guich
Ok, after a few hours, found the answer:

   public boolean onKey(View v, int keyCode, KeyEvent event)
   {
  switch (event.getAction())
  {
 case KeyEvent.ACTION_DOWN:
eventThread.pushEvent(KEY_PRESS, event.getUnicodeChar(),
keyCode,0,convertMeta(event),0);
break;
 case KeyEvent.ACTION_MULTIPLE:
String chars = event.getCharacters();
char c;
for (int i =0,n=chars.length(); i < n; i++)
   eventThread.pushEvent(KEY_PRESS, c=chars.charAt(i), c,
0,convertMeta(event),0);

guich

-- 
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: moving the softkeyboard from place

2010-02-07 Thread guich
   public static void setSIP(int sipOption)
   {
  InputMethodManager imm = (InputMethodManager)
instance.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
  switch (sipOption)
  {
 case SIP_HIDE:
imm.hideSoftInputFromWindow(instance.getWindowToken(), 0);
break;
 case SIP_SHOW:
imm.showSoftInput(instance, 0);
break;
  }
   }

-- 
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: debugging with a different keystore

2010-02-07 Thread guich
Hi,

>In Eclipse, I pointed custom keystore to the keystore in the project workspace.

And how you did that?

thx

   guich

-- 
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] Modal Dialogs: the definitive solution

2010-02-08 Thread guich
Hi,

I decided to share the solution i found to the problem of Android not
supporting real modal dialogs.

The solution was to draw the dialog by myself. :-( Well, at least
worked fine, besides the problem that its a bit ugly. :-)

Here's the code i used:

   static boolean alertShowing;

   public static void alert(String msg)
   {
  int scrW=instance.getWidth(),scrH=instance.getHeight();
  alertShowing = true;
  final int fh = 18;
  // note: we have to draw the dialog on screen, otherwise if we
use Dialog, the application just quits
  String[] msgs = msg.split("\n");
  Canvas canvas = surfHolder.lockCanvas();
  // fill with white
  Paint p = new Paint();
  p.setColor(0x);
  canvas.drawRect(0,0,scrW,scrH,p);
  p.setColor(0xFFAA);
  int ly = fh+fh/2;
  canvas.drawRect(0,0,scrW,ly,p);
  // draw caption in black
  p.setColor(0xFF00);
  p.setStyle(Paint.Style.STROKE);
  canvas.drawRect(0,0,scrW-1,scrH-1,p);
  p.setAntiAlias(true);
  p.setTextSize(fh);
  p.setTypeface(Typeface.DEFAULT_BOLD);
  p.setTextAlign(Paint.Align.CENTER);
  canvas.drawText("ALERT",scrW/2,fh+fh/4,p);
  canvas.drawLine(0,ly,scrW,ly,p);
  // draw message
  int maxy = scrH-fh*2;
  p.setTypeface(Typeface.DEFAULT);
  for (int i =0,y=fh*3; i < msgs.length && y < maxy; i++, y += fh
+2)
 canvas.drawText(msgs[i], scrW/2, y,p);

  String ok = "Ok";
  int tx = scrW/2;
  int ty = maxy+ly;
  canvas.drawText(ok,tx,ty,p);
  Rect bounds = new Rect();
  p.getTextBounds(ok, 0, ok.length(), bounds);
  int ww = bounds.width();
  int hh = bounds.height();
  canvas.drawRect(tx-ww,ty-hh-3,tx+ww,ty+3,p);

  surfHolder.unlockCanvasAndPost(canvas);
  while (alertShowing)
 try {Thread.sleep(200);} catch (Exception e) {}
   }

   public boolean onTouchEvent(MotionEvent event)
   {
  if (alertShowing)
  {
 alertShowing = false;
 return true;
  }
   }

HTH.

   guich
   http://www.totalcross.com

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


[android-developers] Re: Modal Dialogs: the definitive solution

2010-02-09 Thread guich
Hi!

The big problem is that i really need to block the application from
the caller.

Based on Dianne's suggestion, i'm now also making
alertShowing = false;

in the onPause method.

regards

   guich

-- 
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] rebooting programatically / platform certificate

2010-02-09 Thread guich
Hi,

I read that, to be able to reboot programatically, you have to:

1. Sign your app with the "platform certificate"
2. Do this:
Intent i = new Intent(Intent.ACTION_REBOOT);
 i.putExtra("nowait", 1);
 i.putExtra("interval", 1);
 i.putExtra("window", 0);
 sendBroadcast(i);

Questions: can any app be signed with such certificate? Can we install
it in non-development devices? Can such app be published in the
market?

In case the answer is NO, i'll like to propose Android developers to
let the app issue this and then the system would ask the user "do you
want to reboot?". This would make us happy.

thanks

   guich

-- 
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] get remaining battery

2010-02-09 Thread guich
Hi,

Searching old posts reveal that no one knows a way to get the current
battery level without using intents. Is this true? There's no method
to just return the current battery level?

thanks

   guich

-- 
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: get remaining battery

2010-02-09 Thread guich
Thanks Mark, great trick.

Here's the code that worked:

Intent bat = loader.registerReceiver(null, new
IntentFilter(Intent.ACTION_BATTERY_CHANGED));
int level = bat.getIntExtra("level", 0);
int scale = bat.getIntExtra("scale", 100);
return level * 100 / scale;

cheers

guich

-- 
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: what are the possible connections?

2010-02-09 Thread guich
Well... no.

But dumping /proc/devices i found this:

I/TotalCross( 2946): /proc/devices
I/TotalCross( 2946): Character devices:
I/TotalCross( 2946):   1 mem
I/TotalCross( 2946):   5 /dev/tty
I/TotalCross( 2946):   5 /dev/console
I/TotalCross( 2946):   5 /dev/ptmx
I/TotalCross( 2946):  10 misc
I/TotalCross( 2946):  13 input
I/TotalCross( 2946):  29 fb
I/TotalCross( 2946):  81 video4linux
I/TotalCross( 2946):  90 mtd
I/TotalCross( 2946): 108 ppp
I/TotalCross( 2946): 128 ptm
I/TotalCross( 2946): 136 pts
I/TotalCross( 2946): 216 rfcomm
I/TotalCross( 2946): 249 msm_camera
I/TotalCross( 2946): 250 ttyHS
I/TotalCross( 2946): 251 ttyMSM
I/TotalCross( 2946): 252 adsp
I/TotalCross( 2946): 253 oncrpc
I/TotalCross( 2946): 254 smd
I/TotalCross( 2946):
I/TotalCross( 2946): Block devices:
I/TotalCross( 2946): 259 blkext
I/TotalCross( 2946):   7 loop
I/TotalCross( 2946):  31 mtdblock
I/TotalCross( 2946): 179 mmc
I/TotalCross( 2946): 254 device-mapper
I/TotalCross( 2946):   msm  hw3d
I/TotalCross( 2946):  21: 209728 msm  msmdatamover
I/TotalCross( 2946):  23:252 msm  adsp
I/TotalCross( 2946):  24:   8921 msm  msm-sdcc (cmd)
I/TotalCross( 2946):  25:   4126 msm  msm-sdcc (pio)
I/TotalCross( 2946):  26:185 msm  msm-sdcc (cmt??-http://groups.google.com/group/android-developers?hl=en


[android-developers] problems using SCREEN_DIM_WAKE_LOCK

2010-02-09 Thread guich
Hi,

I'm trying to programatically turn the screen off and on, while keep
the app running.

If i try this code:

final PowerManager pm = (PowerManager)
loader.getSystemService(Context.POWER_SERVICE);
AndroidUtils.debug("creating lock");
screenLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK,
"TotalCross");
AndroidUtils.debug("lock: "+screenLock);
screenLock.acquire();
AndroidUtils.debug("acquired: "+screenLock);

... then the application stops at the "acquire" method call
("acquired" is never printed).

If i change to:

PowerManager pm = (PowerManager)
loader.getApplication().getSystemService(Context.POWER_SERVICE);

(note the getApplication()), then i get:
java.lang.SecurityException: Neither user 10030 nor current process
has android.permission.WAKE_LOCK.

Am I missing something here?

thanks

   guich

-- 
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: problems using SCREEN_DIM_WAKE_LOCK

2010-02-09 Thread guich
Thanks! Not so obvious to me. :-)
Where can i see the permissions that have to be set in order to get
access to a feature? I couldn't find anything in the documentation.

Well, now the lock works, but the screen is still BRIGHT! I'm using a
G2. Maybe this doesn't work in a G2?

greetings,

   guich

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


[android-developers] changing the current date/time

2010-02-09 Thread guich
Hi,

I'm now trying to change the current date and time of the device. I
know that it comes from the network, but some users like to
synchronize the clock with their server's clock, even if it differs.

Can this be done programatically, not being a superuser?

thanks

   guich

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


[android-developers] changing the current date/time

2010-02-09 Thread guich
Hi,

I'm now trying to change the current date and time of the device. I
know that it comes from the network, but some users like to
synchronize the clock with their server's clock, even if it differs.

Can this be done programatically, not being a superuser?

thanks

   guich

-- 
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: Modal Dialogs: the definitive solution

2010-02-09 Thread guich
My application is not a standard application. Is a virtual machine.
This is the schema:

totalcross application <-> totalcross vm <-> native code <-> dalvik vm
<-> totalcross' android classes

When the TotalCross application calls Vm.alert("hi!"), it is expecting
that the call will resume ONLY after the alert is closed.

I didn't find another way to do this.

regards

guich

-- 
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: problems using SCREEN_DIM_WAKE_LOCK

2010-02-10 Thread guich
Hi Sean,

Thanks for your help. However, the SCREEN_BRIGHTNESS doesn't work.
Digging into old messages, there's a IHardwareService interface, but i
can't even use it since its already removed.

Seems that i'm lost...

thx

   guich

-- 
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] java.io.Exception in AssetManager.readAsset (Android BUG)

2010-02-11 Thread guich
Hi,

This is a new thread about an old bug.

There's a bug in the AssetManager that, if you try to read using a
byte buffer a raw resource bigger than 512k (in G2), it will throw
this exception:

java.io.IOException
   at android.content.res.AssetManager.readAsset(Native Method)
   at android.content.res.AssetManager.access$800(AssetManager.java:
36)
   at android.content.res.AssetManager
$AssetInputStream.read(AssetManager.java:542)

If you call is.read(), reading one byte per time, it WORKS. However,
for a 6MB file, it takes just too long reading 6 million bytes.

Questions:

1. Was this bug already fixed in later android devices? My G2 is 1.6.
2. Are there any *usable* workaround for it?
3. Is there a way to access the raw resource from C?

thanks

guich

-- 
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: Modal Dialogs: the definitive solution

2010-02-11 Thread guich
I also found that calling the alert from the VM works fine. However,
calling from the SurfaceView will freeze the application. So, i
changed the method to wait a few seconds and then quit if its being
called from a View.

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


[android-developers] how to store raw file uncompressed

2010-02-11 Thread guich
Hi,

I'm trying to store a raw uncompressed file into the apk. I already
tried rename it to mp3, png, zip, but all these extensions still
compress the file: if i open the apk using winzip, it shows
tcfiles.png 4194304 -> 4080.

I already heard about the "aapt -0" to store uncompressed, but no one
tells how to do this from within eclipse. I don't call aapt by hand, i
use the one generated by eclipse.

Any help?

thanks

guich

-- 
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 store raw file uncompressed

2010-02-11 Thread guich
Hi,

I put under \android\apps\tcvm\res\raw\tcfiles.zip

Is this an asset folder?

thanks!

   guich

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


[android-developers] how to store raw file uncompressed

2010-02-11 Thread guich
Hi,

I'm trying to store a raw uncompressed file into the apk. I already
tried rename it to mp3, png, zip, but all these extensions still
compress the file: if i open the apk using winzip, it shows
tcfiles.png 4194304 -> 4080.

I already heard about the "aapt -0" to store uncompressed, but no one
tells how to do this from within eclipse. I don't call aapt by hand, i
use the one generated by eclipse.

Any help?

thanks

guich

-- 
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: Modal Dialogs: the definitive solution

2010-02-12 Thread guich
Thanks, i'll try that.

regards

   guich

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


[android-developers] how much time we have at onPause until we are killed?

2010-02-17 Thread guich
Hi,

When the user press the home key, the onPause method is called. At
this time, the application is supposed to save its state so it can be
properly recovered later.

However, and if the state is taking too much time? For example,
issuing a closeAllNetworkConnections that was waiting a feedback from
the server, or just if the amount of information we're writting to
disk is a lot of info... what would happen?

In my tests, i'm getting from 300-500 ms of time until the process is
killed.

Is there a safer place to put a "save everything and quit" code so
that it can safely save everything before a "kill the activity" task
is issued?

thanks!

   guich

-- 
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] trying to show a progressdialog in a lengthy task

2010-02-17 Thread guich
Hi,

When i first launch my main intent, i check if the application was
updated and, if yes, i decompress some asset files. This task can take
up to 15 seconds (to decompress a 6MB zip file).

So, i was trying to show a ProgressDialog to the user. However,
nothing in hell makes the dialog appear.

The lengthy method is called from onCreate. I already tried to put it
in onStart, but same thing. I also tried to run it in the ui thread,
same thing: no dialog appears, even if "isShowing" returns true.

This is the code:

showProgressDialog
while (...)
   // a 15-second task
nowQuit();

What can i do to make the dialog really show up on screen?

thanks

   guich

-- 
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: trying to show a progressdialog in a lengthy task

2010-02-17 Thread guich
Hi,

What's the main application thread used if not for lengthy tasks? I
really can't understand all the threads of Android...

regards

   guich

-- 
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: trying to show a progressdialog in a lengthy task

2010-02-17 Thread guich
Hi,

I was able to make it work using the AsyncTask.

thanks for all answers

guich

-- 
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] services x threads

2010-02-22 Thread guich
Hi,

I'm trying to understand the idea behind the Services.

If it runs in the program's thread, why not create just a separate
thread (or AsyncTask) to do the job?

Can a service keep running in the background? For example, i want to
create a task that will continuously be polling data from a server,
even if the main application is not running. Can this be achieved with
a Service?

thanks

guich

-- 
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: services x threads

2010-02-22 Thread guich
Thanks. But i'm still not sure that a Service really runs in the
background. :-) Does it?

guich

-- 
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: services x threads

2010-02-22 Thread guich
Hi Mark,

Thanks for the information.

What i was thinking to do was to write a service that was
automatically started and just keep running in the background, even
with no other intents alive. So, it would be a service-only
application; no user interface at all. It would run and, from time to
time, connect to a server, download data, and sleep again.

guich

-- 
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: services x threads

2010-02-25 Thread guich
Hi,

I already read the diamonds article.

The problem here is that the Android team forgot that some phones will
be of exclusive dedication to some programs. For example, there are
many Sales Force programs that will allow only itself to run in the
phone. To these programs, the idea of NOT intercepting the HOME key is
unacceptable. This may lead these users to abandon Android in favor of
platforms that allow that (like windows mobile, palm, blackberry).

An idea behind the service was to let the app keep polling the data
server from time to time, in the background. Actually, this can also
be done by using server socket, so the service would just sit and
listen for a server connection. Almost no processing at all.

I think that Android is a great platforms, however, it has some bugs
that must be fixed. The dont_intercept_the_home_key is one, the
kill_the_app_when_turning_off is another, the
dialog_that_appears_asking_to_unblock_the_phone is another issue, and
finally, the no_real_modal_messageboxes.

I also undertand that Android apps has a specific lifecycle, however,
for SF applications, this is really a no-go.

regards

guich

-- 
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] black camera jpeg on Defy

2011-06-02 Thread guich
Hi,

I have a code that works fine in all Android devices i tested (over
10), but fails on a Defy. The resulting jpeg file is just a set of
black pixels (all image is black).

Here's a piece of code:

   class Preview extends SurfaceView implements SurfaceHolder.Callback
   {
  Preview(Context context)
  {
 super(context);
 
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
 // Install a SurfaceHolder.Callback so we get notified when
the
 // underlying surface is created and destroyed.
 holder = getHolder();
 holder.addCallback(this);
 holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
  }

  // Called once the holder is ready
  public void surfaceCreated(SurfaceHolder holder)
  {
 startPreview();
  }

  // Called when the holder is destroyed
  public void surfaceDestroyed(SurfaceHolder holder)
  {
 stopPreview();
  }

  // Called when holder has changed
  public void surfaceChanged(SurfaceHolder holder, int format, int
w, int h)
  {
 if (camera != null)
 {
Camera.Parameters parameters=camera.getParameters();
parameters.setPictureFormat(PixelFormat.JPEG);
camera.setParameters(parameters);

camera.startPreview();
 }
  }
   }

   private void startPreview()
   {
  if (camera == null)
 try
 {
// The Surface has been created, acquire the camera and
tell it where to draw.
camera = Camera.open();
camera.setPreviewDisplay(holder);
 }
 catch (Exception e)
 {
AndroidUtils.handleException(e,false);
 }
   }

   private void stopPreview()
   {
  if (camera != null)
  {
 try {camera.stopPreview();} catch (Exception e) {}
 try {camera.release();} catch (Exception e) {}
 camera = null;
  }
   }

   public void onCreate(Bundle savedInstanceState)
   {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  preview = new Preview(this);
  ((FrameLayout) findViewById(R.id.preview)).addView(preview);
  final Button buttonClick = (Button)
findViewById(R.id.buttonClick);
  buttonClick.setOnClickListener(new OnClickListener()
  {
 public void onClick(View v)
 {
try
{
  camera.takePicture(null, null, jpegCallback);
}
catch (Exception e)
{
   AndroidUtils.handleException(e,false);
   stopPreview();
   setResult(RESULT_CANCELED);
   finish();
}
 }
  });
   // Handles data for jpeg picture
   PictureCallback jpegCallback = new PictureCallback()
   {
  public void onPictureTaken(byte[] data, Camera camera)
  {
 try
 {
FileOutputStream outStream = new
FileOutputStream(fileName);
outStream.write(data);
outStream.close();
setResult(RESULT_OK);
finish();
 }
 catch (Exception e)
 {
AndroidUtils.handleException(e,false);
 }
  }
   };


I checked the adb logcat output but no errors were displayed. Also, i
checked if the onPictureTaken was called more than once, but it was
not (only one call).

Any help is appreciated.

TIA

guich
www.totalcross.com

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


[android-developers] Re: black camera jpeg on Defy

2011-06-02 Thread guich
Just a feedback on this. I made a factory-reset of the device and then
the first photo i took appeared correctly. After this first photo, all
other photos appears black 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] getting InputMethod bounds

2011-06-03 Thread guich
Hi,

Simple question: is it possible to find the InputMethod bounds?

thanks

   guich

-- 
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] who draws the Button's border and background?

2011-06-28 Thread guich
Hi,

Who exactly draws the Button's border and background? I saw that
Button extends TextView, but this class has 8500 lines. I would like
to understand the algorithms used to draw the border and the dithered
gradient background.

thanks

guich

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


[android-developers] "android:required" failing when building for api level 4

2011-07-04 Thread guich
Hi,

I'm trying to install my application on a Archos 43 internet tablet.
It failed with a INSTALL_FAILED_MISSING_FEATURE error.

Searching in the forums, i saw a topic saying that we would have to
change the uses-feature setting the required to false.

When i put this line:



and compile, i get this error:

error: No resource identifier found for attribute 'required' in
package 'android'

Any help is appreciated

thanks

 guich

Ps:
[setup] Android SDK Tools Revision 10
[setup] Project Target: Android 1.6
[setup] API level: 4

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


[android-developers] Can a service have an ui?

2012-03-21 Thread guich
Hi,

Can an unbound service have also an user interface? I was thinking in
the implementation of a message receiver. The service would start
minimized, and keep checking for a message, and when it appears, it
would maximize the application and show the message, then minimize
again.

thanks in advance,

   guich

-- 
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] resintalling application due to data corruption

2012-04-04 Thread guich
Hi,

Some users are having a very serious problem with some android devices
(motorola, samsung): after running the application for several hours,
some data files are being corrupted by the OS. The most strangest
thing is that these files are opened using fopen(.., "rb"), thus, in
read-only mode. They are never written from our code.

I can easily detect that the corruption occured when the program
starts. I was thinking, in this case, to call the installer again. I
know that the installer are stored at /data/app/*.apk. Is it possible
to call the installer from the application in a non-rooted android
device or is this blocked?

thanks

   guich

-- 
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: resintalling application due to data corruption

2012-04-04 Thread guich
Its in the /data/data/

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


[android-developers] creating a window-close animation effect

2012-04-16 Thread guich
Hi all,

Can someone give me an insight (or maybe a code sample :-)) to show a
windows closing on the top of another one? I mean, an animation where
the new window will be shown from out to the center.

thanks

guich

-- 
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: creating a window-close animation effect

2012-04-16 Thread guich
Just a side note: i saw some code that does this for Views, but i need
to do it with a Bitmap over a Surface.

thanks

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


[android-developers] Re: creating a window-close animation effect

2012-04-16 Thread guich
I'm still searching. I found that with the ScaleAnimator i can achieve what 
i need, but still trying with no success. This is the code i'm using:

   ScaleAnimation anim=new ScaleAnimation(1,1,0,0);
   anim.setFillAfter(true);
   anim.setFillEnabled(true);
   anim.setInterpolator(new 
android.view.animation.AccelerateInterpolator());
   anim.setDuration(1000L);

This is the ImageView i'm creating to store the new image. This image is 
updated by a native function.

   ImageView image = new ImageView(instance.getContext());
   image.setImageBitmap(sScreenBitmap);
   image.setVisibility(ImageView.VISIBLE);
   image.startAnimation(anim);

This is called from another view. However, nothing happens on screen.

TIA.

-- 
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: creating a window-close animation effect

2012-04-17 Thread guich
Hi,

Thanks for the reply. My whole problem is that my application is not a 
standard one. I don't use xml files; i create all the user interface (which 
is quite small) by hand.

I already tried many things, but no animation is done at all. All i see is 
the new view appearing at once at the screen.

So, i have a current view with a bitmap, then i update the bitmap natively, 
then i want to show the new bitmap appearing at the top of the other one.

thanks

guich

-- 
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: creating a window-close animation effect

2012-04-17 Thread guich
Hi Mark,

Unfortunately, that's not an option. I don't create programs for Android, i 
create a virtual machine that runs side by side with Dalvik. All i need 
from Android is to start the program, handle pen and keyboard events, and 
show the contents drawn by my VM on the screen. Too bad that this can't be 
done fully in native mode, like in iOS, Windows Mobile and (dead) Palm OS.

Anyway, i got some evolution by calling the runOnUiThread method. I can 
start the animation, i can see it has stopped, but nothing happens on 
screen. I'm pretty sure its because of my very small knowledge about the 
Android UI stuff (as i said, i use very few of the UI). 

This is the situation:

1. I have a SurfaceView that calls a native code that draws on a bitmap. 
The native code then asks the screen to be repainted.
2. Sometimes, the native code may ask to paint it with some effects, like a 
transition between screens. So, it fills the offscreen bitmap and asks 
dalvik to show it on screen with some effect.

I searched the net to find if there's a way to let a bitmap be applied over 
another bitmap with animation, but found nothing. So, i realized that a 
view can be shown on the top of another view with animation. The idea is to 
write to the offscreen bitmap, create an ImageView, draw the bitmap on it, 
and apply the animation transition from the SurfaceView to the ImageView.

So, I tried this code:

1 if (iview == null)
2iview = new ImageView(instance.getContext());
3 iview.setImageBitmap(sScreenBitmap);
4 ScaleAnimation anim = trans == TRANSITION_CLOSE ? new 
ScaleAnimation(1f,1f,0f,0f) : new ScaleAnimation(0f,0f,1f,1f);
5 anim.setDuration(2000);
6 anim.setAnimationListener(this);
7 iview.setVisibility(ImageView.VISIBLE);
8 instance.startAnimation(anim);


I already tried iview.startAnimation, but nothing occurs visually.

Any help is appreciated.

thanks
 
 guich

-- 
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: creating a window-close animation effect

2012-04-17 Thread guich
I'm almost there. Once i get the correct results, i'll post here.

Instead of using setContentView, i'm using addContentView. However, i 
didn't found a removeContentView, so i'm using setVisibility(GONE). 
Question: does this gets rid of the added view? I'm not sure if it just 
hides the view but keep wasting it resources...

thanks

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

Re: [android-developers] Re: creating a window-close animation effect

2012-04-17 Thread guich
Thanks, Justin, it worked:

 ViewGroup vg = (ViewGroup)iview.getParent();
 vg.removeView(iview);


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

Re: [android-developers] Re: creating a window-close animation effect

2012-04-17 Thread guich
I got one of the animations working: the old view is visible, then a new 
view grows from center to the border.

However, in the opposite situation, i'm unable to get the desired results: 
i want that the old view be shrinking while the new view appears. Not sure 
if i was understood: is like if the new view is behind the old view, which 
shrinks from the border to center.

What happens is that the old view appears on the top of the new view, 
instead of the desired situation, where the new view is behind the old view.

Any thoughts?

thanks.

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

[android-developers] what is faster? surfaceview or imageview?

2012-04-18 Thread guich
Hi,

I need to do frequent updates of a dynamically changed bitmap. What is
faster? SurfaceView/SurfaceHolder.lockCanvas or ImageView/
setImageBitmap?

thanks

guich

-- 
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: problems when creating files in android

2011-12-29 Thread guich
mkdir(path, S_IRWXU | S_IRWXG | S_IRWXO)

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


[android-developers] problems when creating files in android

2011-12-29 Thread guich
Hi,

In native code when we create a file, it creates it with 666
permissions (rw * 3).

In Java, it creates with 600.

Is there a way in Java to specify the permissions when creating the
file? Or maybe change it afterwards?

I have the same problem for folders.

thanks

   guich

-- 
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: problems when creating files in android

2011-12-29 Thread guich
Hi,

Do you know if its possible to call a native "mkdir" from java without
having to write a native code?

thanks

guich

-- 
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] deletable-assets

2011-12-30 Thread guich
Hi,

I store some zipped data in the assets. When my app runs at the first
time, i unpack the zip. The original zip in the assets folder is
useless, however, we cannot delete it.

Is there another way to pack files into an apk that we can later
delete after using it?

thanks

guich

-- 
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: deletable-assets

2011-12-30 Thread guich
On a side note, is it possible to get the creation data and time of
the asset file?

-- 
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: deletable-assets

2012-01-02 Thread guich
Is there any kind of notification that is sent when a program is
installed? I could get a notification that my program was installed or
updated and then save this date/time to use later.

thanks

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


[android-developers] officially supporting dual-sims

2012-02-13 Thread guich
Hi,

There are lots of dual-sims phones being dropped at the market and
Android has no official support for them. Will this be added in the
near future to the android api? Or will we go back one decade for the
Windows CE nightmare of each manufacturer implementing their own hack
on the OS?

thanks

   guich

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


[android-developers] using pixel coordinates in opengl es 2

2012-08-29 Thread guich
Hi,

I downloaded and played with the opengl sample at
http://developer.android.com/training/graphics/opengl/draw.html

However, it uses the standard coordinate system for opengl, where 0,0
is at the center of the screen and -1,-1 at top-left and 1,1 at bottom-
right.

I want to use the screen's coordinate, where 0,0 is at top-left and
width,height is at bottom-right.

I already tried a dozen things, read about 30 articles, but since i'm
a newbie at opengl, i'm still stumped.

Can someone tell what it has to be done to change the coordinate so
that the given rectangle

   static float squareCoords[] = { 10f,  10f, 0.0f,   // top left
   10f, 20f, 0.0f,   // bottom left
20f, 20f, 0.0f,   // bottom right
20f,  10f, 0.0f }; // top right

... is shown at screen?

thanks

guich

-- 
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] GL_POINTS not drawing points

2012-09-01 Thread guich
letter); letBuffer.position(0);
  }
  
 int nn = nletter/3;
 GLES20.glVertexAttribPointer(mPositionHandle, COORDS_PER_VERTEX, 
GLES20.GL_FLOAT, 
   false, COORDS_PER_VERTEX * nn, letBuffer); 
 GLES20.glDrawArrays(GLES20.GL_POINTS, 0,nn);
   }

   public static int loadShader(int type, String shaderCode)
   {
  int shader = GLES20.glCreateShader(type);
  GLES20.glShaderSource(shader, shaderCode);
  GLES20.glCompileShader(shader);
  return shader;
   }

   public void setColor(int rgb)
   {
  color[0] = (float)((rgb >> 16 ) & 0xFF) / 255f;
  color[1] = (float)((rgb >> 8  ) & 0xFF) / 255f;
  color[2] = (float)((rgb   ) & 0xFF) / 255f;
  color[3] = (float)((rgb >>> 24) & 0xFF) / 255f;
  GLES20.glUniform4fv(mColorHandle, 1, color, 0); // Set color for 
drawing the line
   }
}

thanks,

guich


<https://lh5.googleusercontent.com/-lelPSZoY4dw/UEIH5mVQfII/AD4/o5q5GMFuL00/s1600/points.png>

-- 
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: GL_POINTS not drawing points

2012-09-02 Thread guich
Hello!

Thanks for answering. Actually, i already know how to draw lines and 
rectangles, but i would like to draw points.

Can you provide me with the calls to the Matrix methods that would achieve 
the 2D projection using screen coordinates for the given surface width and 
height?

I made some tests with just a few points and it looks really strange. For 
example, if i call this:

  coords[0] = 10;
  coords[1] = 10;
  coords[3] = 11; coords[4] = 10;
  
  vertexBuffer.put(coords);
  vertexBuffer.position(0);
  
  GLES20.glVertexAttribPointer(mPositionHandle, 3, GLES20.GL_FLOAT, 
false, 3 * 2, vertexBuffer); // Prepare the triangle coordinate data
  GLES20.glDrawArrays(GLES20.GL_POINTS, 0,2);

Then i get a point at 0,0 and another at 10,10.

If i add a new coordinate at 12,10, i get two points side by side, but if i 
add a new point at 13,10, i get only 1 point again!

thanks.

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

[android-developers] display.getWidth bug "fixed" in android 3.2

2011-12-07 Thread guich
Hi,

There's a change in Android 3.2 that made the following code stop to
work as expected:

  WindowManager wm =
(WindowManager)instance.getContext().getSystemService(Context.WINDOW_SERVICE);
  Display display = wm.getDefaultDisplay();
  int screenHeight = display.getHeight();

Prior to 3.2, the width/height informed included the task bar. Then,
in 3.2, it EXCLUDES THE TASKBAR.

Its mandatory for my application to know in advance the value of the
screen WITHOUT THE TASKBAR.

May i ask PLEASE to Android developers to add an API in a future
version of Android to get the size as before?

Currently, i have to check if its android 3.2 and force a screen
rotation, get the size in both directions, then cache this value.

Thanks

guich

-- 
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] accessing sdcard in android 3.2

2011-12-09 Thread guich
Hi,

We have Toshiba Thrive and a Galaxy Tab 7Plus that were working fine
until they upgrated to 3.2. Now, its impossible to write anything in
the microsd folder (/sdcard/extStorages/SdCard). I can read the things
in the card, but can't write to it: access denied.

Is there a new limitation?

thanks

   guich

-- 
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: accessing sdcard in android 3.2

2011-12-09 Thread guich
Hi,

Yes, i do. The program was working fine until the unit upgraded itself
to version 3.2. Then, writting to the card stopped working.

thanks

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


[android-developers] Re: display.getWidth bug "fixed" in android 3.2

2011-12-09 Thread guich
Hi Dianne,

Lemme explain my problem.

All my application is drawn in an offscreen bitmap. When the
application starts, i get the maximum width/height of the screen and
create a square bitmap. This way, when screen rotates, i don't have to
create another bitmap. This prevents some crashes in my application.

I'm aware of the "bug fix", i saw your comments in another thread.
What i'm asking is if Google can create a way to retrieve the size
with something like this:

public Size getSizeOfScreenIncludingTaskbarArea()
or
public Size getSizeOfScreenForOrientation(int orientation) // VERTICAL
or HORIZONTAL

This would help a lot.

thanks for your time.

Guich

-- 
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: accessing sdcard in android 3.2

2011-12-09 Thread guich
Hi,

Yes, i found this:
http://www.thriveforums.org/forum/toshiba-thrive-general-discussions/4967-problems-after-latest-os-upgrade.html

Not sure if this is a problem in the device or in Android 3.2
itself...

thanks

guich

-- 
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: accessing sdcard in android 3.2

2011-12-09 Thread guich
Seems to be really an Android problem, because the same error occurs
on both Toshiba Thrive AND  Samsung Galaxy Tab7+, *** AFTER UPGRADING
THE FIRMWARE TO ANDROID 3.2 ***. Both devices using Android 3.1 works
perfectly.

-- 
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: display.getWidth bug "fixed" in android 3.2

2011-12-12 Thread guich
Hi,

Thanks If this can be added in Android 3.3 (or 3.4), that would be
wonderful.

Yes, i just need the biggest dimension (in pixels) of the whole
screen, no matter if there's a task bar or not.

Happy Christmas,

Guich.

-- 
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: display.getWidth bug "fixed" in android 3.2

2011-12-12 Thread guich
Hi,

One more thing. Can someone kindly tell us, in this thread, once the
method is added, or at least, in which version? This way i can change
my code to stop doing the rotation.

cheers

   guich

-- 
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] supporting 16M colors

2011-12-13 Thread guich
Hi,

We can see many new Android devices with 16M colors.

The most used color depth when drawing on offscreen bitmaps is 16bpp,
which results in 64K colors.

Is there a way to take benefit of all 16M capable colors of these
devices?

In iOS i create a 32bpp bitmap and the results are far better than if
i created a 16bpp bitmap. I tried to do the same on Android, creating
a Bitmap.Config.ARGB_, but the results are the same of creating a
RGB_565.

Thanks for your thoughts.

guich

-- 
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] getPixelFormat returning an incorrect value

2011-12-13 Thread guich
HI,

I'm running this:

  WindowManager wm =
(WindowManager)instance.getContext().getSystemService(Context.WINDOW_SERVICE);
  AndroidUtils.debug("format:
"+wm.getDefaultDisplay().getPixelFormat());

... on a Galaxy Tab 7, and it outputs: format: 5

However, the value 5 has no correspondence in the PixelFormat table.

What does this value represents?

thanks

guich

-- 
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] uses-feature android:name="android.hardware.camera" blocking device

2011-08-30 Thread guich
Hi,

I have a FOSTON device that does not have camera. When i install my
application on it, it says FAILURE: MISSING FEATURE.

Is there a way to use the camera without adding uses-feature? Why
can't we use a uses-permission instead? This way, the program could be
installed on device and disable itself the camera part.

thanks

   guich

-- 
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] Finding if the Soft Input Method is visible

2011-09-08 Thread guich
Hi,

Is there a way to know if the SIM is visible or not? I'm using the
android:windowSoftInputMode="adjustResize" in the manifest, but i
can't find anything that tells me if the window is being resized if
the SIM is being shown.

Of course, i do see the height going from 455 to 231, but how can i
know if this was caused by the SIM appearing or a screen rotation?

thanks

guich

-- 
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] windowSoftInputMode="adjustResize" not working on landscape or full screen

2011-09-08 Thread guich
Hi,

surfaceChanged method is not called if the application is in full
screen or in landscape. In portrait, i see the method being called.

Is this a bug in Android or what?

thanks

 guich

-- 
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: windowSoftInputMode="adjustResize" not working on landscape or full screen

2011-09-09 Thread guich
This bug was added in 2009 in the Android bug report system! It was
first noticied in Android 1.5 and also occurs in 3.1. Seems that
Google guys don't consider this a bug.

http://code.google.com/p/android/issues/detail?id=5497&q=windowSoftInputMode&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars

The argument that the notification should not be sent in FULL SCREEN
mode is not fair. If i'm a programmer that created an application that
is in full screen, its obvious that i would not add such flag to the
manifest.

It would be nice to see this fixed in a version.

guich

-- 
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] adjustPan notifications

2011-09-09 Thread guich
Hi,

Is there any kind of notification that's sent when using adjustPan in
the windowSoftInputMode attribute? I want to know how much the screen
was panned.

TIA

 guich

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


[android-developers] Re: Android + SQLite - Brazilian student

2011-09-09 Thread guich
Ola,

Porque voce nao experimenta o TotalCross?

www.totalcross.com.br

abraços,

Guilherme

On 8 set, 21:21, Andrews  wrote:
> hi i am a student from Brazil and I am studying android. I would ask
> if you could
> share a material on Android and sqlite (CRUD). Thank you all

-- 
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] showing the default A icon on google maps

2011-09-13 Thread guich
Hi,

I would like to know how can i place the default (A) baloon icon that
Google Maps has at the point i asked it to open. I don't need custom
icons, neither a custom text, just an icon or something showing the
center of the screen. My code is this one. I saw some things about
ItemizedOverlay but its proving to be just too complex.

public class MapViewer extends MapActivity
{
   public void onCreate(Bundle savedInstanceState)
   {
  super.onCreate(savedInstanceState);
  // setup the viewe
  MapView mapview = new MapView(this,"...");
  mapview.setBuiltInZoomControls(true);
  mapview.setClickable(true);
  mapview.setStreetView(true);
  setContentView(mapview);
  if (Loader.isFullScreen)
 
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
  // get passed parameters
  Bundle extras = getIntent().getExtras();
  double lat = extras.getDouble("lat");
  double lon = extras.getDouble("lon");
  mapview.setSatellite(extras.getBoolean("sat"));
  int ilat = (int)(lat * 1e6);
  int ilon = (int)(lon * 1e6);
  // move the map to the given point
  MapController mc = mapview.getController();
  if (ilat != 0 || ilon != 0)
 mc.setCenter(new GeoPoint(ilat,ilon));
  mc.setZoom(21);
   }

   protected boolean isRouteDisplayed()
   {
  return false;
   }
}


thanks

   guich

-- 
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: showing the default A icon on google maps

2011-09-15 Thread guich
Too bad that onDraw of MapView is final.
Why is adding a position so dificult? We ask to move to a coordinate,
it would be useful to just pass a name and show that name on the map,
without having to deal with overlays and so on.

I'm still stumped. :-(

guich

-- 
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: windowSoftInputMode="adjustResize" not working on landscape or full screen

2011-09-15 Thread guich
The landscape issue was fixed on Android 3.0, but the full screen's
NOT.

guich

-- 
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] going back and forth from FullScreen

2011-09-29 Thread guich
Hi,

I have an application that sets fullscreen with

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

... right before the view is created. Works fine.

However, i would like to bypass an Android BUG that prevents a screen
change being sent when the IMM opens and its in full screen. For this,
my idea was to

1. disable full screen
2. show the IMM
3. hide the IMM
4. re-enable full screen

Steps 1-3 works fine, but re-enabling full screen does not work (the
taskbar is still there).

Is this another bug or is it an expected behaviou? How can i force the
fullscreen to be applied?

thanks

   guich

-- 
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


  1   2   3   >