[android-developers] Application modules in Android Market? How to?

2011-06-08 Thread Pedro Duque
I've noticed that some applications have modules available in Android
Market (mainly themes).

How can that be achieved? How do these modules link to the main
application? What's the best implementation approach? Using different
content providers?

I would love to hear your opinion...

-- 
You received this message because you are subscribed to the Google
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] Keyguard?!

2011-06-02 Thread Pedro Duque
Hi Mark,

Thanks for the fast response.

I believe that something can be done (Lock 2.0 does a lock screen)
although I don't think it will be a replacement for the default
keyguard but an application that sits on top of it... while handling
all events related to security.


On 1 June 2011 18:29, Mark Murphy mmur...@commonsware.com wrote:
 On Wed, Jun 1, 2011 at 1:18 PM, Pedro Duque pmdu...@gmail.com wrote:
 I want to implement a custom lock screen for Android with a unlock password.

 Do you know how can I register a class to do it?

 You cannot replace the standard keyguard.

 Should it be done through keyguard?

 No.

 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy

 Android Training in NYC: http://marakana.com/training/android/

 --
 You received this message because you are subscribed to the Google
 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

-- 
You received this message because you are subscribed to the Google
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] Keyguard?!

2011-06-01 Thread Pedro Duque
I want to implement a custom lock screen for Android with a unlock password.

Do you know how can I register a class to do it? Should it be done
through keyguard? I have been searching for it but no luck until now.

Thanks.
PMD

-- 
You received this message because you are subscribed to the Google
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] Handling ACTION_SCREEN in a widget

2011-04-30 Thread Pedro Duque
Hi,

I'm doing a widget that needs to be update on screen_on or on
user_present. As I'm not hable to register a BroadcastReceiver inside
the widget I'm doing it in a Service that is triggered by the widget
like this:

Widget.java:
    @Override
    public void onEnabled(Context context) {
        super.onEnabled(context);
    context.startService(new Intent(context,
WidgetService.class).setAction(WidgetService.ACTION_WIDGET_START));
    }

WidgetService.java:
    @Override
    public void onStart(Intent intent, int startId) {
    super.onStart(intent, startId);

        String action = intent.getAction();
        Log.d(LOG_APP,WidgetService onStart: +action);


        if (ACTION_WIDGET_STOP.equals(action)) {
    this.unregisterReceiver(mReceiver);
            stopSelf();
            return;
        } else if (ACTION_WIDGET_START.equals(action)) {
    // register receiver that handles screen on and screen off logic
    IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_ON);
    this.registerReceiver(mReceiver, filter);
    return;
        }

The problem is that when I try to register the receiver I get the
error that the service has leaked IntentReceiver because it was
already registered. Ive checked and no duplicate registration was done
in my code.

Do you have any idea what I'm overlooking?

Thanks,
PMD

-- 
You received this message because you are subscribed to the Google
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] RSSI values

2011-03-13 Thread Pedro Duque
Hi,

I trying to make a wifi meter and to get wifi signal strength I'm using the
following code:

WifiManager wifi = (WifiManager)
context.getSystemService(Context.WIFI_SERVICE);
int rssi = wifi.getConnectionInfo().getRssi();

I get values between -40 and -90 when connection is established and -248
when it's not and I'm using a Samsung Galaxy S for testing.

Is -40 and -90 the max and min values for RSSI or will it change in
different terminals? Is -248 also a constant? Are they available on the API?

Thanks,
Pedro Duque

-- 
You received this message because you are subscribed to the Google
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] Mimetype hell

2011-02-10 Thread Pedro Duque
Hi,

I'm juggling with MIME types and got to a dead end.

I have a file with a non standard extension dcp and created a specific
MIME type for it application/vnd.portugalemgrande.clock. I've managed to
make it work with email but my problem now is with webserver. If the server
puts extra info in content-type my code doesn't work.

Let me explain:

INTENT FILTER:
intent-filter
action android:name=android.intent.action.VIEW /
category android:name=android.intent.category.DEFAULT /
category android:name=android.intent.category.BROWSABLE
/
data android:scheme=http
android:mimeType=application/vnd.portugalemgrande.clock /
/intent-filter

WEB SERVER RESPONSE #1:
HTTP/1.1 200 OK
Date: Thu, 10 Feb 2011 19:57:18 GMT
Server: Apache
Last-Modified: Thu, 10 Feb 2011 19:55:31 GMT
Accept-Ranges: bytes
Content-Length: 1157
Cache-Control: max-age=1209600
Expires: Thu, 24 Feb 2011 19:57:18 GMT
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/vnd.portugalemgrande.clock
X-Antivirus: avast! 4
X-Antivirus-Status: Clean

WEB SERVER RESPONSE #2:
HTTP/1.1 200 OK
Date: Thu, 10 Feb 2011 19:57:24 GMT
Server: Apache
X-Powered-By: PHP/5.2.14
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Etag: 1297367844
Content-Disposition: attachment; filename=clock12.dcp
Cache-Control: private
Last-Modified: Thu, 10 Feb 2011 19:57:24 GMT
Content-Length: 1157
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/vnd.portugalemgrande.clock; name=clock12.dcp
X-Antivirus: avast! 4
X-Antivirus-Status: Clean

The intent filter catch response #1 but doesn't work with response #2
although is a valid response.

What should I do in intent filter to make it work in both cases?

Thanks,
Pedro Duque

-- 
You received this message because you are subscribed to the Google
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 and receiving a file by email

2011-01-22 Thread Pedro Duque
Hi,

I'm trying to send a file through email and them open it when it's received
on the email.

To send the file I use:
Intent sendIntent = new
Intent(Intent.ACTION_SEND_MULTIPLE);

sendIntent.setType(application/vnd.portugalemgrande.clock);
sendIntent.putExtra(Intent.EXTRA_SUBJECT, Check this
out: +cp.getClock_name());
//Attachs
ArrayListUri uris = new ArrayListUri();

uris.add(Uri.parse(file://+fn.getPath()+File.separator+clock+type+.png));

uris.add(Uri.parse(file://+fn.getPath()+File.separator+clock+type+.dcp));

sendIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);

I don't have problems receiving the email back on the terminal, but I can't
manage to open the .dcp file from the email reader (I can only read it if I
save it to the sdcard and use a file manager to open it). My intent-filter
is as follows:

intent-filter
action android:name=android.intent.action.MAIN /
category android:name=android.intent.category.LAUNCHER /
/intent-filter
intent-filter
action android:name=android.intent.action.VIEW /
category android:name=android.intent.category.DEFAULT /
category android:name=android.intent.category.BROWSABLE
/
data
android:mimeType=application/vnd.portugalemgrande.clock/
/intent-filter
intent-filter
action android:name=android.intent.action.VIEW /
category android:name=android.intent.category.DEFAULT /
category android:name=android.intent.category.BROWSABLE
/
data android:scheme=file
android:mimeType=*/*
android:pathPattern=.*\\.dcp
android:host=*/
/intent-filter

What am I doing wrong?

Thanks,
Pedro Duque

-- 
You received this message because you are subscribed to the Google
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 and receiving a file by email

2011-01-22 Thread Pedro Duque
Just for the record, this code is working... I had messed up the versions
that was the problem!

On 22 January 2011 18:09, Pedro Duque pmdu...@gmail.com wrote:

 Hi,

 I'm trying to send a file through email and them open it when it's received
 on the email.

 To send the file I use:
 Intent sendIntent = new
 Intent(Intent.ACTION_SEND_MULTIPLE);

 sendIntent.setType(application/vnd.portugalemgrande.clock);
 sendIntent.putExtra(Intent.EXTRA_SUBJECT, Check this
 out: +cp.getClock_name());
 //Attachs
 ArrayListUri uris = new ArrayListUri();

 uris.add(Uri.parse(file://+fn.getPath()+File.separator+clock+type+.png));

 uris.add(Uri.parse(file://+fn.getPath()+File.separator+clock+type+.dcp));

 sendIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);

 I don't have problems receiving the email back on the terminal, but I can't
 manage to open the .dcp file from the email reader (I can only read it if I
 save it to the sdcard and use a file manager to open it). My intent-filter
 is as follows:

 intent-filter
 action android:name=android.intent.action.MAIN /
 category android:name=android.intent.category.LAUNCHER
 /
 /intent-filter
 intent-filter
 action android:name=android.intent.action.VIEW /
 category android:name=android.intent.category.DEFAULT /
 category android:name=android.intent.category.BROWSABLE
 /
 data
 android:mimeType=application/vnd.portugalemgrande.clock/
 /intent-filter
 intent-filter
 action android:name=android.intent.action.VIEW /
 category android:name=android.intent.category.DEFAULT /
 category android:name=android.intent.category.BROWSABLE
 /
 data android:scheme=file
 android:mimeType=*/*
 android:pathPattern=.*\\.dcp
 android:host=*/
 /intent-filter

 What am I doing wrong?

 Thanks,
 Pedro Duque


-- 
You received this message because you are subscribed to the Google
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] Remote TextView setTag

2011-01-21 Thread Pedro Duque
Hi,

I need to store a persistent string in a remote TextView and I was thinking
about using the Tag attribute to do it, but then I realised that RemoveViews
don't support a method setObject...

Is there any way to make a setTag in a TextView in a RemoteView?

Regards,
Pedro Duque

-- 
You received this message because you are subscribed to the Google
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] Don't show images in SD Card in Android Gallery

2011-01-14 Thread Pedro Duque
Hi,

I'm developing an application that copies some pictures from assets to the
sd card on the first run to be able to change them. My problem is that these
pictures show in the user gallery when they don't have any interest (mainly
it's icons and 9 patchs pics).

How can I tell Gallery that these folders are of no interest?

Thanks,
Pedro Duque

-- 
You received this message because you are subscribed to the Google
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: Don't show images in SD Card in Android Gallery

2011-01-14 Thread Pedro Duque
Kostya,

thanks for the info, but as I'm targeting low specs androids also, I'll
follow Hari suggestion (it's so simple and obvious that I'm ashamed of not
thinking about it myself).

Thanks for the help!!!
PMD

On 14 January 2011 17:18, Kostya Vasilyev kmans...@gmail.com wrote:

 Create a file called .nomedia in the directory you're using to store
 images.

 This is officially supported in 2.3, but, AFAIK, also works in earlier
 versions.


 http://developer.android.com/reference/android/provider/MediaStore.html#MEDIA_IGNORE_FILENAME

 -- Kostya

 2011/1/14 Hari Edo hari@gmail.com


 Have you tried writing them with unusual filename extensions and other
 obfuscation?  Your program may know it's a .png file but many media
 applications would likely ignore a file if it's got a .notpng
 extension.

 If you can delete them after first run, so much the better, but not
 necessary.

 On Jan 14, 12:03 pm, Pedro Duque pmdu...@gmail.com wrote:
  Hi,
 
  I'm developing an application that copies some pictures from assets to
 the
  sd card on the first run to be able to change them. My problem is that
 these
  pictures show in the user gallery when they don't have any interest
 (mainly
  it's icons and 9 patchs pics).
 
  How can I tell Gallery that these folders are of no interest?
 
  Thanks,
  Pedro Duque

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


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


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

[android-developers] Help with Content Providers / Content Resolvers

2011-01-10 Thread Pedro Duque
Hi,

I'm developing an editor for my application data. This application has a
free and a premium version, so each one has it's own content provider with
different authorities to avoid clashes. The editor also have a local content
provider so it can work standalone.

What I want to do is to check for a content provider existence when I start
the editor so I can choose to use the local one, the one from the free
application or the one from the premium application. I've search the
documentation but I can't find a way to list the content providers
available, for ex., for a specific MIME type.

Can somebody help me?

Regards,
PMD

-- 
You received this message because you are subscribed to the Google
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] Help with Content Providers / Content Resolvers

2011-01-10 Thread Pedro Duque
Thank you Kostya, that's exactly what I was looking for!

On 10 January 2011 13:02, Kostya Vasilyev kmans...@gmail.com wrote:

 The mime type mapping works in the other direction: once you have a
 ContentProvider (or more specifically, a URI for a data query) it can be
 used to get the mime type.

 For your task, take a look at:


 http://developer.android.com/reference/android/content/pm/PackageManager.html#queryContentProviders(java.lang.Stringhttp://developer.android.com/reference/android/content/pm/PackageManager.html#queryContentProviders%28java.lang.String,
 int, int)

 If both lite / pro versions share the same user id, you can try using that
 for the first parameter. If not, just filter the results by authority (since
 you know what you expect).

 You can also use:


 http://developer.android.com/reference/android/content/pm/PackageManager.html#getProviderInfo(android.content.ComponentNamehttp://developer.android.com/reference/android/content/pm/PackageManager.html#getProviderInfo%28android.content.ComponentName,
 int)

 by calling it with the lite / pro authorities and checking the return
 value.

 -- Kostya

 10.01.2011 15:50, Pedro Duque пишет:

 Hi,

 I'm developing an editor for my application data. This application has a
 free and a premium version, so each one has it's own content provider with
 different authorities to avoid clashes. The editor also have a local content
 provider so it can work standalone.

 What I want to do is to check for a content provider existence when I
 start the editor so I can choose to use the local one, the one from the free
 application or the one from the premium application. I've search the
 documentation but I can't find a way to list the content providers
 available, for ex., for a specific MIME type.

 Can somebody help me?

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



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

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

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

[android-developers] About viewstubs

2011-01-08 Thread Pedro Duque
I'm trying to gasp viewstubs but I feel I'm missing something.

As I understand, a viewstub only exists in a hierarchy until inflated
or until made visible. After that is replaced by its referenced
layout. This behaviour makes impossible to reinflate a inflated
viewstub. Is this correct?

The behaviour I was looking for was to have several buttons that would
open diferente viewstubs. When I click a button it would deflate the
previous layout and inflate the new one but this only works the first
time... After that the viewstub is gone...

-- 
You received this message because you are subscribed to the Google
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] SQLite setup

2011-01-02 Thread Pedro Duque
Hi,

I need to use a SQLite database in my app (eventually create a Content
Provider) but I'm not really sure how to setup that database. All examples I
saw, the database is created on the fly by issuing a SQL command on the
event onCreate of SQLiteOpenHelper and populating it.

I need to feed the database with almost 400 records to start but it seems
too messy to create a 29Kb string to populate the database. Isn't there a
more elegant way to do it that won't overload the system (I tried to create
a resource with that string...).

Any thoughts?

Thanks,
Pedro Duque

-- 
You received this message because you are subscribed to the Google
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: SQLite setup

2011-01-02 Thread Pedro Duque
I've read about prepopulting the database and looked good to me but I got 
worried about database upgrades...

On 3 de Jan de 2011, at 04:20, Zsolt Vasvari zvasv...@gmail.com wrote:

 Creating 400 reconds should take no more than a few seconds if you
 bracket using transactions.  It won't overload the system by any
 stretch of the imagination.
 
 Whether to go with the asset or create the database on-the-fly
 should depend on your app, but either way is fine.
 
 
 On Jan 3, 11:49 am, Pedro Duque pmdu...@gmail.com wrote:
 Hi,
 
 I need to use a SQLite database in my app (eventually create a Content
 Provider) but I'm not really sure how to setup that database. All examples I
 saw, the database is created on the fly by issuing a SQL command on the
 event onCreate of SQLiteOpenHelper and populating it.
 
 I need to feed the database with almost 400 records to start but it seems
 too messy to create a 29Kb string to populate the database. Isn't there a
 more elegant way to do it that won't overload the system (I tried to create
 a resource with that string...).
 
 Any thoughts?
 
 Thanks,
 Pedro Duque
 
 -- 
 You received this message because you are subscribed to the Google
 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

-- 
You received this message because you are subscribed to the Google
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] Virtual screen size

2010-12-31 Thread Pedro Duque
When developing a live wallpaper how can I get the virtual screen size? How
can I know in which virtual screen the user is in?

Thanks,
PMD

-- 
You received this message because you are subscribed to the Google
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: Virtual screen size

2010-12-31 Thread Pedro Duque
Let me develop on this subject:

I've develop a Live Wallpaper that was working perfectly in Android 2.1. It
emulate the standard Android wallpaper by having a bitmap scrolling when a
user changes screen.

To achieve that effect I use the event onOffsetsChanged to detect screen
changes when the user swipes left and right.

I just installed Android 2.2.1 and now the values returned in onOffsetsChanged
for xPixelOffset and yPixelOffset are always 0. The value for xOffset
and yOffset
do return values from 0 to 1 but because
WallpaperManager.getInstance(myContext).getDesiredMinimumHeight() and
WallpaperManager.getInstance(myContext).getDesiredMinimumHeight() now return
the screen physical size instead of the screen virtual size, I have now way
to calculate how much that percentage represent in terms of actual
displacement.

I know it's possible to achieve the desired result because the packed
wallpaper has that behaviour.

Can somebody help? Is this a problem with Samsung Galaxy S implementation or
is this a standard behaviour?

Thanks,
Pedro Duque

On 1 January 2011 02:05, Pedro Duque pmdu...@gmail.com wrote:

 When developing a live wallpaper how can I get the virtual screen size? How
 can I know in which virtual screen the user is in?

 Thanks,
 PMD


-- 
You received this message because you are subscribed to the Google
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] Content provider persistence

2010-12-29 Thread Pedro Duque
Hi,

I'm writing an application where the user needs to choose a timezone so I'm
using the search capability of Android. For having the time zone as a
recommendation inside the search, I've implemented a Content Provider for
the time zone. The problem is that the content provider remains alive
after the selection is made... and I want to destroy it.

How can I do that?

Thanks,
PMD

-- 
You received this message because you are subscribed to the Google
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] Timezone picker

2010-12-28 Thread Pedro Duque
Hi,

I need to implement a timezone picker, but
TimeZone.getAvailableIDshttp://developer.android.com/reference/java/util/TimeZone.html#getAvailableIDs%28%29()
return is a big mess (at least in Samsung Galaxy S). What I did was:

ListPreference mTimeZone = (ListPreference)
getPreferenceScreen().findPreference(timezone);
String[] timezoneIDs = TimeZone.getAvailableIDs();
mTimeZone.setEntries(timezoneIDs);
mTimeZone.setEntryValues(timezoneIDs);

I tried to make a two level approach splitting the string by the /, but
it's still messy...

Should I implement my own timezone dabatase and forget getAvailableIDs
altogether or is there a way to use it?

Thank you,
Pedro Duque

-- 
You received this message because you are subscribed to the Google
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: Timezone picker

2010-12-28 Thread Pedro Duque
The problem is not the size it's the content itself... and the
getDisplayName is even worse...

You get stuff like America/Bahia with a description of Brasilia Time but
San Francisco or New York is nowhere to be found. :(

PMD

On 28 December 2010 16:01, Pent tas...@dinglisch.net wrote:

  I need to implement a timezone picker, but
  TimeZone.getAvailableIDs
 http://developer.android.com/reference/java/util/TimeZone.html#getAva..
 .()
  return is a big mess (at least in Samsung Galaxy S).

 It is pretty big :-)

 You could copy the nice list from the settings app manually.

 Shame the one from Settings isn't usable programatically actually
 (like so many built-in things... NumberPicker springs to mind). At
 least it wasn't when I last tried.

 Pent

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

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

Re: [android-developers] Re: Timezone picker

2010-12-28 Thread Pedro Duque
Yep, probably that's what I'll do...

although I just found this site: http://citytimezones.info/. They have a
nice free database for cities timezone around the world... I'm tempted do
implement a timezone picker based on it.


On 29 December 2010 00:34, Zsolt Vasvari zvasv...@gmail.com wrote:

 I think all those descriptions actually come from the JDK classes, not
 the Android stuff, and they have been like that for at least the past
 10 years.  Personally, I'd just use them...

 On Dec 29, 6:09 am, Pedro Duque pmdu...@gmail.com wrote:
  The problem is not the size it's the content itself... and the
  getDisplayName is even worse...
 
  You get stuff like America/Bahia with a description of Brasilia Time
 but
  San Francisco or New York is nowhere to be found. :(
 
  PMD
 
  On 28 December 2010 16:01, Pent tas...@dinglisch.net wrote:
 
 
 
I need to implement a timezone picker, but
TimeZone.getAvailableIDs
  http://developer.android.com/reference/java/util/TimeZone.html#getAva..
   .()
return is a big mess (at least in Samsung Galaxy S).
 
   It is pretty big :-)
 
   You could copy the nice list from the settings app manually.
 
   Shame the one from Settings isn't usable programatically actually
   (like so many built-in things... NumberPicker springs to mind). At
   least it wasn't when I last tried.
 
   Pent
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 android-developers%2bunsubs­cr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en- Hide quoted
 text -
 
  - Show quoted text -

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


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

Re: [android-developers] Re: Libgdx vs. andengine

2010-12-22 Thread Pedro Duque
Mario,

thank you for your informed and quite complete post.

My main concern is that I don't want to divert too much from Android
concepts and I'm afraid that using Lidgdx will lead me into new and strange
concepts from Android while AndEngine is more integrated with Android way.

Anyway I'll follow your suggestion: I will try to evaluate both to get an
hands on decision (maybe I'll blog about the experience).

Thank you,
Pedro Duque

On 22 December 2010 23:49, Mario Zechner badlogicga...@gmail.com wrote:

 Full disclosure: i'm the developer of libgdx.

 I think both have it's merits. Andengine will get you up and running
 faster than libgdx but is less flexible and slower in terms of
 rendering speed. It has a couple of nice features though that libgdx
 doesn't have (and vice versa).

 Libgdx is not a game engine like Andengine but more like a framework.
 We also have a fully functional 2D scene graph which is a tad bit more
 powerful than Andengine's layer concept. The downside is that you'll
 have to code custom nodes yourself. As a scene graph is most often
 overkill we also let you go a little bit more low level. Look into
 SpriteBatch and SpriteCache. And if you want to go fullblown OpenGL ES
 that's possible as well, nothing will interfer with your code :)

 Apart from that i'd say that you shouldn't overlook the cross-platform
 feature. If you don't want to deploy your game on the desktop that is
 totally fine. However, you can benefit from the extremely fast
 development times as you can code/run/debug on the desktop for 99% of
 the time instead of having to wait for the slow installation of every
 new apk you produce. Think of it as a lighting fast replacement for
 the slow emulator.

 We also have full javadocs, full 2D and 3D example games and are
 currently also creating wiki articles to help users out.

 Again, Andengine is really cool so i won't tell you to ignore it. It
 has a lot of stuff going for it. It uses our box2d wrapper and vector
 classes as well (among other things), so the physics are nearly
 identical. I just added a new feature today that was missing so far:
 box2d raycasting. I don't know when Nicolas will synch with upstream.
 That shouldn't keep you from using Andengine though.

 Evaluate both, they both have a pretty minimal setup cost and should
 be straight forward to get into.

 Ciao,
 Mario
 (http://www.badlogicgames.com)

 On 22 Dez., 05:34, Pedro Duque pmdu...@gmail.com wrote:
  I'm starting a new Android project and I need an opinion. The project
 needs a 2d physics engine and OpenGL.
 
  I looked into libgdx and andengine and both seem to fit although I don't
 think I'll need the cross platform features from libgdx.
 
  Which one is more suitable? Advantages/disadvantages? Opinions?
 
  Thank you,
  Pedro Duque

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

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

[android-developers] Libgdx vs. andengine

2010-12-21 Thread Pedro Duque
I'm starting a new Android project and I need an opinion. The project needs a 
2d physics engine and OpenGL.

I looked into libgdx and andengine and both seem to fit although I don't think 
I'll need the cross platform features from libgdx.

Which one is more suitable? Advantages/disadvantages? Opinions?

Thank you,
Pedro Duque

-- 
You received this message because you are subscribed to the Google
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: Application unavailable in Android Market

2010-12-14 Thread Pedro Duque
Hi Hassan,

This is my AndroidManifest.xml file:

?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
  package=com.portugalemgrande.LiveGalleryGold android:versionCode=4
android:versionName=1.1
application android:icon=@drawable/icon
 android:label=@string/app_name
android:debuggable=false
service android:label=@string/app_name
 android:icon=@drawable/icon
 android:enabled=true
android:permission=android.permission.BIND_WALLPAPER
android:name=com.portugalemgrande.LiveGalleryGold.LiveGallery
intent-filter android:priority=1 
action
android:name=android.service.wallpaper.WallpaperService /
/intent-filter
meta-data android:name=android.service.wallpaper
 android:resource=@xml/wallpaper /
/service
activity android:exported=true
android:label=@string/LiveGallery_Settings
android:name=com.portugalemgrande.LiveGalleryGold.LiveGalleryPreferences
/activity
activity
android:label=Home
android:exported=true
android:name=com.portugalemgrande.LiveGalleryGold.MarketActivity
intent-filter
action android:name=android.intent.action.MAIN /
category android:name=android.intent.category.INFO /
/intent-filter
/activity

activity android:exported=true
android:name=com.portugalemgrande.LiveGalleryGold.About/activity
/application
*uses-sdk android:minSdkVersion=7 android:targetSdkVersion=7/
*uses-feature
android:name=android.software.live_wallpaper/uses-feature
uses-permission android:name=com.android.vending.CHECK_LICENSE /
/manifest

As you can see, I've set the minSdkVersion but not for resolution. Is that
mandatory? Because the application should work with any resolution...

Best regards,
Pedro Duque

On 13 December 2010 06:56, Muhammad Ali zaandr...@gmail.com wrote:

 Hi,

   I am sure you did not set the AndroidManifest.xml parameters for
 your application the resolution and the min sdk version. You should
 take a look of the parameter for this particular file.

 Thanks
 Muhammad Ali Hassan

 On Dec 10, 11:35 pm, Pedro Duque pmdu...@gmail.com wrote:
  Hi,
 
  I've two applications in Android Market, Live Gallery
  (com.portugalemgrande.LiveGallery) which is a free application and Live
  Gallery Gold (com.portugalemgrande.LiveGalleryGold) which is the paid
  version.
 
  Although I can see both of them in my phone (in Portugal) if I use a
 similar
  friend's phone the app doesn't appear. Shouldn't it be available on all
  Android Markets? Is there anything we should do to make it available
  worldwide?
 
  Can you search for it in your market just to see if you can find this
 apps?
  Please report here with country please.
 
  Thank you!
  Pedro Duque

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


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

Re: [android-developers] Application unavailable in Android Market

2010-12-11 Thread Pedro Duque
Thank you for the feedback Stephen. The copy protection is off as I'm using
LVL.

It's working on my Galaxy S :(

Regards,
Pedro Duque

On 11 December 2010 03:01, Stephen Jungels sjung...@gmail.com wrote:

 Your apps are visible in the US market on my Droid X (Android 2.2)
 test device.  They're not visible on my Galaxy S (2.1) test device.
 One thing to look at is the copy protection setting in the developer
 console.

 --SJ

 On Fri, Dec 10, 2010 at 9:27 PM, Pedro Duque pmdu...@gmail.com wrote:
  Thank you TreKing,
 
  Of course I'm limiting the test to =Eclair version. I tried it on a
 Galaxy
  Tab and other Samsung Galaxy S... but maybe it's a problem in Portuguese
  Android Market.
 
  I'm trying to get more tests locally.
 
  Thanks again,
  Pedro Duque
 
  On 10 December 2010 18:42, TreKing treking...@gmail.com wrote:
 
  On Fri, Dec 10, 2010 at 12:35 PM, Pedro Duque pmdu...@gmail.com
 wrote:
 
  Shouldn't it be available on all Android Markets?
 
  No. Not all phones support Live Wallpapers.
 
 
  Is there anything we should do to make it available worldwide?
 
  See the section on Market filters in the documentation. But that still
  won't prevent it not showing on phones that don't support it.
 
 
  Can you search for it in your market just to see if you can find this
  apps?
 
  I see it - US Nexus One, 2.2.1
 
 
 -
  TreKing - Chicago transit tracking app for Android-powered devices
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to
 android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en

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


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

[android-developers] Re: Application unavailable in Android Market

2010-12-11 Thread Pedro Duque
Hi Kostya,

Thank you for e feedback. I've tried to find it with a Samsung Galaxy
Tab (android 2.2) without success while I never had any problem with
my samsung galaxy S (android 2.1).

I'm really in the dark... Do you know if there is any support from
google about Android Market?

Warm Regards,
Pedro Duque

On Saturday, 11 December 2010, Kostya Vasilyev kmans...@gmail.com wrote:






 Pedro,

 Both apps are visible on a Samsung Galaxy S with Android 2.2.

 Both not there on an HTC Hero with 2.1.

 I am in Russia.

 Looks like you are requesting a feature that's only supported by 2.2
 (???), or perhaps one is implicit.

 -- Kostya

 12.12.2010 0:49, Pedro Duque пишет:
 Thank you for the feedback Stephen. The copy
   protection is off as I'm using LVL.

   It's working on my Galaxy S :(

   Regards,
   Pedro Duque

   On 11 December 2010 03:01, Stephen
 Jungels sjung...@gmail.com
 wrote:
 Your apps are visible in the US market on
   my Droid X (Android 2.2)
   test device.  They're not visible on my Galaxy S (2.1) test
   device.
   One thing to look at is the copy protection setting in the
   developer
   console.

 --SJ



   On Fri, Dec 10, 2010 at 9:27 PM, Pedro Duque pmdu...@gmail.com
   wrote:
Thank you TreKing,
   
Of course I'm limiting the test to =Eclair
   version. I tried it on a Galaxy
Tab and other Samsung Galaxy S... but maybe it's a
   problem in Portuguese
Android Market.
   
I'm trying to get more tests locally.
   
Thanks again,
Pedro Duque
   
On 10 December 2010 18:42, TreKing treking...@gmail.com
   wrote:
   
On Fri, Dec 10, 2010 at 12:35 PM, Pedro Duque
   pmdu...@gmail.com
   wrote:
   
Shouldn't it be available on all Android
   Markets?
   
No. Not all phones support Live Wallpapers.
   
   
Is there anything we should do to make it
   available worldwide?
   
See the section on Market filters in the
   documentation. But that still
won't prevent it not showing on phones that don't
   support it.
   
   
Can you search for it in your market just to
   see if you can find this
apps?
   
I see it - US Nexus One, 2.2.1
   
   
 -
TreKing - Chicago transit tracking app for
   Android-powered devices
   
--
You received this message because you are
   subscribed to the Google
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
   


--

  You received this message because you
   are subscribed to the Google
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+unsubscri
   --
   You received this message because you are subscribed to the Google
   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



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






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

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

[android-developers] Authorizing Purchase problem

2010-12-10 Thread Pedro Duque
I just posted a application to Android Market: Live Gallery Gold. It's a
paid live wallpaper that is using LVL to authenticate users.

Now, when I try to buy my own application I get a server error at
Authorizing Purchase. Is this normal? Can't I buy my own apps? Is it a
problem related to LVL? I don't have any problem buying other
applications...

Please any suggestion will be welcome.

Thank you,
Pedro Duque

-- 
You received this message because you are subscribed to the Google
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: Authorizing Purchase problem

2010-12-10 Thread Pedro Duque
YuviDroid, Brill Pappin and TreKing

thank you for your answers. It was really really helpful. I was worrying to
have wasted all that develoment and testing time.

Meanwhile the app is not showing in some devices, but I'll send another
post.

Thank you!
Pedro Duque

On 10 December 2010 15:37, Brill Pappin br...@pappin.ca wrote:

 It's a policy limitation from Google Checkout (I just went through the same
 issue).
 If your like me, you want to be able to use your app so that you get a feel
 for what needs changing/fixing.

 What I ended up doing was to create a special flag that will disable the
 license check for private use.
 This also allows me to distribute a copy to my testers manually.

 - Brill

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


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

[android-developers] Application unavailable in Android Market

2010-12-10 Thread Pedro Duque
Hi,

I've two applications in Android Market, Live Gallery
(com.portugalemgrande.LiveGallery) which is a free application and Live
Gallery Gold (com.portugalemgrande.LiveGalleryGold) which is the paid
version.

Although I can see both of them in my phone (in Portugal) if I use a similar
friend's phone the app doesn't appear. Shouldn't it be available on all
Android Markets? Is there anything we should do to make it available
worldwide?

Can you search for it in your market just to see if you can find this apps?
Please report here with country please.

Thank you!
Pedro Duque

-- 
You received this message because you are subscribed to the Google
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] Application unavailable in Android Market

2010-12-10 Thread Pedro Duque
Thank you TreKing,

Of course I'm limiting the test to =Eclair version. I tried it on a Galaxy
Tab and other Samsung Galaxy S... but maybe it's a problem in Portuguese
Android Market.

I'm trying to get more tests locally.

Thanks again,
Pedro Duque

On 10 December 2010 18:42, TreKing treking...@gmail.com wrote:

 On Fri, Dec 10, 2010 at 12:35 PM, Pedro Duque pmdu...@gmail.com wrote:

 Shouldn't it be available on all Android Markets?


 No. Not all phones support Live Wallpapers.


  Is there anything we should do to make it available worldwide?


 See the section on Market filters in the documentation. But that still
 won't prevent it not showing on phones that don't support it.


 Can you search for it in your market just to see if you can find this
 apps?


 I see it - US Nexus One, 2.2.1


 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

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

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

[android-developers] Help with LiveWallpaper and Camera

2010-11-22 Thread Pedro Duque
Hi,

I'm trying to understand camera development and started with a very simple
live wallpaper:

package com.example.LiveCamera;
import java.io.IOException;
import android.hardware.Camera;
import android.service.wallpaper.WallpaperService;
import android.util.Log;
import android.view.SurfaceHolder;

public class LiveCamera extends WallpaperService {

@Override
public Engine onCreateEngine() {
android.os.Debug.waitForDebugger();


return new LiveCameraEngine();
}

public class LiveCameraEngine extends Engine {
private Camera mCamera;

LiveCameraEngine() {

android.os.Debug.waitForDebugger();

}

@Override
public void onSurfaceCreated(SurfaceHolder holder) {
super.onSurfaceCreated(holder);
this.mCamera = Camera.open();
try {
this.mCamera.setPreviewDisplay(holder);
} catch (IOException e) {
Log.d(onSurfaceCreated,Error in
Camera.setPreviewDisplay+e);
}

}

@Override
public void onSurfaceChanged(SurfaceHolder holder, int format, int
w, int h) {
final Camera.Parameters parameters =
this.mCamera.getParameters();
parameters.setPreviewSize(w, h);
this.mCamera.setParameters(parameters);
this.mCamera.startPreview();

 }

@Override
public void onSurfaceDestroyed(SurfaceHolder holder) {
super.onSurfaceDestroyed(holder);

// Surface will be destroyed when we return, so stop the
preview.
// Because the CameraDevice object is not a shared resource,
it's very
// important to release it when the activity is paused.
mCamera.stopPreview();
mCamera.release();
mCamera = null;
}

   }
}


I always get this runtime error on the Camera.startPreview:
11-20 06:18:52.543: ERROR/AndroidRuntime(2054): java.lang.RuntimeException:
startPreview failed
11-20 06:18:52.543: ERROR/AndroidRuntime(2054): at
android.hardware.Camera.startPreview(Native Method)
11-20 06:18:52.543: ERROR/AndroidRuntime(2054): at
com.example.LiveCamera.LiveCamera$LiveCameraEngine.onSurfaceChanged(LiveCamera.java:46)
11-20 06:18:52.543: ERROR/AndroidRuntime(2054): at
android.service.wallpaper.WallpaperService$Engine.updateSurface(WallpaperService.java:566)
...

Is this related to be using it with a LiveWallpaper? I'm using android-7 as
target and I get the same error in the phone (Samsung Galaxy S) and on the
Emulator...

Any idea on what the error might be?

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] Help getting screen number

2010-11-22 Thread Pedro Duque
Hi,

I need to get the screen number a user is seeing and the total screens in
home application. I can't find this info anywhere in the API.

Can you help me?

Thanks,
Pedro Duque

-- 
You received this message because you are subscribed to the Google
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