Hi Guys, Welcome to Proto Coders Point, So a few days back I got a query from one of my subscribers on my youtube channel that his android studio logcat is not showing anything,
Then Today I was working on my project and I was testing the app on my 2 devices as shown in the video Below
Then what was happening is MI A2 log data is getting displayed in android studio, but Redmi Note 7 Pro logcat not showing android studio. Even I faced the same issue i.e. android studio logcat not showing.
So Then I tried to find the solution for the Empty logcat, I visited StackOverflow and many other websites to find the Solution, I almost spend 4 hours solving it.
Android studio logcat not showing anything
So here are some Solution you can try
Solution 1: Restarting your Android Studio
In your IDE Go to File > Invalidate Caches and Restart > Invalidate and Restart. This Solution will clear all the caches of Android studio IDE and restart it automatically, By the method, there are 80% change that Logcat will start work as before.
Refer screenshot below
Solution 2: Restart your mobile Devices
Just restart your mobile device and then check if logcat is showing or no.
Solution 3: Android Debug Bridge (ADB) use libusb backend
and then restart your android studio with Invalidate cache & Restart
Solution 4: Increasing Logger Bugger Sizes ( This Worked with me )
In your mobile device go to –>Settings –> Developer Options –> search for Logger buffer Sizes ( change it to 1M or Bigger size ) and then your android studio IDE will show data in Logcat.
Hi Guys, Welcome to Proto Coders Point, In this flutter tutorial we will create a flutter app for demonstrating “Firebase login example using provider package”.
Video Tutorial for Firebase login using flutter provider
What is Flutter Provider?
In Short, Provider flutter is like a way to use an InheritedWidget.
For Example: If any data gets changed and need to updated into the App UI, then Instead of rebuilding full hierarchy of Widgets, we can simply Update value of Flutter Provider Consumer Widgets.
Watch video tutorial to add firebase to your flutter app
So now our flutter project is been connected to our firebase console.
Step 3: Add Required Dependencies
So as you now we are adding authentication feature using Firebase service i.e. Firebase Authentication so for that we need firebase_auth dependencies, and by using provider flutter we will implement provider login & Registration to firebase so for that we need provider dependencies.
Open pubspec.yaml file and all both the dependencies
dependencies:
firebase_auth: # for latest version visit official site
provider: ^4.3.2+3
Step 4 : Create Folder
Under lib directory of your flutter project create 2 folders namely as stated below:
ProviderHelper : This will have 1 dart file “ProviderState.dart”, that will help us in registration and Login to the flutter application using firebase auth functions.
Screens : Here we will have 3 dart file, First for Registration UI Screen : Used to register to firebase auth. Second for Login UI Screen : Used to login using firebase auth. Third for Dashboard Page : after success login page.
Step 5 : Code
Under ProviderHelper folder create a dart file by name : ProviderState.dart and copy the code as given below.
In above code we make use of firebase auth instance using which we can call firebase auth methods: createUserWithEmailAndPassword : This Method accept 2 parameter i.e. Email & Password string, When this is called it will create auth user in firebase auth console. signInWithEmailAndPassword : This Method also accept 2 parameter i.e. Email & Password string, When this is called it will check in firebase auth if user account is exist, if yes then user will be logged in to the app.
UI Screen
Under Screens folder create dart file as below and add respective code
Hi Guys, Welcome to Proto Coders Point, In this Android Tutorial we will check out How to get mac address of android phone programmatically – find mac address android devices.
So let’s begin
Find MAC Address of android Device Programmatically
Step 1 : Create a new Android Project
Step 2 : Add required Permission
Then, to get MAC Address of any android device you need to add some permission like ACCESS WIFI STATE, INTERNET, ACCESS NETWORK STATE.
To add them:
In your Android Manifest.xml file add below uses permission, just before <application> tag begin
By calling above getMacAddress() you will get mac address of android device.
String mobile_mac_addres = getMacAddress(); //call the method that return mac address
Log.d("MyMacIS",mobile_mac_address); // print the mac address on logcat screen
Here, we are calling getMacAddress() method and storing the MAC ADDRESS in a String Varaible.
How to get mac address of android phone programmatically – Complete Source Code
Hi Guys Welcome to Proto Coders Point, In this article we will learn how to add calender in your flutter application.
Calender Widget in Flutter App
Using Calender you can organize the day, week and month, you can also check religious or any social event in flutter calender widget, It keeps a data of event or festival event that comes on a particular date or ant special event on calender.
In this tutorial article, we will check out how to use table_calender widget to display calender widget in flutter application.
So as you know that flutter team, keeps on work to build best UI widget so that developer work becames much easier, So our Flutter team has provided a best simple calender by name “Table_Calender“ that makes easy to display a calender in our flutter app.
The table calender widget in flutter is a powerful widget which comes with many feature, customizable feature and even such a gesture and animation etc.
Feature of table calender widget
Easy to use API.
UI can be controlled using Custom Builder calender
Beautiful animation feature.
Gesture Detector
Has Multiple calender formats like year, month, week.
It has vertical auto sizing.
So, Let’s begin adding calender in flutter app
Step 1: Create a new Flutter Project
OffCourse, you need to open an existing flutter where you want to add calender or create a new flutter project,
Start your favorite IDE, In my case i make use of Android studio to build flutter apps.
New -> New Flutter Project -> Give a project title for example “Flutter Calender Example”.
Step 2 : Adding Dependencies
In your flutter project structure, you will file a file by name ‘pubspec.yaml’ open it, you need to add the dependencies ‘table_calender’ .
1 : First we need to create a object for CalenderController that controls all the evven/action happening in calender & you need to initialize it in initState().
class _HomeCalendarPageState extends State<HomeCalendarPage> {
CalendarController _controller; //controller creation
@override
void initState() {
super.initState();
_controller = CalendarController(); //initializing it
}Flutt
2 : Now you need to use calenderWidget i.e TableCalender as a child of Scafford Widget.
Scaffold(
body: SingleChildScrollView(
child: Column(
children: <Widget>[
TableCalendar() // snippet code // you need to customize it as per your UI // check below for full source code
],
),
),
above code is just a snipet code, you need to customize it as per you UI needs.
Flutter Calender Widget – Table Calender – Full Source Code
main.dart
Copy paste below code in main.dart file of your flutter project
Hi Guys, Welcome to Proto Coders Point, In this Flutter Tutorial we will create a app where user can select his desired theme either dark theme in flutter or light theme in flutter.
VIDEO TUTORIAL
Flutter Dynamic theme change using getX
Step 1 : Create a new Flutter project
Start your favorite IDE, In my case i am making user of ANDROID STUDIO to build Flutter project, you may use as per your choice.
Create a new Flutter project
IDE -> Files -> New > New Flutter Project -> give name -> give package name and finish
Then, once your flutter project is been created, you need to add 2 required dependencies i.e. GetX & Get Storage in pubspec.yaml
Step 3 : Adding images in Flutter project
create a package/folder in your flutter project structure, Right click on project -> New -> Directory (give name) and add image files in that folder.
After creating the directory you need to specify the path of the directory you have created in pubspec.yaml file so that your flutter project can access the images.
You can see in below screenshot, i have created folder by name images which has 2 images in it, and then in pubspec.yaml file i have gave the image path in flutter.
Step 4: The Code
If you face problem in understand below code, learn basic of Getx and Get Storage (link is below)
void main() async{
await GetStorage.init(); // before building the app you need to initialize GetStorage // so that we have access to use app data
runApp(MyApp());
}
Then, Create a instance of GetStorage class
final appdata = GetStorage(); // instance of GetStorage
Now, using instance create a key-value pair
appdata.writeIfNull('darkmode', false);
as you see above, ‘darkmode’ is a key and false is value stored in it.
bool isDarkMode = appdata.read('darkmode'); // get data from get storage and store in a boolean variable
This isDarkMode will store either true or false, If true then it means, user have previously turned on dark mode before closing the app.
and depending on isDarkMode, we will set the theme of the app either dark mode or light mode.
A Switch Widget to turn on/off dark mode dynamically in flutter
Be sure to ask for help in the comments if you need any. Suggestions for future Flutter tutorials are also very welcome! 🙂 For mobile application development keep learning freely from proto coders point Visit: https://protocoderspoint.com/
Hi Guys, Welcome to Proto Coders Point, In this Article we will learn about map in dart programming language.
Dart Map
In Dart or any other programming language, A Map Object is a key-value pair to store string or any dynamic data. Here, In dart map, A key & value can be of any datatype, It means that we can store any data type because a map in dart language is a dynamic collection of data/information.
In Flutter Dart, A map can be declared in 2 ways : –
Using Map Literals.
Using Map Constructor.
Declaring a map using Map Literals
To declare a map in dart you need to enclose the key-value pair in a curly bracket “{}”
Keys : This will return all the key in map object.
Values : Wiil return all the value in map object.
length : Return the number of key-value pair length/size.
isEmpty : Will return true if Map object is empty.
IsNotEmpty : Will return true if map value is not empty.
Function of Map dart
There are some comman task performed with Map in dart:
addAll() : Used to add all key-value of some other Map Object.
clean() : Remove all data from pair.
remove() : Remove Specific date of key.
foreach : used to iterate and read alll map entires.
addAdd() : Example
void main() {
var usrMap = {"name": "Proto Coders Point ", 'Website': 'https://protocoderspoint.com/'};
var map2 = {'email': 'protocoders.come'};
usrMap.addAll(map2);
print(usrMap);
}
output
remove() : Example
Removes Specific data of key – values from map data, it accept a key which is needed to be removed.
void main() {
Map m = { 'id': 01 ,'name': 'Rajat'};
print("Before removing : ${m}");
dynamic res = m.remove('name'); // here name is the key.
print("removed data is : ${res}");
print("After removing ${m}");
}
output
foreach : Example
By using foreach function in Map you can easily iterate and read all the maps entries.