You get your ClientProviderClient like this: Uri uri = Uri.parse("content://com.sabretch.colorEyeD/ yourtable"); ContentProviderClient cpc = getContentResolver().acquireContentProviderClient(uri);
(This only uses the authority part of the Uri -- com.sabretch.colorEyeD -- but we'll use the same Uri in the next step). Once you have your cpc, you run a query. In the query call, using the same Uri, you provide the list of column names; the results will be in that order. You can define a class with static fields like People if you want, to identify the column names with field names. That's a good idea, because it lets the compiler detect any typos, but it's not required, they're just strings. The only requirement is that the column names that you use match the column names used by the provider. If the provider is using a database, that in turn will be the column names from the database. Your query gives you a Cursor, which you then use to step through the rows, and access the columns. By this point, it's the same as for a built-in provider. Hopefully this makes it more clear how the examples would work with your own provider? On Apr 13, 11:44 pm, mike <hasitharand...@gmail.com> wrote: > hi guys, > > hi SREEHARI, > > i have also created a ContentProvider. and i want to access this > ContentProvider from another application. > > this is the Manifest.xml in the contentProvider created application. > > <provider android:name=".database.CProvider" > android:authorities="com.sabretch.colorEyeD" android:exported="true" > android:grantUriPermissions="true" android:multiprocess="true"/> > > so how can i read the data from another application??? > if we look at a inbuilt ContentProvider like People. we can read data > by saying People.NAME here NAME is the column name. like wise how can > i use it. here what refers to People in my case??? and how can i > access my columns??? > > regards, > Randika > > On Apr 14, 10:44 am, SREEHARI <sreehari.madhusooda...@wipro.com> > wrote: > > > > > Hi Kiran, > > > I want to know how you are specifying the content uri....?? Can u > > pls provide the code snippet of your CONTENT URI.. > > > I used Uri mUri = Uri.parse("content://com.wipro.FTCProvider.CellInfo/ > > profiles"); instead of > > Uri mUri = Uri.parse(CellInfo.CONTENT_URI) ; > > > Try to give the complete uri in ur application which u r accessing the > > content provider. Dont use the static variable CONTENT_URI even if u > > assign the complete value to that. > > > Regards, > > SREEHARI -- 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.