Feat/build native android apps with android solid services#23
Feat/build native android apps with android solid services#23erfangholami wants to merge 4 commits intosolid:mainfrom
Conversation
|
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:
|
|
I have added two matters you have mentioned. Let me know if they are well-described or need more modifications. |
|
Thanks @erfangholami - @matthieubosquet @langsamu as you have more Java experience could one of you please provide an additional review. |
|
|
||
| ## 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. |
There was a problem hiding this comment.
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) {} |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Could you please use consisten whitespace style in comments.
| //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 |
There was a problem hiding this comment.
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.
| // Fetch the authenticated user's WebID document | ||
| val webId = resourceClient.getWebId() |
There was a problem hiding this comment.
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!") |
There was a problem hiding this comment.
MyNote caught me by surprise.
Perhaps comment something like see below.
| } | ||
| ``` | ||
|
|
||
| Your data classes must extend `RDFSource` or `NonRDFSource` from the shared module: |
There was a problem hiding this comment.
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?
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.