Skip to content

Feat/build native android apps with android solid services#23

Open
erfangholami wants to merge 4 commits intosolid:mainfrom
erfangholami:feat/build-native-android-apps-with-android-solid-services
Open

Feat/build native android apps with android solid services#23
erfangholami wants to merge 4 commits intosolid:mainfrom
erfangholami:feat/build-native-android-apps-with-android-solid-services

Conversation

@erfangholami
Copy link
Copy Markdown

Add a guide for native Android developers to integrate Solid into their apps with the help of AndroidSolidServices project.
It presents developers with two different methods for integration based on their use-case.

@erfangholami erfangholami requested a review from a team as a code owner April 25, 2026 11:53
@jeswr
Copy link
Copy Markdown
Member

jeswr commented Apr 25, 2026

Thank you for this contribution @erfangholami!

Before we merge, I ask that this library could be given a different short-name - even if just used in this documentation. I suggest SolidAndroidService (SAS).

The documentation on Authentication, and Read/Write are great contributions well-suited to this repository.

The documentation based around use of Data Modules warrants further discussion. There are divergent approaches to interoperability in the Solid ecosystem at present; as such, I would consider documentation related to Data Modules in general to be opinionated. The ODI, for instance, has propose the shapes repository as a way of tracking and aligning on data models used in the ecosystem. The fact that the Chat Spec is used as an example, does somewhat resolve this. My suggestion is that we keep this in the docs, and add clear warnings - here, and in SAS itself - about what is based on:

@erfangholami
Copy link
Copy Markdown
Author

I have added two matters you have mentioned. Let me know if they are well-described or need more modifications.

@jeswr
Copy link
Copy Markdown
Member

jeswr commented Apr 30, 2026

Thanks @erfangholami - @matthieubosquet @langsamu as you have more Java experience could one of you please provide an additional review.

Copy link
Copy Markdown
Contributor

@langsamu langsamu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Great contribution.

In addition to the comments inline, may I recommend a starter project (or two) that would give users an easy way to start. See how some of the other guides in this repo do this.


## 1. Install the SAS Host App

If you are using **SAC**, the SAS host app must be installed on the device. Download the latest APK from the [GitHub Releases](https://github.com/pondersource/Android-Solid-Services/releases) page, enable *Install from unknown sources* in device settings, and install it. Launch the app and sign in with your Solid pod credentials.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please write about why one must enable installing from unknown sources.

Are there plans to go on the official marketplace? When? Why not?
What should developers consider when they enable this.
Where should they enable this and where, if any, should they not.

authorizationException
)

} catch (_: Exception) {}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't guide readers towards swallowing exceptions.

If there is a good reason for this then please document with inline comment and outside the sample code.

If there isn't then please modify and instead guide users in how they should avoid and handle exceptional cases.

logoutRedirectUrl = YOUR_LOGOUT_REDIRECT_URL
)
return intent
//intent would be null if failed to make the intent and can read errorMessage.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please improve this phrasing.


=== "SolidAndroidApi"

The `Authenticator` class manages an OpenID Connect session with DPoP support. It opens a browser tab for the user to log in, then processes the authorization callback your app receives.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about Solid servers that don't support DPoP?

What about PKCE?

redirectUri = AUTH_APP_REDIRECT_URL //YOUR_APP_PACKAGE_NAME:/oauth2redirect
)
return intent
//Handle the intent in your ComposeComponent/Activity/Fragment.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please use consisten whitespace style in comments.

Suggested change
//Handle the intent in your ComposeComponent/Activity/Fragment.
// Handle the intent in your ComposeComponent/Activity/Fragment.

if (connected) {
val account = signInClient.getAccount()
if (account == null) {
// No access grant yet — ask the user to approve
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Access grant is quite a loaded term in the context of Solid. Are you sure that you want those connotations?

I think you mean something else here. Could you please use different terminology.

I might have misunderstood something, of course.

Comment on lines +227 to +228
// Fetch the authenticated user's WebID document
val webId = resourceClient.getWebId()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature of the library is worth explaining to users.

But it does not seem relevant to the rest of CRUD operations showcased here.

It might also be confusing, since WebID profile documents are not required to be Solid resources and are best requested without authentication, because they are almost always public.

May I suggest separating.

)

// Create a new resource on the pod
val newNote = MyNote(body = "Hello Solid!")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MyNote caught me by surprise.
Perhaps comment something like see below.

}
```

Your data classes must extend `RDFSource` or `NonRDFSource` from the shared module:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth to expand this following section.

How does one do something meaningful with the data in an RDFSource?

How does one work with NonRDFSource?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants