This is a wrapper for this Github project.
AndroidProviders
Author: Manfred Ssykor <DonManfred>
Version: 1.1
Notes:
- ALL Content-Providers doe only READ as yet. For the Calendars-Povider i´ll make an update where you can Update Events and Calendars. It is not done as yet. All other Providers except Calendars does not have any update-methods. So you just can READ all the data
- ALL Providers will return a CURSOR to iterate through the results!
As Example i´ll post code to get all Contacts. ALL other Providers can be used similar.
If you want to donate for my work building the wrapper you can do it here:
AndroidProviders
Author: Manfred Ssykor <DonManfred>
Version: 1.1
- BrowserProvider
Methods:- Initialize
- IsInitialized As Boolean
- com.android.browser.permission.READ_HISTORY_BOOKMARKS
- Bookmarks As Cursor [read only]
- Searches As Cursor [read only]
- CalendarProvider
Methods:- Initialize
- IsInitialized As Boolean
- getCalendarByID (calendarId As Long) As Calendar
- getEvents (calendarId As Long) As Cursor
- updateCalendar As Int
- android.permission.READ_CALENDAR
- android.permission.WRITE_CALENDAR
- Calendars As Cursor [read only]
- CallsProvider
Methods:- Initialize
- IsInitialized As Boolean
- android.permission.READ_CALL_LOG
- Calls As Cursor [read only]
- ContactsProvider
Methods:- Initialize
- IsInitialized As Boolean
- android.permission.READ_CONTACTS
- Contacts As Cursor [read only]
- DictionaryProvider
Methods:- Initialize
- IsInitialized As Boolean
- android.permission.READ_USER_DICTIONARY
- Words As Cursor [read only]
- MediaProvider
Methods:- Initialize
- IsInitialized As Boolean
- android.permission.READ_EXTERNAL_STORAGE
- AlbumsExternal As Cursor [read only]
- AlbumsInternal As Cursor [read only]
- ArtistsExternal As Cursor [read only]
- ArtistsInternal As Cursor [read only]
- AudiosExternal As Cursor [read only]
- AudiosInternal As Cursor [read only]
- FilesExternal As Cursor [read only]
- FilesInternal As Cursor [read only]
- GenresExternal As Cursor [read only]
- GenresInternal As Cursor [read only]
- ImagesExternal As Cursor [read only]
- ImagesInternal As Cursor [read only]
- PlaylistsExternal As Cursor [read only]
- PlaylistsInternal As Cursor [read only]
- VideosExternal As Cursor [read only]
- VideosInternal As Cursor [read only]
- TelephonyProvider
Methods:- Initialize
- IsInitialized As Boolean
- getMMS (filter As String) As Cursor
- getSMS (filter As String) As Cursor
- android.permission.READ_SMS
- Carriers As Cursor [read only]
- Conversations As Cursor [read only]
- Threads As Cursor [read only]
Notes:
- ALL Content-Providers doe only READ as yet. For the Calendars-Povider i´ll make an update where you can Update Events and Calendars. It is not done as yet. All other Providers except Calendars does not have any update-methods. So you just can READ all the data
- ALL Providers will return a CURSOR to iterate through the results!
As Example i´ll post code to get all Contacts. ALL other Providers can be used similar.
B4X:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim contp As ContactsProvider
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
contp.Initialize("")
'
Dim c As Cursor
c = contp.Contacts
If c.RowCount > 0 Then
For i = 0 To c.RowCount-1
c.Position = i
LogColor("===========================", Colors.Green)
Dim colcount As Int = c.ColumnCount
Log("columns="&colcount)
For o = 0 To colcount -1
Log(c.GetColumnName(o)&"="&c.GetString(c.GetColumnName(o)))
Next
Next
End If
Log("Contacts = "&c.RowCount)
If you want to donate for my work building the wrapper you can do it here:
Attachments
Last edited: