A simple app in react native to implement alarm clock that makes use of react native bridge, schedule alarm with Alarm Manager for Android .
- You should have the latest build system for Android, Java, React Native.
View all alarms | Create or edit alarm | Ring |
---|---|---|
- Alarm will go on even if the app is killed; this is the tricky area where you cannot run a task without headless JS when the app is killed - react native apps run on JS thread - single threaded, if that thread is killed, no way to perform any action). Native modules are implemented here, thereby invoking the Native Android Alarm manager to store and retrieve alarm details and fire it approproately with play, pause, update, etc operations.
- React Native : For Cross platform mobile app development
- Node JS: For runtime environment
- Javascript : For application development
- VS code : Code editor IDE
- Linting: eslint
This App requires Node.js v10+ to run.
git clone git@github.com:svbala99/alarm.git
cd alarm
npm i
npm start
- Connect any Android device with USB
- Enable USB debugging in the device
- Accept to INSTALL the app when prompted during the deployment
- This command is not needed for subsequent changes made in project
- Whenever you include any package that impacts Android native, reinstall the app by issuing this command
- Alternatively the same can be achieved from Android Studio IDE by clicking "Run" button after opening "Android" project in it
- Supported Machines: Windows / Linux / Mac
npm run android
- Connect any Android device with USB
- Enable USB debugging in the device
- Accept to INSTALL the app when prompted during the deployment
- This command is not needed for subsequent changes made in project
- Whenever you include any package that impacts Android native, reinstall the app by issuing this command
- Alternatively the same can be achieved from Xcode IDE by clicking "Build" & "Run" button after opening "iOS" folder in it
- Supported Machines: Mac only
cd ios && pod install && cd ..
npm run ios
- Set the scheme to "Any iOS Simulator"
- Xcode -> product -> clean
- Xcode -> product -> Archive
- After 15mins, build will be archived, you can export the build now
- In the archive window opened, choose "development" method of distribution
- Choose "Automatically manage signing"
- Select the location you want to export and click OK
gradlew assembleRelease (APK file)
gradlew bundleRelease (AAB file)
- For more details: https://reactnative.dev/docs/signed-apk-android Note: If you run in Linux, issue ./gradlew instead of gradlew
You will find the APK file in:
~PROJECT_LOCATION\android\app\build\outputs\apk\release
adb install app-release.apk
Package | Version |
---|---|
React | 17 |
React Native | 0.68.2 |
and basic necessary packages for react navigation stack and uuid.
GNU GPL