Fill the amazon web service account creation form, note: you must also add your ATM debit/credit card details.
After filling and submitting the aws form amazon, will take 12-24 hours to verify your details & activate aws for you.
2. Sign In to AWS account
Once your aws account is verified, amazon will update you through email.
Login
3. Creating AWS Ubuntu Server instance EC2
on aws deashboard on top left, services > compute > EC2
Click on Launch Instance
search in amazon machine image (AMI)
In search box search for your desired aws server OS image “Linux, ubuntu, windows, macOS”.
choose aws instance type
Amazon EC2 Instance, provides a long lis of instance type, There are varities of aws searver specification like CPU, memory storage, performance speed.The higher specification you choose the best performance you get, and even billing will be huge (Hahahaha).
I recommended, You to go throught Free Tier, because amazon server give you free trial for 12 Month (team & condition is applied).
Download .pem file & finally launch instance
Please make sure .pem file is successfully downloaded, beause it’s an authentication key to login to the aws server, using filezilla, WinSCP or Putty.
Succesfully created aws server & the instance is runnning
Hi Guys, Welcome to Proto Coders Point. In this Article we will learn how to add github package to flutter project.
Sometimes we need to use latest flutter packages that is not yet been published in pub.dev but available in github repo.
or
In you have built your own flutter package & pushed it on github repository but not published in pub.dev, at that time you can add packages from github to flutter project directly.
How to Download Packages from Github to flutter
Open pubspec.yaml file and under dependencies section add the path to your get repository.
1. Method One
dependencies:
package_name:
git: <--- url --->
2. Method two – git from target branch
package_name:
git:
url: <--url-->
ref: dev
Here package_name descrives the name of the package,
git, it say pubspec.yaml to search for the package from github repo & url after that is to specify from where to clone the package.
Here package name, should be same as the name specified in pubspec.yaml of that github flutter package.
how to add package from github in flutter pubspec.yaml – Example
Hi Guys, Welcome to Proto Coders Point, In this flutter tutorial article, we will learn how to call a function at a specific interval of time.
There are some situation when we want to run a function every second, minute, hour, day or once a week to execute a task periodically and to do so we can make use of flutter cron job package.
Flutter Cron Job Scheduler
Cron Job in flutter are used to run function at certain time interval.
For Example: Suppose you want to call function every 1 minute, hour, day or month then flutter cron job libray is very useful its also called as time based job scheduler.
How to use cron flutter package
1. Flutter installing cron package
In your flutter project open pubspec.yaml file & under dependencies add cron.
dependencies:
cron: # keep version empty for latest version
After addmin cron plugin, hit pub get button or run flutter pub get cmd in terminal, to downlaod & install cron in flutter project.
2. Import cron
Now, once the job scheduler package is successfully installed, import it in you flutter dart code to use it.
Hi Guys, Welcome to Proto Coders Point, In this Nodejs project for beginner, We will learn how to build RESTAPI in nodejs using ExpressJS & MongoDB as NoSQL database.
NodeJS RESTAPI Example – Book Directory Project
In this NodeJS tutorial, We will develop backend RESTAPI a “Book directory project”, where we will perform CRUD operation like Create, Read, Update & Delete data from MongoDB Database.
Let’s get started with developing book list api using nodejs
1. Check for NODEJS & MONGODB Installed
I assume that you have installed the required environment(i.e. nodejs & mongoDB).
To check if nodejs & mongodb is installed or no, simply run npm -v & mongo --version in your command prompt & thus if installed it will show the version that is been installed.
Navigate to drive or directory where you want to create nodejs project
Create folder (book_dir_api) – mkdir book_dir_api
Navigate to newly created folder – cd book_dir_api
create package.json file – npm init
open nodejs project in vscode editor – code .
npm init will create a package.json file & will ask you to enter some details about your nodejs project. if you don’t want to fill any details information then simply run npm init -y
3. Install required nodejs module
We need 4 nodejs packages/modules
Express: For creating server & routes, basically express is used as middleware.
body-Parser: To be able to read & display response in json form.
mongoose: To store data in mongodb and get and update the data(Basicallly for CRUD operation).
nodemon: To auto restart nodejs server, when file changes is made.
Install them all at once using below command
npm i express body-parser mongoose nodemon
After installing all the above nodejs modules, your package.json will look like this,
check the highlight in above screenshot
"scripts": {
"dev": "nodemon index.js" //
}
index.js is the file that start/restarts every time there is some change in script.
4. Coding for nodejs book directory api mini project
My NodeJS Structure
Create 3 folders & respective js file as in above screenshot
1. config > db.js :Handles MongoDB connection using mongoose.
2. model > book_model.js : Will have mongodb mongoose schema(data structure).
3. routes > api.js : Will have all the routes to perform CRUD operation. It will handle routes such as:-
In below code’s we will call android native code, that return mobile flutter unique device id. To acheive this we will make use of MethodChannel to communicate with android native code.
Android native will get invoked from flutter code, when the user make a call, In our case we can calling android code to get mac address.
project > Android > app > src > main > kotlin
MainActivity.kt
package com.example.backpress
import android.util.Log
import android.widget.Toast
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel
import java.lang.reflect.Method
import java.net.NetworkInterface
import java.util.*
class MainActivity: FlutterActivity() {
private val CHANNEL = "com.example.getmac";
private lateinit var channel: MethodChannel
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
channel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger,CHANNEL)
channel.setMethodCallHandler { call, result ->
if(call.method == "getMAC"){
var mac = getMacAddress();
result.success(mac);
Toast.makeText(this, mac, Toast.LENGTH_LONG).show()
}
}
}
// a function that return mac
private fun getMacAddress(): String? {
try {
val all: List<NetworkInterface> =
Collections.list<NetworkInterface>(NetworkInterface.getNetworkInterfaces())
for (nif in all) {
if (!nif.getName().equals("wlan0", ignoreCase = true)) continue
val macBytes: ByteArray = nif.getHardwareAddress() ?: return ""
val res1 = StringBuilder()
for (b in macBytes) {
res1.append(String.format("%02X:", b))
}
if (res1.length > 0) {
res1.deleteCharAt(res1.length - 1)
}
return res1.toString()
}
} catch (ex: java.lang.Exception) {
}
return "02:00:00:00:00:00"
}
}
Note: Since Android 6 & IOS 7, Apple & Google has turned off the access to programmatically get device MAC Address, Therefore if you try to get mac address you will always get response as 02:00:00:00:00:00 .
Please read below Saying of Google & Apple:
Apple Saying’s
In iOS 7 and later, if you ask for the MAC address of an iOS device, the system returns the value 02:00:00:00:00:00. If you need to identify the device, use the identifierForVendor property of UIDevice instead. (Apps that need an identifier for their own advertising purposes should consider using the advertisingIdentifier property of ASIdentifierManager instead.)
Google Saying’s
To provide users with greater data protection, starting in this release, Android removes programmatic access to the device’s local hardware identifier for apps using the Wi-Fi and Bluetooth APIs. The WifiInfo.getMacAddress() and the BluetoothAdapter.getAddress() methods now return a constant value of 02:00:00:00:00:00.