[android-developers] Contacts: to show or not to show?

2014-04-10 Thread Mirko Schenk
Hi,

I'm getting a list of contacts with getContentResolver().query( 
ContactsContract.Groups.CONTENT_URI, ... ).
This works quite well, but I also get a lot of google+ contacts which don't 
show up in the People app or other contact selections.
I found some information about an UNGROUPED_VISIBLE setting of the 
account, but I couldn't even find out how to get the account of a contact. 
And I'm not even sure that's all to check.
I did check whether the contact is in invisible groups, but it looks like 
the troublesome contacts aren't in any group at all. Checking 
IN_VISIBLE_GROUP on the other hand removed contacts without group 
assignments I'd like to see.
So, how to get rid of contacts that shouldn't be visible?

TIA,
Mirko

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] MediaPlayer.setNextMediaPlayer

2012-07-03 Thread Mirko Schenk
Hi,

is there any additional information about how to use setNextMediaPlayer in 
Jelly Bean?
I mean, it's fairly easy to start with, just prepare a new MediaPlayer and 
pass it to setNextMediaPlayer.
But some time in the future, my app still has the reference to the old 
MediaPlayer while the new one is playing, or maybe even both instances are 
playing during some kind of crossfade. So how to pause/continue, stop, etc. 
reliable? Is it enough/OK to set the current instance to the (previously) 
next one in an OnCompletionListener?

Regards
Mirko

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
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] difference between @+id and @android:id - potential problems?

2012-05-25 Thread Mirko
So, is there possibility to create an id in a lower namespace? ...as id in 
file only


Il giorno sabato 30 agosto 2008 10:45:27 UTC+2, Romain Guy ha scritto:

 Hi,

 @+id/foo means you are creating an id named foo in the namespace of
 your application. You can refer to it using @id/foo. @android:id/foo
 means you are referring to an id defined in the android namespace.
 This namespace is the namespace of the framework. In this case, you
 need to use @android:id/list and @android:id/empty because these are
 the id the framework expects to find (the framework knows only about
 the ids in the android namespace.)

 The XML layout editor doesn't know how you will use your layout and
 generates by default ids that are in your application namespace. So
 the XML format is correct, it's not a compile time error, but really a
 runtime error.

 On Fri, Aug 29, 2008 at 11:58 PM, etooler etil...@gmail.com wrote:
 
  Hi All,
 
  Just starting with this and noticed an interesting problem when doing
  the Notepad V1 tutorial...
 
  In step 4, it says to create an XML file that looks like this:
 
  ?xml version=1.0 encoding=utf-8?
  LinearLayout xmlns:android=http://schemas.android.com/apk/res/
  android
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 
   ListView android:id=@android:id/list
 android:layout_width=wrap_content
 android:layout_height=wrap_content/
   TextView android:id=@android:id/empty
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:text=@string/no_notes/
 
  /LinearLayout
 
  If I do this, everything works OK.
 
  However, I decided to use the Layout view tool in eclipse and use that
  to insert the ListView and TextView above. It instead uses
  android:id=@+id/list and android:id=@+id/empty. When I go to run
  using this, I do not get any compile time warnings, however, my
  application throws up a The application has stopped unexpectedly
  error.
 
  My questions are:
 
  a.) What is the difference between the two formats?
  b.) Why does the Layout Viewer create XML in a format that does not
  work?
  c.) Should this type of error be picked up at compile time?
 
  Another point, when I open up the LunarLander sample project and open
  up the lunar_layout.xml file using the Layout viewer, I get an
  exception: NotfoundException: Could not find drawable resource
  matching value 0x7F020001 (resolved name: earthrise) in current
  configuration. The application does compile and deploy however.
 
  I am using version 0.7.1.v200808141910-98467 as reported from eclipse
  for the android tools.
 
 
  
 

 -- 
 Romain Guy
 www.curious-creature.org



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
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] difference between @+id and @android:id - potential problems?

2012-05-25 Thread Mirko
Hi all,
is there possibility to create an id in a lower namespace? ...as id in file 
only



Il giorno sabato 30 agosto 2008 10:45:27 UTC+2, Romain Guy ha scritto:

 Hi,

 @+id/foo means you are creating an id named foo in the namespace of
 your application. You can refer to it using @id/foo. @android:id/foo
 means you are referring to an id defined in the android namespace.
 This namespace is the namespace of the framework. In this case, you
 need to use @android:id/list and @android:id/empty because these are
 the id the framework expects to find (the framework knows only about
 the ids in the android namespace.)

 The XML layout editor doesn't know how you will use your layout and
 generates by default ids that are in your application namespace. So
 the XML format is correct, it's not a compile time error, but really a
 runtime error.

 On Fri, Aug 29, 2008 at 11:58 PM, etooler etil...@gmail.com wrote:
 
  Hi All,
 
  Just starting with this and noticed an interesting problem when doing
  the Notepad V1 tutorial...
 
  In step 4, it says to create an XML file that looks like this:
 
  ?xml version=1.0 encoding=utf-8?
  LinearLayout xmlns:android=http://schemas.android.com/apk/res/
  android
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 
   ListView android:id=@android:id/list
 android:layout_width=wrap_content
 android:layout_height=wrap_content/
   TextView android:id=@android:id/empty
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:text=@string/no_notes/
 
  /LinearLayout
 
  If I do this, everything works OK.
 
  However, I decided to use the Layout view tool in eclipse and use that
  to insert the ListView and TextView above. It instead uses
  android:id=@+id/list and android:id=@+id/empty. When I go to run
  using this, I do not get any compile time warnings, however, my
  application throws up a The application has stopped unexpectedly
  error.
 
  My questions are:
 
  a.) What is the difference between the two formats?
  b.) Why does the Layout Viewer create XML in a format that does not
  work?
  c.) Should this type of error be picked up at compile time?
 
  Another point, when I open up the LunarLander sample project and open
  up the lunar_layout.xml file using the Layout viewer, I get an
  exception: NotfoundException: Could not find drawable resource
  matching value 0x7F020001 (resolved name: earthrise) in current
  configuration. The application does compile and deploy however.
 
  I am using version 0.7.1.v200808141910-98467 as reported from eclipse
  for the android tools.
 
 
  
 

 -- 
 Romain Guy
 www.curious-creature.org



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
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 happend on 02/14 on Verizon?

2012-02-29 Thread Mirko Schenk
Hi,

maybe it's just some strange coincidence, but thanks to the improved
statistics I noticed that according to those stats, about 10,000 users
uninstalled my app on 02/14 - almost all of them being Verizon users.
All other countries and providers remained stable. I also didn't do an
update or anything else on that day or the few before.
Did something special happen that day on Verizon, like a special
offer, an own Market alternative, or something like that?
Did this only happen to my app, regard a category (it's a music
player), or is this a general phenomenon?

Regards
Mirko

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
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 implement custom device photos gallery for android?

2010-12-15 Thread Mirko Borivojevic
Hi, I'm working on android application that will have basic image
gallery functionality included. I've managed to build activity that
fetches list of photos from my application backend API and render them
in android gridview within activity layout.

However I'm having difficulties to build same gallery experience for
user's device photos that were taken by camera and stored on device.
Two solutions I considered were:
1. Building my own image gallery.
2. Starting default android image gallery using intent.

Solution 1: I belive that first solution will take me too much time to
developed. I started with this tutorial but as soon I implemented it I
found out that it is running too slow. Then I take a look at android
camera source code to find solution but again I found that it will
take me too much time to review the code and to build my own gallery
from scratch. I also believe that it is not in Android OS philosophy
to rewrite functionalities that already exists but to use Intents to
start activities that can handle actions you need. This lead me to
second solution.

Solution 2: I tried calling default android gallery using intent in
order to browse user's device photos by soon I was stuck again.
Problem this time was that as soon as user tap on photo, gallery exits
and returns to activity that originaly started it, and I expected (and
I want) to start large image preview instead. I saw that others had
this problem too how to open gallery via intent without result.
Because I didn't find the fix for this I decided to quit.

My question is how can I overcome these problems and build gallery
that is similar to one I already have for web photos. If anyone could
give me reference I would be most thankful.

Link to stackowerflow question:
http://stackoverflow.com/questions/4438935/how-to-implement-custom-device-photos-gallery-for-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


[android-developers] Re: Device Seeding Program for Top Android Market Developers

2010-04-12 Thread Mirko Nasato
Yeah why don't you two launch your own free gift program, only to call
it off some time later? There wouldn't be nothing wrong with that
according to your reasoning, right? :)

Kind regards

Mirko

On Apr 12, 3:16 pm, Thomas Riley tomrile...@googlemail.com wrote:
 I agree with Al, in some ways, If Google suddenly said it's not doing
 the program any more we couldn't complain as it's a free gift.
 However, the lab attendees, forum supporters and free app developers
 all have a combined positive effect on the Android platform.

 Anyway Al, fancy doing an AndAppStore DeviceSeedingprogram ? :p

 Tom.

 On Apr 12, 1:49 pm, Al Sutton a...@funkyandroid.com wrote:

  If they were only going to paid-app developers I'd understand your
  point, but theseedingprogram is getting devices to lab attendees,
  forum supporters and free app developers as well as paid ones, so
  there are a fair number of people in there that won't be making
  anything back for Google because either they won't release apps or
  they won't charge for them.

  As you're no worse off than before you got your email I don't see why
  you're sad, I'd understand being sad if you'd had to do something or
  pay something specifically to qualify for the 'phone, but in this case
  they're rewards for past actions, so you haven't really been put-out
  and you're definitely not out of pocket if the 'phone doesn't turn up.

  Al.


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: ADC2 Results Post

2009-11-06 Thread mirko
Hi, here is the list...

http://code.google.com/intl/de-DE/android/adc/adc2_top200.html

Our App 'PickYouUp' is on the list, so we are in round2! But we did
not get a mail from Google right now.

Mirko

On 5 Nov., 23:57, jgostylo jgost...@gmail.com wrote:
 Congratulations Dan!  It looks like your app is pretty good.  I did
 not get to review any apps worth while but I assume there were some
 pretty good ones out there.

 My app The Great Land Grab ended up in the top 50%.  Interesting to
 see that there was a top 25% rating.  I believe I was also hurt by the
 fact that my app just did not work outside the US (no data to load).
 Nothing in the rules saying that it would not be judged outside the
 US, I just assumed it was a US only competition.  My friend said I did
 that because I am a xenophobe.  Well if I am then I probably deserve
 the loss ;).

 On Nov 5, 4:40 pm, Dan Sherman impact...@gmail.com wrote:

  We just got ours :)

  Congratulations! Your application 'ProjectINF ADC' was selected by Android
  users as one of the top 20 in the Arcade category! We're excited that you
  chose to participate in the ADC 2 and wish you luck in the final round as
  your application is evaluated by users and a panel of judges.

  We've got some screenshots over onhttp://www.chickenbrickstudios.com:)

  - Dan

  On Thu, Nov 5, 2009 at 5:21 PM, Maan Najjar maan.naj...@gmail.com wrote:
   I didn't get anything too ...

   On Thu, Nov 5, 2009 at 5:09 PM, f_heft delphik...@gmail.com wrote:

   I didn't get a mail so far ... :(
   Are these mails beeing send over the next few hours or did I somehow
   miss it?

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

2009-10-27 Thread mirko

Hi Mariano,

I use close only once. The DB object is held in an Android service.
When the service stops the DB object is closed. I think you should not
have two opened DB objects at the same time.

Mirko

On 23 Okt., 22:09, Mariano Kamp mariano.k...@gmail.com wrote:
 Hey Mirko,
   thank you very much for taking the time to give me such a detailed and
 easy to understand answer.

   I think that I already have implemented my code the way you describe as I
 originally started out with the Notepad
 examplehttp://developer.android.com/guide/tutorials/notepad/notepad-ex1.htmland
 that does it the same way. Except that I don't use transactions.
 However
 in the lock situation from above (see the two stack traces I quoted above)
 the concurrent accesses were reads, so the transactions idea doesn't apply,
 or does it?

   Reading your mail I thought of something else. Maybe I should open a read
 only database? That would be a separate instance then.

   mAllPurposeDatabase = dbOpenerHelper.getWritableDatabase();
   mSlowQueryDatabase =  dbOpenerHelper.getReadableDatabase();

   And then I will direct the slow queries always to the 2nd instance. It
 wouldn't matter much if the database contains old data, it's just used for
 search. I may 
 setLockingEnabled()http://developer.android.com/reference/android/database/sqlite/SQLite...)to
 false, but as the queries are slow it probably won't matter much.

   Something completely different. Do you use close() on the database at all?
 If so, when?

 Cheers,
 Mariano

 On Fri, Oct 23, 2009 at 7:16 PM, mirko mirkocze...@googlemail.com wrote:

  Hi Mariano,

  I had the same problems with my app. After reading a little bit on the
  SQLite Website my understanding was that locking is done with process
  (thread) locks. So there are many reader treads possible, but only one
  writer thread. For this reason your SQLiteDatabase object needs to be
  a singleton. I think otherwise the database file will be opened
  several times. In my app I get the singleton with:

  mDatabase = dbOpenerHelper.getWritableDatabase();

  This is only called once and every call to the Database uses the same
  mDatabase object,

  Every time I read in the database I do not open a transaction, only a
  cursor, like this:

         public static PlaylistItem queryCurrentTrackInDB(SQLiteDatabase db,
  String playlistID) {
                 PlaylistItem ret = null;
                 String whereClause = PlaylistItem.COL_PLAYLIST_ID + =?;
                 String[] whereValues = new String[] { playlistID };
                 String orderClause = PlaylistItem.COL_CURRENT_TRACK + 
  DESC, +
  PlaylistItem.COL_NUMBER;
                 Cursor cur = db.query(IConstants.PLAYLIST_TABLE, null,
  whereClause,
  whereValues, null, null, orderClause, 2);
                 if (cur.moveToFirst()) {
                         ret = new PlaylistItem(cur);
                 }
                 cur.close();
                 return ret;
         }

  Every time I write to the database I use a transaction:

         public static boolean deletePlaylistByID(SQLiteDatabase db, String
  playlistID) {
                 db.beginTransaction();
                 int r = 0;
                 try {
                         String whereClause = PlaylistItem.COL_PLAYLIST_ID +
  =?;
                         String[] whereValues = new String[] { playlistID};
                         r = db.delete(IConstants.PLAYLIST_TABLE,
  whereClause, whereValues);
                         db.setTransactionSuccessful();
                 } finally {
                         db.endTransaction();
                 }
                 return r  0;
         }

  I have a lot of concurrency in my app and after changing it the
  described way it works quite well.

  Mirko

  On 23 Okt., 18:14, Mariano Kamp mariano.k...@gmail.com wrote:
   Hi,

     I have implemented a slow search provider that queries my database. Now
   when at the same time I do another read access my applications stalls
  (ANR).

     It's both read and I don't see why there should be a lock. What are my
   options to get a little more concurrency here?

   Cheers,
   Mariano

   Here are the two threads that block each other.

   One:
   main prio=5 tid=3 WAIT
     | group=main sCount=1 dsCount=0 s=N obj=0x4001db08 self=0xbc48
     | sysTid=2680 nice=0 sched=0/0 handle=-1343996920
     at java.lang.Object.wait(Native Method)
     - waiting on 0x271f30 (a java.lang.VMThread)
     at java.lang.Thread.parkFor(Thread.java:1499)
     at java.lang.LangAccessImpl.parkFor(LangAccessImpl.java:48)
     at sun.misc.Unsafe.park(Unsafe.java:319)
     at java.util.concurrent.locks.LockSupport.park(LockSupport.java:117)
     at

  java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:680)
     at

  java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:710

[android-developers] Re: Sqlite3 concurrency

2009-10-23 Thread mirko

Hi Mariano,

I had the same problems with my app. After reading a little bit on the
SQLite Website my understanding was that locking is done with process
(thread) locks. So there are many reader treads possible, but only one
writer thread. For this reason your SQLiteDatabase object needs to be
a singleton. I think otherwise the database file will be opened
several times. In my app I get the singleton with:

mDatabase = dbOpenerHelper.getWritableDatabase();

This is only called once and every call to the Database uses the same
mDatabase object,

Every time I read in the database I do not open a transaction, only a
cursor, like this:

public static PlaylistItem queryCurrentTrackInDB(SQLiteDatabase db,
String playlistID) {
PlaylistItem ret = null;
String whereClause = PlaylistItem.COL_PLAYLIST_ID + =?;
String[] whereValues = new String[] { playlistID };
String orderClause = PlaylistItem.COL_CURRENT_TRACK +  DESC, +
PlaylistItem.COL_NUMBER;
Cursor cur = db.query(IConstants.PLAYLIST_TABLE, null, 
whereClause,
whereValues, null, null, orderClause, 2);
if (cur.moveToFirst()) {
ret = new PlaylistItem(cur);
}
cur.close();
return ret;
}


Every time I write to the database I use a transaction:

public static boolean deletePlaylistByID(SQLiteDatabase db, String
playlistID) {
db.beginTransaction();
int r = 0;
try {
String whereClause = PlaylistItem.COL_PLAYLIST_ID + 
=?;
String[] whereValues = new String[] { playlistID};
r = db.delete(IConstants.PLAYLIST_TABLE, whereClause, 
whereValues);
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
return r  0;
}

I have a lot of concurrency in my app and after changing it the
described way it works quite well.

Mirko

On 23 Okt., 18:14, Mariano Kamp mariano.k...@gmail.com wrote:
 Hi,

   I have implemented a slow search provider that queries my database. Now
 when at the same time I do another read access my applications stalls (ANR).

   It's both read and I don't see why there should be a lock. What are my
 options to get a little more concurrency here?

 Cheers,
 Mariano

 Here are the two threads that block each other.

 One:
 main prio=5 tid=3 WAIT
   | group=main sCount=1 dsCount=0 s=N obj=0x4001db08 self=0xbc48
   | sysTid=2680 nice=0 sched=0/0 handle=-1343996920
   at java.lang.Object.wait(Native Method)
   - waiting on 0x271f30 (a java.lang.VMThread)
   at java.lang.Thread.parkFor(Thread.java:1499)
   at java.lang.LangAccessImpl.parkFor(LangAccessImpl.java:48)
   at sun.misc.Unsafe.park(Unsafe.java:319)
   at java.util.concurrent.locks.LockSupport.park(LockSupport.java:117)
   at
 java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:680)
   at
 java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:710)
   at
 java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1040)
   at
 java.util.concurrent.locks.ReentrantLock$FairSync.lock(ReentrantLock.java:193)
   at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:252)
   at android.database.sqlite.SQLiteDatabase.lock(SQLiteDatabase.java:292)
   at
 android.database.sqlite.SQLiteDatabase.addSQLiteClosable(SQLiteDatabase.java:221)
   at android.database.sqlite.SQLiteProgram.i
 nit(SQLiteProgram.java:57)
   at android.database.sqlite.SQLiteQuery.init(SQLiteQuery.java:49)
   at
 android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:49)
   at
 android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1118)
   at
 android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1092)
   at com.newsrob.DB.findCursorByQueryString(DB.java:419)
   at com.newsrob.EntryManager.getArticleAsCursor(EntryManager.java:1010)
   at
 com.newsrob.activities.ShowArticleActivity.onCreate(ShowArticleActivity.java:81)
   at
 android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
   at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
   at
 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
   at android.app.ActivityThread.access$2100(ActivityThread.java:116)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at android.os.Looper.loop(Looper.java:123)
   at android.app.ActivityThread.main(ActivityThread.java:4203)
   at java.lang.reflect.Method.invokeNative(Native Method)
   at java.lang.reflect.Method.invoke(Method.java:521

[android-developers] Re: Associate app to open email attachments

2009-07-14 Thread Mirko Nasato

On Jul 10, 7:13 pm, Alexey Krasnoriadtsev ale...@agilefusion.com
wrote:
 You are correct that you should use contentResolver.openInputStream
 (uri), to get the data from gmailattachments.

Thanks Alexey, will try that for integrating with the GMail app.

 Default Email app, is very dumb and is hardcoded to only open audio
 and imageattachments.
 (disclaimer, that was the case 6 month ago, the last time i looked at
 it).

That's still the case, looking at the 1.5r2 source:
com.android.email.Email uses a hard-coded array of
ACCEPTABLE_ATTACHMENT_VIEW_TYPES.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
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] Associate app to open email attachments

2009-07-09 Thread Mirko Nasato

Hi all,

I've written an app that can handle the VIEW action for a given
mimeType, say application/foo. By adding the following to
AndroidManifest.xml the Browser automatically uses my app to open
downloads of that type:

  intent-filter
 action android:name=android.intent.action.VIEW/
 category android:name=android.intent.category.DEFAULT/
 data android:mimeType=application/foo/
  /intent-filter

The GMail app also tries to use my app to Preview attachments of that
type, but it's passing a URI with scheme gmail-ls:// rather than a
file:// URI. I guess I need to use a ContentProvider to get the
attachment data, I haven't looked into that yet.

But the real mystery is the Email app... there just doesn't seem any
way to make it open the attachments.

Any pointers? Opening attachments is a very common requirement of
course, and I would expect the Android platform to encourage
developers to write apps to handle more mime types. Instead I couldn't
find any answers:

  
http://groups.google.com/group/android-developers/browse_thread/thread/d0455a53d0265298
  
http://groups.google.com/group/android-developers/browse_thread/thread/b540ad05825fe6ca

Thanks

Mirko

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
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: Polite discussion of lite/trial vs pro distribution

2009-05-14 Thread mirko

Hi Mariano,

yes, I know what you mean. I was in the same position and wanted to
start before my 'competitors', so I decided to start very early with a
free 'beta'. I think this was the right direction because it still the
only application for this porpose. I will keep a limited version in
the future and will start the next weeks with a 'Pro license' that
will switch off some limitations in the free version. Now we can offer
paid apps from Germany. We will see, which negative comments I will
get for this... If you are interested in a pro license you can have a
look at

http://groups.google.com/group/android-developers/browse_thread/thread/df5a3a1d08b9ae2f

Mirko

P.S. Great little app your NewsRob, I loaded it 2 months ago ;-)

On 14 Mai, 09:18, Mariano Kamp mariano.k...@gmail.com wrote:
 There are lots of free loaders who don't want to pay for anything. And

 there are lots of people with lots of free time creating free apps, thus
 reinforcing the mentality of the free loaders.
 Well, and it didn't help that Google screwed up with the release of paid
 apps.
 As you remember developers are not on equal footing. Paid apps were
 available in mid of Q1, but only for developers from the US and UK. A major
 screwup. If there is one thing we learned from Apple's Appstore then it's
 this: The winner (of a category) takes it all.

 So what should you have done as a developer from another country? I wanted
 to release a paid version, but I couldn't. At the same time my competitors
 released full versions of their apps. I tried to use Ads as a way to limit
 my free, but fully functional version, but that only gave me bad reviews, no
 money (of course, I knew that) and in the end I scraped even that. After
 Google continued to disappoint me with their special communication style and
 no end was in sight I gave up. There isn't that much functionality left that
 I could implement to justify a paid version.
 And now my app is free (as in beer) and will be the only significant app I
 wrote for the Android platform. I invested 500 hours and I am not gonna do
 that again for free. I can't do that to my girl friend and paying job
 again.

 Having said that. Since yesterday, some more countries were allowed to
 promote the failure that is called Google Checkout. So at some point in
 time, developers of new apps will be on equal footing.
 And burned developers like me, will not pollute the Android Market anymore
 with free apps that should have cost money.

 So these are just growing problems and will go away soon. I think this is
 part of the whole growing up thing, for Google and their Android Market, but
 also for developers.
 And maybe, in an ideal world, users will learn to appreciate paying for
 polished, non-trivial software (like they do on the Mac platform), but I am
 not holding my breath.

 On the downside, I think, that Android is already established as a platform
 for free loaders. Let's see how Palm handles this.

 On Thu, Mar 19, 2009 at 7:21 PM, Mattaku Betsujin 

 mattaku.betsu...@gmail.com wrote:
  I think you can make the situation a lot better for yourself by 
  accepting that people generally suck.

  There are lots of free loaders who don't want to pay for anything. And
  there are lots of people with lots of free time creating free apps, thus
  reinforcing the mentality of the free loaders.

  I think the people who complain about your paid app are a minority, albeit
  a loud one. So just ignore them and life goes on. Also, most paid apps on
  Android market are harnessed equally by the free loaders, so you're not the
  only one.

  If their comments on the market really bother you, then just get 3 G1
  accounts, and you can make sure that you always have 3 five-star comments on
  the first page :-)

  On Thu, Mar 19, 2009 at 9:28 AM, Al Sutton a...@funkyandroid.com wrote:

  My solution would be to leave the old version on the market, then, under
  a new name, have the lite and pro versions.

  Put in the 325 char description that the old app is not supported and
  people may want to look at the new app name.

  Al.

  Keith Wiley wrote:
   First I will explain my situation.  Then, I would greatly appreciate
   constructive dialog on how other developers feel similar situations
   should be managed.

   I wrote a simple app in November.  I offered it for free on the Market
   for two reasons.  One, Google hadn't implemented paid apps yet, so I
   had no choice.  Two, by my own admission, v1.0 was too simple too
   garner payment.

   However, in the app's documentation, I requested donations toward
   future development.  Out of thousands of installs, I received nothing.

   This week I finished a considerably fancier version of the program.
   Given hundreds of hours of unpaid development, I decided to charge a
   few bucks for the new version.  I split the app into lite and pro
   versions.  The lite version has all the new fancy features enabled but
   is limited in how large a document can

[android-developers] Re: Android-Calendar, How to get first day of week?

2009-05-14 Thread mirko

I think, the class GregorianCalendar provides all information you are
looking for (getFirstDayOfWeek). This class will take care of your
locale, because the first day of the week is not the same all over the
world.

I also use SimpleDateFormat very often to make conversions between
String and Date.

Mirko

On 14 Mai, 10:01, Jeff Sharkey jshar...@android.com wrote:
 You're probably looking for something like Time.weekDay, which you can
 get at through Time.setToNow():

 http://d.android.com/reference/android/text/format/Time.html#weekDay

 From that weekDay, you can also get a localized string through
 DateUtils.getDayOfWeekString().  Here's a quick example where I used
 it to generate the correct string (Mon, Wed, etc.) based on a
 given UTC time:

 http://code.google.com/p/android-sky/source/browse/trunk/Sky/src/org/...

 j

 On Thu, May 14, 2009 at 12:01 AM, daehoon jeondaeh...@gmail.com wrote:

  Hi, all
  There is a string, it's value is 5-14-2009.
  we know 14 is Wed,  so 12 is Monday. This week is begin by 12(Mon.).
  How to get first day of week, when we know one of the date in the
  week?

 --
 Jeff Sharkey
 jshar...@google.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: treeView in android?

2009-05-13 Thread mirko

Hi,

I needed some sort of tree view for my application to show the content
of a media server. After some thoughts I decided to use multiple list
views with an animation. If you have a media server in your network
you can have a look at AndroMote in the market (www.andromote.de)

And yes I tried to write some code that should be reusable. As I have
to reload things on the fly, I didn't really succeeded here, but I
think the code is not to bad. If you think by looking at the
application it is something you are looking for, I can provide you the
code of my so called DirectoryActivity.

Mirko

On 12 Mai, 22:39, Mark Murphy mmur...@commonsware.com wrote:
  does anybody knows how to implement a treeView in android?

  I am reading about ExpandableListView and it's not exactly what I
  need, as it seems it has only 2 levels...

  I need a proper treeView that I can add items to in runtime

 There is no built-in tree-view widget in Android, beyond
 ExpandableListView. In part, I suspect that is because trying to implement
 a finger-friendly tree in a small screen size would be difficult.

 However, you are welcome to examine the source code for ExpandableListView
 and take a shot at making a tree view widget.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 _The Busy Coder's Guide to Android Development_ Version 2.0 Available!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
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: Polite discussion of lite/trial vs pro distribution

2009-05-13 Thread mirko

http://groups.google.com/group/android-developers/browse_thread/thread/df5a3a1d08b9ae2f

On 19 Mrz., 21:16, Keith Wiley kbwi...@gmail.com wrote:
 Thanks for the various responses.  Well received.  I will consider
 them in depth when I get a chance to tear myself away from the
 debugger.

 Cheers!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
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: Paid applications and market feedback/rating

2009-05-09 Thread mirko

Hi all,

as in a few weeks it will be possible to sell application from germany
I was thinking some time to keep my currently free version and offer
an enhanced paid version. I only wanted to support one version of
code. The idea was to have a preference setting to enable the paid
options in the code. So I tried to get a secure way to set this
preference. In my opinion the above shown way works, but everyone can
just write a package that meets the package name of the license and
install it. To get access to the private preference of the free
version of the program, I will use signature based permission and a
very easy content provider. These steps will lead to a full version:

1. Install the free version
2. Install the licensing application for the free version. This one
needs to have the same signature as the free version.
3. When starting the paid app, it gets the simple content provider
from the free app (secured with signature based permissions) and sets
the flag for the license in the preferences of the free app
4. You can use the free app with all features.
5. After 24 hours the license app has to be run again to make sure it
was not refunded. (can be done automatically with an intent)
6. The license app may be uninstalled to safe memory

What do you think about this approach? Did I miss anything? Any huge
security leaks? If this work I will publish the code for the licensing
app so that every app can get the same licensing behaviour.

@Google: Btw, I think the best thing would be to handle such licensing
within the market, because this would be the easiest for the user.
Until this is done we have to do such workarounds.

Mirko

On 17 Mrz., 16:56, StefanK skyntc...@gmail.com wrote:
 There is probably a possibility to still keep the ratings if you leave
 the app free, let it expire (or go to a limited functionality after a
 several days or so). If users want to get it back to full features -
 they have to buy an unlock key. The unlock key is nothing more than a
 paid application that has no functionality. Your free application will
 just have to check if the paid is installed and unlock itself.

 This approach (if possible) has lots of advantages:

 1. You can keep the ratings from the free app
 2. You support only one app (not free and paid).
 3. You can give your users potentially longer trial than the 24 hours
 Google allows.
 4. No need to port settings from the free to the paid one.
 5. You potentially avoid issues with crashes caused by copy protection
 as you will copy protect only the paid app that has not real
 functionality,

 This is a bit unconventional approach, but it may work.

 On Mar 16, 7:44 pm, Keith Wiley kbwi...@gmail.com wrote:

  I don't *think* that's possible.  Assuming the signature/package is
  tied to the market app, there is no way to convert a previously free
  app to a paid app.  A brand new app must be installed instead, if I've
  understood thing so far.  I think a new app must have a new package
  and an old app can't be changed from free to paid.

  Can anyone clarify or straighten this out for us?

  On Mar 16, 4:26 pm, sm1 sergemas...@gmail.com wrote:

   I'm not 100% sure but if my understanding of how Android Market works
   is correct, what you may want to do is keep the same package (aka.
   signature) for your paid app as the package that you had before, with
   the comments and ratings, and make a *new* package for the free app.,
   and the new free app will start at zero comments and zero ratings, but
   you could write about that in it's description, i.e., previous
   version had a rating of x stars.

   and you could verify it by posting on this forum:

  http://www.google.com/support/forum/p/Android+Market

   Let us know what you find.
   cheers,
   good luck with your app.

   On Mar 16, 11:02 am, Keith Wiley kbwi...@gmail.com wrote:

I have had a free version of my app available for several months.
With the new features I am about to release in the latest version, and
with paid apps now possible, I intend to split the app into a free
lite/trial version and a paid full version.  I am aware that I must
create a new app with a new signature for the full version b/c I can't
change the current free app to a paid one.  I don't mind this, but, is
there any way I can transfer the thousands of feedback and ratings I
have accumulated so far to the paid version even though it will have a
totally new signature?

If there is no way to do this then, permit me to say, I am a little
miffed.  :-/

...but I'm holding out hope that I missed this somewhere, that's it's
possible.  Am I right?  I'm sorry if I missed the explanation for how
to do this.

Thank you very much.

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

[android-developers] No Market download in Chile on dev phone?

2009-03-30 Thread mirko

Hi,

I am travalling with my ADP1 from Germany to Chile. In Chile I am
connected to the internet with a private WiFi. I am able to browse
through the android market. But every download keeps in the state
'starting download...'. Are downloads are blocked from Chile?

Bye, Mirko
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
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
-~--~~~~--~~--~--~---