Android 2.3: Music content providers for artists, albums and songs

by Daniel » Fri, 25 Feb 2011 21:45:47 GMT


Sponsored Links
 The activities ArtistAlbumBrowserActivity, AlbumBrowserActivity and
TrackBrowserActivity cannot be started anymore by an Intent (e.g.
using action.PICK and "vnd.android.cursor.dir/album") since the
attribute android:exported is set to "false" for those activities
since Android 2.3 (see
 http://android.git.kernel.org/?p=platform/packages/apps/Music.git ;a=blob;f=AndroidManifest.xml;h=90e0c5b9b81371a1b64940e432cd6917a530b2f4;hb=HEAD).
That is really annoying because the Intent stuff was once one of
Android's strength's and now you are not allowed to use this stuff any
more. That's a shame...

-- 



Re: Android 2.3: Music content providers for artists, albums and songs

by TreKing » Sat, 26 Feb 2011 03:11:58 GMT


 



Is (or was) it documented somewhere that this is the proper way to do this?

That is really annoying because the Intent stuff was once one of Android's

Intent stuff is still one of Android's strengths - when used correctly. It
looks like you were exploiting private implementation details to get this to
work. You should not be surprised that it has changed.

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

-- 


Sponsored Links


Re: Android 2.3: Music content providers for artists, albums and songs

by Daniel » Sun, 27 Feb 2011 04:26:23 GMT


 Well I don't think so. It was really cool to build apps like a mesh up
of activities others implemented.
I know a lot of developers who used exactly this intents and this
change really killed all of them. Only Google apps like "Search" are
still able to use these intents. This is not what I expect from an
open platform where 3rd party developers should be able to write apps
with the same quality as Google.
But ok if your argumentation goes that way, what shall I say, well
done my app is dead. I'm pretty sure others too.






-- 



Re: Android 2.3: Music content providers for artists, albums and songs

by Daniel » Sun, 27 Feb 2011 04:30:22 GMT


 Btw, the problem is not that something was changed (yes I know it was
not documented). But the platform lost some of its openness for 3rd
party developers.






-- 



Re: Re: Android 2.3: Music content providers for artists, albums and songs

by Dianne Hackborn » Sun, 27 Feb 2011 05:09:49 GMT


 he music app is an implementation detail; I don't do the app, but I assume
this was done because people shouldn't be relying on the implementation
detail of it being implemented as separate activities.

The media provider is still in the SDK, and is the same thing the media
application uses for this UI.

You can just copy the code you want and use it in your own activity.

This didn't "lose its openness" for third party developers in any way,
shape, or form. If you want to define openness that way, well then Linux
desktops aren't open because they don't allow apps to launch pieces of other
apps at all.

On Sat, Feb 26, 2011 at 12:30 PM, Daniel <daniel.himmel...@googlemail.com>wrote:




--
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails. All such
questions should be posted on public forums, where I and others can see and
answer them.

--



Re: Re: Android 2.3: Music content providers for artists, albums and songs

by Dianne Hackborn » Sun, 27 Feb 2011 05:10:39 GMT


 h also, the media app still does support the proper way to have it pick a
music track for you, through GET_CONTENT if audio/*.

On Sat, Feb 26, 2011 at 1:09 PM, Dianne Hackborn <hack...@android.com>wrote:



--
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails. All such
questions should be posted on public forums, where I and others can see and
answer them.

--



Re: Android 2.3: Music content providers for artists, albums and songs

by Daniel » Sun, 27 Feb 2011 05:32:25 GMT


 ello Dianne,

ah ok, I will try the GET_CONTENT with audio/*. But can I also use it
for artists and albums?
And yes ok, I can copy the code of your activities (I will try this
out now). But I would really appreciate to eat Google's dogfood here
and don't want to invent the wheel again by myself. I also think this
is not what the users expect from the Android platform, because maybe
my activity will be somehow different from Googles (maybe in future
versions) and the users will not understand why...

For me the intent stuff really makes up some of Android's modularity
and openness. Yes it is right that desktop Linux does not have this
feature. That's why I like Android much more than desktop Linux :-).
But I really don't want to start a flamewar on this topic. I simply do
not understand why these activities are not available anymore to 3rd
party developers. Maybe it is because of task stacks, but I don't
know.

Best regards,
Daniel

On 26 Feb., 22:10, Dianne Hackborn <hack...@android.com> wrote:

--



Re: Android 2.3: Music content providers for artists, albums and songs

by gizmomogwai » Sun, 27 Feb 2011 07:05:32 GMT


 Another observation, which could be a bug in the package manager:

I have also a small life-wallpaper (the infamous discomagic) which
starts "a" musicplayer with the intent:

  Intent intent = new Intent(Intent.ACTION_PICK);
  intent.setDataAndType(Uri.EMPTY, "vnd.android.cursor.dir/track");
  intent.putExtra(Constants.ALBUM, ...);
  intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_CLEAR_TOP);
  startActivity(intent);

The funny thing is, that this leads also to a SecurityException (as
long as no other Application is installed that filters for this
intent).
When I install e.g. MixZing which also supports this intent I get the
regular ActivityChooser (with music and mixzing) and if I choose Music
it works.

Good or Bad?


-- 



Re: Re: Android 2.3: Music content providers for artists, albums and songs

by Dianne Hackborn » Sun, 27 Feb 2011 07:35:27 GMT


 On Sat, Feb 26, 2011 at 3:05 PM, gizmomogwai




That is a bogus Intent.  The definition for the PICK intent is that the data
URI is the location of the data from which to pick from; you do not specify
the MIME type because that is implied by the given data URI.

(Btw I think the old implementation of the music did do something with this
kind of Intent, but it is wrong, and is probably another reason why it is
explicitly not allowing it to be used like this.)

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 



Re: Re: Android 2.3: Music content providers for artists, albums and songs

by Dianne Hackborn » Sun, 27 Feb 2011 07:36:37 GMT


 t the end of the day, these are not documented in the SDK, the music app is
something vendors tend to replace and customize, and trying to use these
things in it is very likely to cause you problems across devices as they
don't behave the same (at all) as what you are assuming.

On Sat, Feb 26, 2011 at 1:32 PM, Daniel <daniel.himmel...@googlemail.com>wrote:




--
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails. All such
questions should be posted on public forums, where I and others can see and
answer them.

--



Re: Re: Android 2.3: Music content providers for artists, albums and songs

by gizmomogwai » Sun, 27 Feb 2011 14:11:47 GMT


 Ok ... I understand, that this Intent is not supposed to use that way.
My actual question now is, why the behavior of the system changes depending 
of the installed or not installed MixZing-App.
Case 1 (no MixZing):
- startActivity leads to an securityexception
Case 2 (with MixZing installed):
- startActivity opens up the ActivitiyChooser as usual (with Music and 
MixZing, because they both filter this intent).
- choosing the stock music player opens up the music.app with the album 
preselected (no securityexception).

thanks in advance

-- 



Re: Re: Android 2.3: Music content providers for artists, albums and songs

by Dianne Hackborn » Sun, 27 Feb 2011 15:27:39 GMT


 It is a bug that the activity choose allows activities to be launched from
itself instead of the original caller.  This will be fixed in a future
release.

On Sat, Feb 26, 2011 at 10:11 PM, gizmomogwai






-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 



Re: Android 2.3: Music content providers for artists, albums and songs

by Daniel » Sun, 27 Feb 2011 21:14:20 GMT


 I would suggest these two intents for starting artist and album
activities on an Android device now. They also work for Android 2.3
and 3.0.
They do not look as good as the other activities build by Google but
they work :-).

For artists:
String query = "";
Intent intent = new Intent();
intent.setAction(MediaStore.INTENT_ACTION_MEDIA_SEARCH);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
query = artistName;
intent.putExtra(MediaStore.EXTRA_MEDIA_ARTIST, artistName);
intent.putExtra(MediaStore.EXTRA_MEDIA_FOCUS,
MediaStore.Audio.Albums.ENTRY_CONTENT_TYPE);
intent.putExtra(SearchManager.QUERY, query);
mContext.startActivity(intent);

For albums:
Intent intent;
String query = "";
intent = new Intent();
intent.setAction(MediaStore.INTENT_ACTION_MEDIA_SEARCH);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
query = albumName;
intent.putExtra(MediaStore.EXTRA_MEDIA_ALBUM, albumName);
query = query + " " + artistName;
intent.putExtra(MediaStore.EXTRA_MEDIA_ARTIST, artistName);
intent.putExtra(MediaStore.EXTRA_MEDIA_FOCUS,
MediaStore.Audio.Albums.ENTRY_CONTENT_TYPE);
intent.putExtra(SearchManager.QUERY, query);
mContext.startActivity(intent);







-- 



Other Threads

1. Fwd: FW: The Husband Store

---------- Forwarded message ----------
From: sagar.b97 <sagar....@gmail.com>
Date: Thu, Jan 29, 2009 at 10:27 PM
Subject: Fwd: FW: The Husband Store
To: naem.muja...@gmail.com, "***Sujit*** Wieder Verjngte...."
<sujitt...@gmail.com>, "-- Amrut {I foUGhT oUt dSp....}"
<imac_pune...@yahoo.co.in>, "-- Amrut {tHe FiGhT cOmeS tO aN
eNd.}" <amrutchaug...@gmail.com>, 110 km ''''''''''''''''
<amolman...@gmail.com>, abhijeet chaudhari
<abhijeetthecoold...@gmail.com>, abhijeet kedari
<abhijeet.ked...@yahoo.com>, abhijeet kedari
<abhijeetked...@gmail.com>, abhishek tomar
<montyto...@indiatimes.com>, abhishek {c u after examz}
<chakrabarty_abhis...@yahoo.com>, abhisheksingh tomar
<abhi.to...@rediffmail.com>, abhisheksingh tomar
<abhisheksingh_to...@infosys.com>, "Aditi Agnihotri waiting 4
project..........." <aditi.c...@gmail.com>, "Amol aka Sunny.. ."
<sunnya...@yahoo.co.in>, Amol manave <amolman...@yahoo.com>, Anchal
Kohli <anchal.kohli.1...@gmail.com>, "Arpit....'COMP'. Everyone
remember 'IT'" <arpitbeedkar7...@gmail.com>, "Arun (enjoying in
Aurangabad)" <arungajank...@gmail.com>, Arun Gajankush
<arungajank...@yahoo.com>, ashwini kulkarni
<ashwinie.kulka...@gmail.com>, bhavesh
<bhavesh_solank...@yahoo.co.in>, Bhavesh solanki
<bhavesh_...@yahoo.co.in>, bhavna <bhavna_k...@infosys.com>, Bhavna
kaku <bhavna.k...@gmail.com>, Bhavna--------- Accepted the Unexpected
<bhavn...@yahoo.com>, "Busy in exam technical,Nirali,Techmax"
<bhushan_...@yahoo.com>, "Chak De..Avinash Patil"
<avinash_...@yahoo.co.in>, chanchal arbale <chanchalarb...@gmail.com>,
DEEPAK not placed yet <deepakworld...@yahoo.com>, "DESTINY s d
strength f my desireS...." <sunny_jagw...@rediffmail.com>, devendra
<devendra9...@gmail.com>, devendra_kulkarni
<devendra_kulka...@infosys.com>, dilpreet singh
<dilpreet.aror...@gmail.com>, dinesh kalaskar <dinesh_7...@yahoo.com>,
Dipak mane <mane.di...@gmail.com>, dipesh rane
<dipesh.r...@gmail.com>, gaurav deshpande
<deshpande.gaurav.a...@gmail.com>, george <george...@yahoo.co.in>,
george varghese <v3.geo...@gmail.com>, harsha halyal
<harschal...@gmail.com>, "Hrishikesh ............................"
<hskulkarn...@gmail.com>, "i mean u really an ASS a HOLE..."
<abhishek.chakrabar...@gmail.com>, Jalees Ahmad <jalee...@gmail.com>,
jalees ahmed <jali...@yahoo.co.in>, "ji{*filter*}
shinde......(krawlerer.....)" <jitee...@gmail.com>, Ketan Dhamdhere
<ketan_lovefore...@yahoo.com>, "kishor(game begins now) khandagale"
<kishor...@gmail.com>, krunal <krunal...@gmail.com>, krunal chaudhari
<krunal_...@yahoo.co.in>, manish Mandlik <mailtoha...@gmail.com>,
Manoj choudhari <choudhari.manoj.pral...@gmail.com>, Manoj choudhari
<manojc...@yahoo.co.in>, Mathew Varghese <vmathew...@gmail.com>,
mathew verghese <vmathew...@gmail.com>, mayank pratik
<mayank.pra...@gmail.com>, Mayank Raheja <mayank.rah...@yahoo.co.in>,
Mohit kewalramani <kewalramanimo...@gmail.com>, MOOD i rocks! Rahul
Pardeshi <rrr_parde...@yahoo.co.in>, "Mr. Abhijeet Vitthal Kedari"
<abhijeet.ked...@newgen.co.in>, "Nachiket Enjoying Vacations..!!!"
<nachiket_karmal...@yahoo.co.in>, Neel Pansare
<neel.pans...@gmail.com>, neetesh tiwari <neetesh.tiw...@yahoo.co.in>,
neha wadodkar <neha.wadod...@gmail.com>, nikhil d pawar
<nikhildpa...@gmail.com>, Nikita Kataria <kataria_nik...@yahoo.co.in>,
"NIKS jane kya hoga rama re....." <niks.up...@gmail.com>, NILESH
khaire <khaire_nil...@rediffmail.com>, "NILESH MORE always
strong.........." <pune.nil...@gmail.com>, nisha khatri
<nisha_khat...@yahoo.com>, OMKAR PATHAK - Life Sucks!!!
<omkarjpat...@gmail.com>, Omkar R Badave
<omkar.bad...@bitwiseglobal.com>, Prasad Yelgodkar
<bck2...@gmail.com>, pratod <pratod.jaw...@gmail.com>, Pravin Bankar
<pravin_bankar1...@indiatimes.com>, pria aphale
<priya.dyp...@gmail.com>, priya joshi <priya.josh...@yahoo.com>,
Priyanka Ghewari <piya_0...@rediffmail.com>, Priyanka Ghewari
<priyankaghew...@gmail.com>, P(R)(R)N JWL
<prerana.jaw...@gmail.com>, rachita bagaria
<rachita_baga...@infosys.com>, rachita bagaria
<rachita_baga...@yahoo.co.in>, Rahul Tekade
<rahul_mtek...@yahoo.co.in>, RAHUL {in hyderabad} PARDESHI
<rahul10parde...@gmail.com>, REENA GEORGE <reena_georg...@yahoo.com>,
riyanka gupta <riyanka.gupt...@gmail.com>, Rohan Dighe
<rsdi...@fedoraproject.org>, "Rohan Dighe ..it's LIFE!"
<rohandi...@hotmail.com>, "Rohan Dighe ..life's full of johl's"
<linuxdominat...@gmail.com>, Rohit Borlikar <rohitborli...@gmail.com>,
rohit gaikwad <rohitgaikwad1...@gmail.com>, Rohit Kulshreshtha
<rohit.in.p...@gmail.com>, "s...@g@r Always ONLINE"
<cesa_sa...@yahoo.co.in>, sagar hirve <sagar.hi...@gmail.com>, "SAGAR
HIRVE .... Looking for result" <sagarhi...@yahoo.com>, sagar patil
<sagar....@gmail.com>, SAGAR SEN <sagar.sin...@gmail.com>, saket bhole
<saketbh...@gmail.com>, Saket Verma <saket1...@yahoo.co.in>, "Sandy..
ManU - d Unstoppable" <sandysukh...@gmail.com>, "Sandy...searchin my
own identity..." <sandy_sukh...@yahoo.com>, santosh choudhary
<smchoudhary...@gmail.com>, seema gupta <seemapiece...@yahoo.com>,
Shailesh <shail...@gmail.com>, shekhar katariya
<shekharkatar...@yahoo.co.in>, Shekhar Satish Katariya
<shekhar_katar...@infosys.com>, shreyas gite <shreyas.g...@gmail.com>,
shripad deshpande <shripaddeshpand...@yahoo.co.in>, Shweta Deshpande
<shweta8...@gmail.com>, sidhesh rane <sidd.r...@gmail.com>, Snehal
Kulkarni <meetonlysne...@yahoo.co.in>, sonu sonu
<luckyra...@yahoo.com>, Sucheta Pardeshi Sinha
<suchetasinh...@gmail.com>, Suhas Mahajan <amaj.n...@gmail.com>, sumit
jha <sjha_4...@yahoo.co.in>, swapnil warke <warke.swap...@gmail.com>,
Taruna Thole <taruna.th...@gmail.com>, Taruna Thole
<taruna_th...@yahoo.co.in>, Tejas Kumar <chakram...@yahoo.com>, tejas
kumar singh <tejasku...@infosys.com>, "tejas( 7 up) kumar"
<inboxte...@gmail.com>, Tushar Dalvi <tusharda...@gmail.com>, "Tushar
Phapale...feel my love" <tushar.phap...@gmail.com>, vaibhav enjoying
final sem******** <babu_manj...@indiatimes.com>, varun shinde
<varunshinde...@gmail.com>, veda vardhan <vedagudip...@gmail.com>,
Vidyalankar Pandey <vidyalankar....@gmail.com>, VISHAL INGALE
<vishalbip...@gmail.com>, vishal ingle <visha...@rediffmail.com>,
Vishwajeet Kaulgekar <likev...@yahoo.co.in>, Vishwesh Janorkar
<vishweshjanor...@gmail.com>, yatin {$OUT OF sMs WAR til exams$}
<toke.ya...@gmail.com>, Yogesh Dhande <yogeshdha...@gmail.com>, yogi
joshi <yogirjo...@gmail.com>, " > Khandelwal...."
<neha_k...@yahoo.com>




---------- Forwarded message ----------
From: Budavi, Sagar <sagar_bud...@syntelinc.com>
Date: Thu, Jan 29, 2009 at 9:44 PM
Subject: FW: The Husband Store
To: sagar....@gmail.com



________________________________
From: Deshpande, ShripadP
Sent: Wed 1/28/2009 4:28 PM
To: Ghabade, Sagar; Joshi, Mukul; Rathi,Ankush; Kavishwar,Mandar;
Nemani, Sumit; Gadia, Priyanka; Kamthekar, Prasanna; Gupta, Seema;
Rajugade, Dattatray; Katkam, Ravindra; Khandelwal, Neha; Mangle,
Kshitija; Bhuyar,Gaurav; Akshay Kulkarni; SACHIN BHANGALE; Gupta,
Riyanka; Tawani Amit; Srivastava, Abhijeet; Raut, Renuka; Jha, Sumit;
Priya, Raksha; Ghadi, sandeep; Deshpande,Tushar ; Kulkarni, Ashwini;
Budavi, Sagar; Ahmad, Jalees; Borikar, Sayali; Choudhary, Santosh;
Chimanpure Amit; ranjana.si...@geometricglobal.com;
varangaonkar.aadi...@gmail.com; Kasat, Pratibha; Tekade, Rahul;
Varangaokar,Aditya; Kalaskar, Kundan; Punewar, Akshay; Arbale,
Chanchaladevi; Uchekar, Vivek; Kalaskar, Dinesh; Dive,Swapnil;
Vibhor,Sharma; Dive,Swapnil; Kohli, Anchal; Warke, Swapnil;
Jaltare,Nikhil; Joshi, Shubhada
Subject: The Husband Store







 The Husband Store

Click here to joint the group







A store that sells husbands has just opened in New York City, where a
woman may go to choose a husband.


Among the instructions at the entrance is a description of how the
store operates. You may visit the store ONLY ONCE!


There are six floors and the attributes of the men increase as the
shopper ascends the flights.



There is, however, a catch.. ... You may choose any man from a
particular floor, or you may choose to go up a floor, but you cannot
go back down except to exit the building!





So, a woman goes to the Husband Store to find a husband. .


On the first floor the sign on the door reads:

Floor 1 - These men have jobs and love the Lord.


*********

The second floor sign reads:

Floor 2 - These men have jobs, love the Lord, and love kids.


*********

The third floor sign reads:

Floor 3 - These men have jobs, love the Lord, love kids, and are
extremely good looking.


"Wow," she thinks, but feels compelled to keep going.


*********

She goes to the fourth floor and sign reads:

Floor 4 - These men have jobs, love the Lord, love kids, are drop-
dead good looking and help with the housework.

"Oh, mercy me!" she exclaims, "I can hardly stand it!"


*********

Still, she goes to the fifth floor and sign reads:

Floor 5 - These men have jobs, love the Lord, love kids, are drop-
dead gorgeous, help with the housework, and have a strong romantic
streak.

She is so tempted to stay, but she goes to the sixth floor and the sign reads:


*********

Floor 6 - You are visitor 4,363,012 to this floor. There are no men on
this floor. This floor exists solely as proof that women are
impossible to please.

Thank you for shopping at the Husband Store. Watch your step as you
exit the building, and have a nice day!


*********



-------------------------------------------------------------
Thanks & Regards,

Shripad Deshpande
PLM | Syntel Ltd.Pune
The thing I love most about deadlines is the wonderful WHOOSHing sound
they make as they go past.













__._,_.___



Confidential: This electronic message and all contents contain
information from Syntel, Inc. which may be privileged, confidential or
otherwise protected from disclosure. The information is intended to be
for the addressee only. If you are not the addressee, any disclosure,
copy, distribution or use of the contents of this message is
prohibited. If you have received this electronic message in error,
please notify the sender immediately and destroy the original message
and all copies.


--
:-) SaGaR BudaVI

--~--~---------~--~----~------------~-------~--~----~

2. Help!!!! How do I delete sms from inbox?

I need to know the code for  deleting an SMS from the inbox.

Please help!


--~--~---------~--~----~------------~-------~--~----~

3. unable to delete sms from inbox

4. Delete sms from inbox

5. regarding game creation

6. HTML links in a TextView inside a ListView

7. Sending a message from Service to Activity