Posts

Android Firebase Analytics Set up

  Connect Android Application to Firebase Analytics  Step 1: Add the Analytics SDK to your app (gradle) dependencies {     // Import the BoM for the Firebase platform     implementation platform('com.google.firebase:firebase-bom:26.1.1')     // Declare the dependency for the Analytics library     // When using the BoM, you don't specify versions in Firebase library dependencies     implementation 'com.google.firebase:firebase-analytics' } Step 2: Code to write to Analytics in your Android app (custom event) val analytics : FirebaseAnalytics =  FirebaseAnalytics.getInstance( this ) val bundle = Bundle() bundle.putString( "First_Category" , "First_catValue" ) bundle.putString( "sub_Cat" , "sub_CatValue" ) analytics .setDefaultEventParameters( null ) analytics .logEvent( "My_Custom_Event" , bundle) Step 3: You will see these in Events on the firebase console however can take 24 hours to show Step 4: Set up Analytics...

Big O asymptotic analysis/Big O notation

Big O asymptotic analysis/ Big O notation  Big O is one of the most fundamental tools for computer scientists to analyse the cost of an algorithm. Big O notation is used to calculate the runtime of the best, worse and expected case scenario. Big O only cares about the worse case scenario.  This is a way of comparing multiple solutions which solve the same problem, to find out which solution is the most efficient in terms of time and space complexity. For example they are multiple ways to drive to Liverpool football Club however lets choose the way that is quickest (time complexity) and is least stressful so it takes up less head space for the driver (space/memory complexity).  Time Complexity  How long does the algorithm take to complete? In the worse case scenario how long will it take to complete this algorithm?  The execution time  of a task in relation to the number of steps required to complete it. Example: Quick Sort Worse case= O(N2) - the pivot kee...
Notifications/Cloud Messaging Step 1: Call Firebase Function from native app/web app to send a notification Call firebase function from: Android App Call firebase function from: Web App Part one Part Two Step 2: The Firebase function to send a notification/cloud message to all users: Step 3 - The 3 states: (1)Background, (2)Not running and (3)in the app Tap on notification and open an activity/alert with data when app is in the background or not running Receiving notification when app is in the background: By default notification shows on device notification list. Receiving notification when is not running: By default notification shows on device notification list. Applies to background and not running state When the firebase function fires, it needs to return data (shown above - messageData) which will allow you to access the information to display in your app. -------------------------------------------------------------------------------------------...

Android App - Gym League Table

This is an application which I created in Android Studio and wrote in Java to improve my programming abilities.  How the app works Step 1 -logging in or signing up Under the surface: The app loads the intent filter (MainActivity) which then goes to onResume and checks if user is logged in by check if  FirebaseAuth.getInstance().id is not null - If null this will start AcrtivityLogIn User: When a user signs up the app will take four videos to prove your lifts in the gym: 1. Bench Press  2. Squat 3. Deadlift 4. Over Head Press Step 2 - displaying and updating user data  Under the surface: The videos are stored in different files for each compound lift with the key being the FirebaseAuth.getInstance().id. Adding and removing listeners on the current logged in user data.  User: The above user input information is then stored in Firebase Cloud Firestore and can be accessed and updated in the profile activity/page.  ...

Azure Active Directory Authentication to an API using ASP.NET Web Application and API using ASP.NET Core Web Application in Visual Studio 2019

Image
How does Azure Active Directory Authentication work?   Step 1:  Log in to Azure Active Directory Step 2: Successful Azure Active Directory returns an access token Unsuccessful Azure Active Directory will deny you access Step 3: From your application you make a http request with the access token in the headers to the API The API receives this token and goes to Azure Active Directory to check if this token is authorised. Step 5: Successful If the API finds that the token is valid then you are granted access to the API and can use its methods such as GET< POST< PUT and DELETE Unsuccessful If the API finds that the token is invalid then you will be denied access to the API and will get a 401 unauthorised. How to create an azure active directory authentication API using ASP.NET CORE Web Application with an Android demonstration Step 1: API in Visual Studio Creating the API 1a. In Visual Studio select "ASP.NET Core Web Application" and press crea...

Understanding the basics of REST API with HTTP and JSON

Image
What is an API? The Messenger  API stands for Application Programming Interface.The API is the messenger that takes REQUESTS and tells the system what you want to do and returns a RESPONSE back to you. This allows two pieces of software to communicate with each other. Metaphor example: Waiter at a restaurant gets the REQUEST from customer and tells the Kitchen what to do and then delivers the RESPONSE back to the customer. One of the most popular types of API is REST or, as they’re sometimes known, RESTful APIs. What is REST ? Let us use HTTP requests to format those messages  The short answer is that REST stands for Representational State Transfer. Architecture style for designing network applications which are are stateless, meaning that the server does not need to know anything about what state the client is in and vice versa. In other words REST is a set of rules/standards/guidelines that follow the REST specification, basically governs the behaviour of clients a...

Basics of Azure Active Directory with Android Studio Demonstration

Image
What is Azure Active Directory? Well before we answer what is Azure Active Directory we must first understand what the Domain Controller is. Domain Controller(DC): is a server that manages network security, effectively acting as the gatekeeper for user authentication and authorisation. In simple terms its a log in system which you can implement within your Azure web or mobile app, to authenticate users sign in credentials and to then provide authorisation to get access to data in your application. Authentication:   is the process of verifying oneself. Authorisation:   Once authentication has been successful you are granted access to data in the application. Depending on your authorisation level you may only be able to access certain resources. So what is Azure Active Directory? is the central database on the domain controller where the login credentials(usernames and passwords) of all client computers, printers, and other shared resources in the network are stored...