I used sample application to Backup the Logcat file in SD card.First it create the Sample_log_file.txt in the SD card Location and then we give write to read the logcat file command like -d -f
The following code is
try {
File filename = new File(Environment.getExternalStorageDirectory()+"/Sample_log_file.txt");
filename.createNewFile();
String cmd = "logcat -d -f "+filename.getAbsolutePath();
Runtime.getRuntime().exec(cmd);
} catch (IOException e) {
e.printStackTrace();
}
You must give the permission in AndroidManifest.xml
<uses-permission android:name="android.permission.READ_LOGS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Go and check the file in DDMS->open File Explorer->open Mnt(management)->SD Card->sample_log_file.txt
/ **Log file shown in the word**/
The following code is
try {
File filename = new File(Environment.getExternalStorageDirectory()+"/Sample_log_file.txt");
filename.createNewFile();
String cmd = "logcat -d -f "+filename.getAbsolutePath();
Runtime.getRuntime().exec(cmd);
} catch (IOException e) {
e.printStackTrace();
}
You must give the permission in AndroidManifest.xml
<uses-permission android:name="android.permission.READ_LOGS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Go and check the file in DDMS->open File Explorer->open Mnt(management)->SD Card->sample_log_file.txt
/ **Log file shown in the word**/
Being named as the framework, it allows HTML / CSS / Javascript developers to easily deliver cross-platform applications, Cordova
ReplyDeleteBest technology blogs
Best technology in the world
Best technology to learn
android app development
programming tutorials
mobile application development
latest web development technologies
web design company
Catch up with the most reliable development trends and find solutions to the issues that may arise.
ReplyDeleteBest technology to learn
Best technology blogs
Online graphic designing courses
tech blogspot
Very good brief and this post helped me alot. Say thank you I searching for your facts. Thanks for sharing with us!
ReplyDeleteAuthorized apple service center in Chennai | apple service center in chennai | Authorized apple service center in Chennai | apple service center in chennai | Mobile service center in chennai
"I visited your blog you have shared amazing information, i really like the information provided by you, You have done a great work. I hope you will share some more information regarding full movies online. I appreciate your work.
ReplyDeleteThanks"
Medium Bloglovin Mystrikingly Justpaste Mystrikingly Medium