Amethyst brings the best social network to your Android phone. Just insert your Nostr private key and start posting.
This is a native Android app made with Kotlin and Jetpack Compose. The app uses a modified version of the nostrpostrlib to talk to Nostr relays. The overall architecture consists in the UI, which uses the usual State/ViewModel/Composition, the service layer that connects with Nostr relays, and the model/repository layer, which keeps all Nostr objects in memory, in a full OO graph.
The repository layer stores Nostr Events as Notes and Users separately. Those classes use LiveData objects to allow the UI and other parts of the app to subscribe to each individual Note/User and receive updates when they happen. They are also responsible for updating viewModels when needed. Filters react to changes in the screen. As the user sees different Events, the Datasource classes are used to receive more information about those particular Events.
Most of the UI is reactive to changes in the repository classes. The service layer assembles Nostr filters for each need of the app, receives the data from the Relay, and sends it to the repository. Connection with relays is never closed during the use of the app. The UI receives a notification that objects were updated. Instances of User and Notes are mutable directly. There will never be two Notes with the same ID or two User instances with the same pubkey.
Lastly, the user’s account information (priv key/pub key) is stored in the Android KeyStore for security.
Make sure to have the following pre-requisites installed:
- Java 17
- Android Studio
- Android 8.0+ Phone or Emulation setup
Fork and clone this repository and import into Android Studio
git clone https://github.com/vitorpamplona/amethyst.git
Use one of the Android Studio builds to install and run the app in your device or a simulator.
Build the app:
./gradlew test ./gradlew connectedAndroidTest
./gradlew ktlintCheck ./gradlew ktlintFormat
Installing on device
For the F-Droid build:
For the Play build:
How to Deploy Amethyst
- Generate a new signing key
keytool -genkey -v -keystore <my-release-key.keystore> -alias <alias_name> -keyalg RSA -keysize 2048 -validity 10000 openssl base64 < <my-release-key.keystore> | tr -d '\n' | tee some_signing_key.jks.base64.txt
- Create 4 Secret Key variables on your GitHub repository and fill in with the signing key information
<your key store password>
SIGNING_KEY<- the data from
- Change the
- Commit and push.
- Tag the commit with
- Let the Create Release GitHub Action build a new
- Add your CHANGE LOG to the description of the new release
- Download the
aabfile and upload it to the` PlayStore.
Privacy on Relays & nostr
Your internet protocol (IP) address is exposed to the relays you connect to. If you want to improve your privacy, consider utilizing a service that masks your IP address (e.g. a VPN) from trackers online.
The relay also learns which public keys you are requesting, meaning your public key will be tied to your IP address.
Relays have all your data in raw text. They know your IP, your name, your location (guessed from IP), your pub key, all your contacts, and other relays, and can read every action you do (post, like, boost, quote, report, etc) with the exception of Private Zaps and Private DMs.
While the content of direct messages (DMs) is only visible to you, and your DM nostr counterparty, everyone can see that and when you and your counterparty are DM-ing each other.
Visibility & Permanence of Your Content on nostr
Content that you share can be shared to other relays. Information that you share is publicly visible to anyone reading from relays that have your information. Your information may also be visible to nostr users who do not share relays with you.
Information shared on nostr should be assumed permanent for privacy purposes. There is no way to guarantee deleting or editing any content once posted.
Mobile App Development Best Practices – 02.10
Data.ai has summarized the interim results of the year – and once again we have a record. Annual consumer spending...
How to Use Kotlin’s Timing API
Kotlin’s Timing API is stable as of Kotlin 1.9, and it offers some great ways to both measure and specify...
Candy Crush made $20 billion
King attributes its huge success to several factors, including not only the games themselves, but also the company's commitment to...
FittedSheets – Bottom sheets for iOS.
This project is to enable easily presenting view controllers in a bottom sheet that supports scrollviews and multiple sizes. Contributions...
ComposeFadingEdges – Android Compose UI with fading edges
The ComposeFadingEdges is a powerful Android Compose library that seamlessly incorporates customisable fading edges with horizontal or vertical orientations, static or scrollable...
Mobile Consumer Spend Surpasses $100 Billion in Record Time in 2023
Positive growth in mobile consumer spend continued in Q3 2023 at a solid 3.7% year-over-year. Downloads declined slightly over the...