/CR_Alarm

Automatic alarm - based on latest tweet/post

Primary LanguageDart

CR Alarm

Autmatic alarm - based on latest tweet


The CR Alarm App is a Flutter-based Android app that auto set alarms based on the time of the latest post / tweet of a specific FB Group / Twitter user that fetches from api. When that specific user post in that group or tweets, it sets an alarm so that you don't miss that user's posts, even if you sleep.

One usecase

Suppose In university, there is a CR (Class Representative) in your class. He posts the class schedule that he receives from the teachers in a Facebook group. However, you never know when he will post, and sometimes teachers may inform the CR of the class schedule 15 or 30 minutes in advance while you are fast asleep. Now imagine if there was an alarm clock app that would only sound when CR published a class schedule. You are no longer need to miss classes in the future.

Download latest version from here

Features

  • Auto sets alarm
  • Making a api backend & hosting
  • Auto fetching tweets/post from api
  • Adding Background service (App can be closed from recent tab)
  • Making a functional UI
  • Adding Facebook api support (only when FB Group is public)
  • Allow users the ability to select which group posts they want to follow.
  • Allow users the ability to select whose tweets they want to follow.
  • Android SDK Platform Support
    • Currently supported: Android 9 (API level 28) and below
    • Not supported: Android 10 (API level 29) and above cause only problem is android.intent.action.SET_ALARM action from Android Intent Plus plugin is only executing when the app is in the screen, it is not executing when the app is in recent tabs or closed or in background.

Installation

  • You should have properly installed flutter & Emuletor in your machine.
  • Clone the repository to your local machine.
  • Run this in terminal to install the required packages.
flutter packages get
  • Run the app using
flutter run

if below error come from api calling

HandshakeException: Handshake error in client (OS Error: CERTIFICATE_VERIFY_FAILED: certificate has expired(handshake.cc:393))

Then use this video https://youtu.be/aaXMUM-_4lQ

or

Step 1: In your main.dart file, add or import the following class:

class PostHttpOverrides extends HttpOverrides{
  @override
  HttpClient createHttpClient(context){
    return super.createHttpClient(context)
      ..badCertificateCallback = (X509Certificate cert, String host, int port)=> true;
  }
}

Step 2: Add the following line after function definition In your main function:

HttpOverrides.global = new PostHttpOverrides();

Example :

import 'dart:io';
 
 
import 'package:flutter/material.dart';
import 'package:point/routes.dart';
import 'package:point/theme.dart';
 
import 'login/LoginScreen.dart';
 
class PostHttpOverrides extends HttpOverrides{
  @override
  HttpClient createHttpClient( context){
    return super.createHttpClient(context)
      ..badCertificateCallback = (X509Certificate cert, String host, int port)=> true;
  }
}
 
void main() {
  HttpOverrides.global = new PostHttpOverrides();
  runApp(MyApp());
}
 
class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
 
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: theme(),
      // home: SplashScreen(),
      // We use routeName so that we dont need to remember the name
      initialRoute: LoginScreen.routeName,
      routes: routes,
    );
  }
}

Acknowledgements