Control Menopause mood swings. Based on meditation and music techniques.
Am just a Indian kid who started to learn developing mobile applications. Am more like a software guy than hardware.
Even though Menopause is a new thing to me and only for girls or women I have a little sister and mother to take care of! So it makes sense for me to contribute with the knowledge I have about App Development and little bit of Machine Learning (ML). Being a Software kid I couldn't think of any Hardware solutions and I guess there are many Hardware developers out there making some amazing solution for Menopause.
After watching the "AARP Hacking Menopause Webinar" I felt that that I could solve some Menopause symptoms like anxiety and stress using mobile applications. This is my first ever mobile application so suggestions are welcomed. This project guide will take you through the whole app structure and Menopause symptoms.
Click here to jump to the last section
(Build and Install: Build Project from source code)
to straight away clone and build this application. HAPPY HACKING!Menopause- Menopause is the time that marks the end of your menstrual cycles. It's diagnosed after you've gone 12 months without a menstrual period.
- Menopause can happen in your 40s or 50s, but the average age is 51 in the United States.
- Menopause is a natural biological process. Menopause is a stage of life that nearly every woman will experience. Yet, this very natural phase in a woman’s life is often not discussed nor well understood.
- One in three American women are currently in a phase of menopause 20% of the American workforce is currently experiencing menopause.
- Very few women use hormone replacement therapy (HRT).
- Perimenopause is the 4-10 years leading up to that point can bring a variety of disruptive symptoms to a woman. In the postmenopausal period, some symptoms can diminish, while new ones appear.
- Hot flashes are the most known symptom of menopause. Did you know there are over 35 other symptoms that women might experience during the three phases of menopause.
- Hot Flashes - A sudden wave of mild or intense body heat caused by rushes of hormonal changes resulting from decreased levels of estrogen. Hot flashes can occur at any time and may last from a few seconds to a half-hour. They are due to blood vessel opening and constricting and a symptom of menopause.
Some points to note for a person not in good health - Music, Meditation, control over sleep and fluid intake.
- Music can help a lot in concentration and help in distracting you from thinking more and more about your menopause issues. So during the project we will be including a YouTube plugin to randomly play some concentration music by Brain.fm.
- Reminders can help in reminding of fluid intake which is one of keeping menopause in control. Lack of body fluids can cause dizziness which could case harm to your productivity or work assigned.
- Activity recorder can record activities such as Hot flashes, Meal intake, sleep, exercise, moods, symptoms, periods, dizziness. These data collected can be submitted to a doctor for further diagnoses.
- Machine Learning can help in predicting hot flash and periods* based on the data collected everyday. We can run basic ML algorithms such as RandomForest and LinearRegression to get good results. We don't need any complex custom algorithms as far as the data is concerned. (Data on menopause which we collect during app usage seems to be relatable in some way or the other)
- Meditation can come really handy to control constant mood swings. The most simple breath in breath out meditation is a very effective method for stressed out people while it does take some time to get used to even such simple meditation techniques.
- Voice assistant can help you get your work done without touching your phone. Using STT (speech to text) and TTS(text to speech) modules for reminding you of task, reading you out good blogs on menopause to make you feel good. As of now google keyboards comes with voice features so you fill any input text area with your voice.
- Quickly connect with nearby doctors in case of emergencies and any problems.
- Meet and reach out to people for more personal care.
"The only way to learn a new programming language is by writing programs in it." - Dennis RitchieWhy Flutter over other Android Frameworks?
- Same UI and business logic in all platforms. Single code base works for iOS, Android, Web and Desktop.
- Hot Reload, Hot Restart saves a ton of time compared to other Android frameworks. Using this feature Flutter actually changes that specific line of code in the deployment instead of rebuilding the whole thing again.
- Almost Native App performance because its build using Dart so nothing to do with JavaScript and much faster than React Native.
- Custom, polished, flexible and smooth UI
- As you can see I developed this app from scratch in just 4-5 days. This is perfect for MVP (Minimal Viable Product). Develop quickly and launch quickly to both iOS and Android in the same time.
(I have also mentioned the features which I have have partially coded)
- Record activities like Periods, Water intake and Sleep comfortability. (menopause tracker)
- Fetching some of the best blogs to guide women with menopause.
- Create Insights (graphs and prediction) using the previous collected data.
- Play music for optimum concentration while work.
- Connect with doctors nearby in case of emergency.
- An about page to start collaborating for development of this app.
I know some features which make my app different from others are not yet coded. Read TODO section to see the features yet to be implemented into the app. (Am working on it in a private branch).
- Bringing the best of multiple blogs on Menopause into a single place.
- Music for work and concentration (head over to https://www.brain.fm/science and read the three whitepapers mentioned at the bottom of the page and they also mentioned some sort of "Patented Neural Phase Locking", this technique may not work for everybody)
- Activity tracker with some Machine Learning capabilities for prediction of Hot Flashes.and other severities. A paper I guess which pretty much tell everything "Personalized solutions for menopause through artificial intelligence: Are we there yet?" hope after going through the paper you got an idea how easy it is to use ML for Menopause. (https://www.maturitas.org/article/S0378-5122(19)30646-2/pdf)
- In-app VR for soothing experiences in case of Hot Flashes. (Did you know some scientific research says that the pain we feel comes from our brain and if we can try to control it or distract that feeling we can eliminate most of pain.)
- Meditation for control over anxiety. (blogs and video)
- Task tracker for work boost. (using simple checkbox widgets and a json file for storing locally)
- In-app voice assistant for note taking (voice based note taking code is already implemented by one of my friends.)
- The voice assistant can be used for in-app navigation and for reading blogs too.
I guess there aren't any apps in the store which do so many menopause focused things at once.
"In some ways, programming is like painting. You start with a blank canvas and certain basic raw materials. You use a combination of science, art, and craft to determine what to do with them." - Andrew HuntApp structure
Dependencies (check out the pubspec.yml for dependency version)
- curved_navigation_bar
- dio
- flutter_web_browser
- path_provider
- youtube_player_flutter
- rflutter_alert
- barbarian
- flutter_input
Please give kudos to the above package publishers, its because of their packages today we can quickly create a flutter app from scratch.
The main file is like a skeleton as the actual code resides in the content file. We have used some custom fonts downloaded externally in this app.
Now as you can see the main.dart file simply calls the content.dart file. Only the background, bottomNavigation and appBar come from main.dart.
import 'package:flutter/material.dart';
import 'package:curved_navigation_bar/curved_navigation_bar.dart';
import 'content.dart';
Content cont = new Content();
void main() => runApp(MaterialApp( home: MenoMood(), title: 'MenoHack', ), );
class MenoMood extends StatefulWidget { @override _MenoMoodState createState() { cont.makeList(); return _MenoMoodState(); } }
class _MenoMoodState extends State<MenoMood> {
int _page = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Menopause Mood Hack!',
style: TextStyle(fontFamily: 'Lobster', fontSize: 30),),
backgroundColor: Colors.pink,),
bottomNavigationBar: CurvedNavigationBar( index: 0, height: 50.0, items: cont.menuIcons,
color: Colors.yellow.shade200, buttonBackgroundColor: Colors.white, backgroundColor: Colors.teal.shade700,
animationCurve: Curves.easeInOut, animationDuration: Duration(milliseconds: 300),
onTap: (index) { setState(() { _page = index; }); },
),
body: Container(
decoration: BoxDecoration(image: DecorationImage(image: AssetImage('asset/images/splash.png'), fit: BoxFit.cover)),
child: Center( child: ListView(children: cont.changePage(_page) ), ),
),
);
}
}
- content.dart(just some important snips of the full code)
I coded the content.dart like snips, every task is encapsulated in a different block.
openBrowserTab is snip for in-app browser from the flutter web browser package
static openBrowserTab(String url) async { await FlutterWebBrowser.openWebPage(url: url, androidToolbarColor: Colors.pink.shade100); }
This is how I called all the snips at once.e.x. insights() if for the insights page and so on.
makeList(){
insights();
blogify();
activify();
musicify();
speakfy();
theAbout();
}
All our blog content is dynamic. The content of the blog comes from a json file which we download after the launch of the app. So here we basically download and create the blog snips inside the blog page.
blogify() async {
String jsonfile = "https://raw.githubusercontent.com/AJV009/meno_mood_hack/master/netData/blog.json";
Directory appDirectory = await getApplicationDocumentsDirectory();
String savePath = appDirectory.path+"/blog.json";
try {await Dio().download(jsonfile,savePath);}
catch(e){}
Map jsondata = json.decode(await new File(savePath).readAsString());
jsondata.forEach((key, value) {
blogWid.add(blogsnip(key, value));
});
}
blogsnip - a widget for creating a clickable button with text
static Widget blogsnip(String desc, String url) {
return Padding(
padding: const EdgeInsets.all(3.0),
child: SizedBox(
width: double.infinity,
child: FlatButton(
color: Colors.pink.shade50,
onPressed: () => openBrowserTab(url),
child: Text(desc, style: TextStyle(fontSize: 20.0,),),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
),
),
);
}
Using barbarian to store and retrieve data from disk (water, period, sleep are dynamic list objects) This code is for the insights and activities.
barbaDataCheck() async {
await Barbarian.init();
try {
water = Barbarian.read('water');
period = Barbarian.read('period');
sleep = Barbarian.read('sleep');
}
catch(e){}
Barbarian.write('water', water);
Barbarian.write('period', period);
Barbarian.write('sleep', sleep);
}
The final widget is the music widget, this widget again pulls a json file with some text and video URL and then we use a YoutubePlayer package to display the video in our app.
musicify() async {
String jsonfile = "https://raw.githubusercontent.com/AJV009/meno_mood_hack/master/netData/music.json";
Directory appDirectory = await getApplicationDocumentsDirectory();
String savePath = appDirectory.path+"/music.json";
try {await Dio().download(jsonfile,savePath);}
catch(e){}
Map jsondata = json.decode(await new File(savePath).readAsString());
jsondata.forEach((key, value) {
YoutubePlayerController controller = YoutubePlayerController(
initialVideoId: YoutubePlayer.convertUrlToId(value),
flags: YoutubePlayerFlags( autoPlay: false, loop: true) );
audWid.add(YoutubePlayer( controller: controller, showVideoProgressIndicator: false, ));
});
}
"Testing leads to failure, and failure leads to understanding." - Burt RutanWhat I learned
- How Menopause affected women. The challenges they faced while trying to live out. There sufferings because of years long Menopause. Certain conditions like osteoporosis or cardiovascular disease may increase.
- Android Flutter Development. (Its fun and easy compared to Java app development)
"Just pray that this scary thing doesn't happen to our mothers and sisters, and for those suffering recover fast using the technologies the world is presenting today." - Alphons JaimonChallenges Faced
- Memory Leak during build because of wrong dependencies. (worst, my PC freezes every-time during a memory leak!)
- Being my first App I actually spend a lot of time trying to figure out various things in Flutter Development. (An experienced developer can recreate this App within 1 day.)
"I have never failed, just found 10, 000 ways that wont work."- Thomas A. EdisonTODO:
- iOS binaries (need a MacBook for iOS Development)
- Publish to Play Store and App Store
- Voice Assitant in App for touchless interface
- Smoother UI, Auto blog update, OTA update
- Replace video player with Music player which plays from YouTube, SoundCloud and brain.fm.
- Decrease Splash Screen delays and add a image
- Replace JSON with Firebase. Not just json but if I have enough community support Ill make the app more functional using Firebase for almost everything.
- Use simple on-device ML algos for prediction of other symtoms and complexities. (There already a easy to use package for ML in Dart. the same way we use sklearn)
- Forums support (discuss and share experencies)
- Voice analysis using Deep Learning (To detect emotion or feelings)
- Fitness tracker support
"No application in this world is ever fully complete it changes or evolves based on user needs and advancements in technology."- Alphons JaimonBuild and Install
My PC build Setup (HP EliteBook 8470p)
- 8GB RAM, 500GB HDD
- Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz, 2601 Mhz, 2 Core(s), 4 Logical Processor(s)
Flutter version details (from 'flutter doctor')
- Flutter (Channel stable, v1.17.0, on Microsoft Windows [Version 10.0.18363.778], locale en-US)
- Android toolchain - develop for Android devices (Android SDK version 29.0.2)
- Android Studio (version 3.6), Flutter plugin version 45.1.1, Dart plugin version 192.7761
- VS Code, 64-bit edition (version 1.44.2)
Build Project from source code
Being a Flutter code it can be compiled for both Android and iOS. (For iOS some changes have to be made in different files)
Note: Hope you have already setup Flutter SDK on whatever editor you are using VS-Code,Android Studio or Emacs. Clone this project and build using flutter!
Step1: Open a terminal and clone the project from my GitHub repo using a git client.
$ git clone https://github.com/AJV009/meno_mood_hack
Step 2: change your path / cd to the cloned project
$ cd /meno_mood_hack
Step 3: Run this flutter command to download and update your dependencies. (it would take around 2-3secs based on your internet connection)
$ flutter pub get
Step 4: This command cleans all previous build data and junk and make it ready for a clean build.
$ flutter clean
Step 5: Attach your "Android Phone" with debugging mode enabled (ADB) and use this command to run the app on the phone.
$ flutter run
Some docs about debugging - Oem Debuggers, Android Studio Debugging, Xcode Debugging and Flutter Debugging docs.
"Build for the betterment of lives!"- Alphons Jaimon
Binaries (Build using 'flutter build apk --split-per-abi')
As of now, I couldn't afford to publish in a App Store, but the binaries are available for you to download and install. All the latest updated binaries are stored in binaries folder with the architecture name as tail of the filename.
Notes- I learned Flutter from Introduction to Flutter Development Using Dart course by The App Brewery created in collaboration with the Google Flutter team
- Am not any sort of advertiser of brain.fm. I have got no deal with brain.fm or any of there products. I have experienced it and has been effective throughout the project development cycle. There are more such music apps for concentration building you can try them out.
- Flowcharts were made using Darw.io, a desktop version is available too.
- This project will remain Open Source forever! (I LOVE OS)
- I cant build iOS binaries because I don't own any Apple devices and my development PC is not capable enough to emulate MacOS. Ill buy a Mac device sometime soon for development.
- Next update of this guide will be made next month.
- Being my first Flutter project I'll keep on completing the TODO list as they are easy just bit of time consuming because am fairly new to mobile development. So watch and star this repository for updates. Also this project will be a nice addition to my resume.
Comments