New line writing to a file - android

I am trying to write to a file the log of my application. I have created an method which appends a line to the end of the line.
public static void write2Log(String s){
StringBuilder contents = new StringBuilder();
File root = Environment.getExternalStorageDirectory();
File logFile = new File(root, "testWrite2file.log");
if (root.canWrite()){
try {
BufferedReader input = new BufferedReader(new FileReader(logFile));
String line = null;
while (( line = input.readLine()) != null){
contents.append(line);
// contents.append(System.getProperty("line.separator"));
}
input.close();
FileWriter logWriter = new FileWriter(logFile);
BufferedWriter out = new BufferedWriter(logWriter);
out.write(contents.toString()+"\r\n"+s);////<---HERE IS MY QUESTION
out.close();
}
catch (IOException e) {
Log.e("test", "Could not read/write file " + e.getMessage());
}
}
}
Everything works fine less the new character line.
I have tried using:
\r\n
System.getProperty("line.separator")
newline()
But i keep getting all in just one line :(
Any ideas?

Try this:
FileWriter logWriter = new FileWriter(logFile);
BufferedWriter out = new BufferedWriter(logWriter);
out.write(contents.toString());////<---HERE IS THE CHANGE
out.newLine();
out.write(s);
out.close();

Try this
public static boolean writeLog(String user , Exception exS) {
boolean d = false;
try {
File root = new File("TVS_log");
if (!root.exists()) {
root.mkdirs();
}
String name = user + "_" + TimeReporter.getTodayAll() + "_" + "log.txt" ;
System.out.println(name);
File text = new File(root , name);
if (!text.exists()) {
text.createNewFile();
}
String aggregate = "";
for (StackTraceElement element : exS.getStackTrace())
{
BufferedWriter writer = new BufferedWriter(new FileWriter(text)) ;
String message = exS.toString() + " - " + element.toString() + "\r\n" ;
System.out.println(exS.toString());
System.out.println(element.toString());
aggregate += message;
writer.write (aggregate);
writer.newLine();
writer.flush();
writer.close();
writer = null;
}
if(text.exists())
return text.length() > 0;
}catch(Exception ex){
ex.printStackTrace();
}
return d;
}
TimeReporter class and function
public class TimeReporter {
public static String getTodaysDate() {
String d = "";
final Calendar c = Calendar.getInstance();
d = String.format("%02d", c.get(Calendar.YEAR))
+ String.format("%02d", c.get(Calendar.MONTH) + 1)
+ String.format("%02d", c.get(Calendar.DAY_OF_MONTH));
return d;
}
public static String getTodaysTime() {
String d = "";
final Calendar c = Calendar.getInstance();
d = String.format("%02d", c.get(Calendar.HOUR_OF_DAY))
+ String.format("%02d", c.get(Calendar.MINUTE))
+ String.format("%02d", c.get(Calendar.SECOND));
return d;
}
public static String getTodayAll() {
return getTodaysDate() + "_" + getTodaysTime() ;
}
public static String getNow() {
final Calendar c = Calendar.getInstance();
String ld = c.get(Calendar.YEAR) + "/" + (c.get(Calendar.MONTH) + 1)
+ "/" + c.get(Calendar.DAY_OF_MONTH) + " "
+ String.format("%02d", c.get(Calendar.HOUR_OF_DAY)) + ":"
+ String.format("%02d", c.get(Calendar.MINUTE));
return ld;
}
}

Related

Creating a new Folder in Android Internal memory with different name after each run

I have an android app that collect data from a sensor. After each run it creates bunch of text files (e.g. A.txt, B.txt, C.txt, ...). My problem is after each run, all the text files are overwritten. I want to create a folder with a new name consisting current date and time of creation (e.g. 2020-02-07_11_41), then save all my text files into the new created folder.
I am sorry, I have very low knowledge of Android Studio. the following is part of my code that I want to modify:
if (b != null) {
b.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
Random r = new Random();
int subID = r.nextInt(200000);
// set up subject data file
try {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.US);
Calendar c = Calendar.getInstance();
String astring = df.format(c.getTime());
astring = astring.replace(":", "_");
afilename = Environment.getExternalStorageDirectory().getPath() + "/donor_" + astring + ".txt";
File scdatafile = new File(afilename);
FileOutputStream scdataout;
OutputStreamWriter scdatawriter;
if (scdatafile.exists())
{
scdatafile.delete();
scdatafile.createNewFile();
scdatafile.setReadable(true);
scdataout = new FileOutputStream(scdatafile);
scdatawriter = new OutputStreamWriter(scdataout);
}
else
{
scdatafile.createNewFile();
scdatafile.setReadable(true);
scdataout = new FileOutputStream(scdatafile);
scdatawriter = new OutputStreamWriter(scdataout);
}
scdatawriter.append(" ");
scdatawriter.close();
scdataout.close();
} catch (Exception e) {
Toast.makeText(getBaseContext(), e.getMessage(), Toast.LENGTH_SHORT).show();
}
// set up time data file
try {
String scdatastring = Environment.getExternalStorageDirectory().getPath() + "/sctimedata.txt";
File scdatafile = new File(scdatastring);
FileOutputStream scdataout;
OutputStreamWriter scdatawriter;
if (scdatafile.exists())
{
scdatafile.delete();
scdatafile.createNewFile();
scdatafile.setReadable(true);
scdataout = new FileOutputStream(scdatafile);
scdatawriter = new OutputStreamWriter(scdataout);
}
else
{
scdatafile.createNewFile();
scdatafile.setReadable(true);
scdataout = new FileOutputStream(scdatafile);
scdatawriter = new OutputStreamWriter(scdataout);
}
scdatawriter.append(Integer.toString(subID) + "\t");
scdatawriter.close();
scdataout.close();
} catch (Exception e) {
Toast.makeText(getBaseContext(), e.getMessage(), Toast.LENGTH_SHORT).show();
}
Try below code
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault()).format(new Date());
String currDate = new SimpleDateFormat("MM/dd/yyyy", Locale.getDefault()).format(new Date());
String createFolderPath = Environment.getExternalStorageDirectory().getPath() + "/yourAppName" + currDate;
FileOutputStream scdataout;
OutputStreamWriter scdatawriter;
File createFolder = new File(creatFolderPath);
if(!createFolder.exists()){
createFolder.mkdirs();
}
String outputName = Environment.getExternalStorageDirectory().getPath() + createFolderPath + "/donor_" + timeStamp + ".txt";
scdataout = new FileOutputStream(outputName);
scdatawriter = new OutputStreamWriter(scdataout);
...
//Your Code
I hope this can help you!
Thank You.

Speeding up the doinbackground() process

I'm splitting an encrypted video into 4 parts using this code
public class SplitVideoFile {
private static String result;
static ArrayList<String>update=new ArrayList<>();
public static String main(File file) {
try {
// File file = new File("C:/Documents/Despicable Me 2 - Trailer (HD) - YouTube.mp4");//File read from Source folder to Split.
if (file.exists()) {
String videoFileName = file.getName().substring(0, file.getName().lastIndexOf(".")); // Name of the videoFile without extension
// String path = Environment.getDataDirectory().getAbsolutePath().toString() + "/storage/emulated/0/Videointegrity";
String path = "/storage/emulated/0/Videointegrity";
// File myDir = new File(getFile, "folder");
//myDir.mkdir();
File splitFile = new File(path.concat("/").concat(videoFileName));//Destination folder to save.
if (!splitFile.exists()) {
splitFile.mkdirs();
Log.d("Directory Created -> ", splitFile.getAbsolutePath());
}
int i = 01;// Files count starts from 1
InputStream inputStream = new FileInputStream(file);
String videoFile = splitFile.getAbsolutePath() +"/"+ String.format("%02d", i) +"_"+ file.getName();// Location to save the files which are Split from the original file.
OutputStream outputStream = new FileOutputStream(videoFile);
Log.d("File Created Location: ", videoFile);
update.add("File Created Location: ".concat(videoFile));
int totalPartsToSplit =4 ;// Total files to split.
int splitSize = inputStream.available() / totalPartsToSplit;
int streamSize = 0;
int read = 0;
while ((read = inputStream.read()) != -1) {
if (splitSize == streamSize) {
if (i != totalPartsToSplit) {
i++;
String fileCount = String.format("%02d", i); // output will be 1 is 01, 2 is 02
videoFile = splitFile.getAbsolutePath() +"/"+ fileCount +"_"+ file.getName();
outputStream = new FileOutputStream(videoFile);
Log.d("File Created Location: ", videoFile);
streamSize = 0;
}
}
outputStream.write(read);
streamSize++;
}
inputStream.close();
outputStream.close();
Log.d("Total files Split ->", String.valueOf(totalPartsToSplit));
result="success";
} else {
System.err.println(file.getAbsolutePath() +" File Not Found.");
result="failed";
}
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
public ArrayList<String> getUpdate()
{
return update;
}
And in my activity file i call this using async task's doinbackground method like below
protected String doInBackground(Void...arg0) {
Log.d(TAG + " DoINBackGround", "On doInBackground...");
File encvideo=new File(epath.getText().toString());
SplitVideoFile split=new SplitVideoFile();
String result=split.main(encvideo);
publishProgress(1);
return result;
}
Even though it splits the video, it takes too much of time to do the process.
How can I speed them up. As I'm showing a progress bar in preexecute method it looks like the user sees the progress bar for a long time, which I don't want.

ArrayList skipping some data while adding data in RecyclerView

Well I am running a loop to get data...it get's all the data of the month June..but when it comes to 19-June-2019 it skips the record and moves further without adding data into ArrayList.
My code
this.connection = createConnection();
Statement stmt = connection.createStatement();
Calendar last_month_data = Calendar.getInstance();
last_month_data.add(Calendar.MONTH, -1);
n=last_month_data.getActualMaximum(Calendar.DAY_OF_MONTH);
String last_month_year = new SimpleDateFormat("MMM-
yyyy").format(last_month_data.getTime());
String month_name = lastMonth.getText().toString();
for (int i = 1; i <= n; i++) {
String date = i + "-" + last_month_year;
ResultSet resultSet = stmt.executeQuery("Select
ATTN_TYPE,TO_CHAR(ATTN_TIME,'HH24:MI'),REMARK from MATTN_MAS
where ATTN_DATE='" + date + "' and Username='" + Username + "'
ORDER BY TRAN_NO DESC");
String Attn_Type;
SimpleDateFormat format = new SimpleDateFormat("dd-MMM-yyyy");
Date d=format.parse(date);
SimpleDateFormat fomat1=new SimpleDateFormat("EEEE");
String weekName=fomat1.format(d);
StringBuffer myweekDate=new StringBuffer(weekName+", "+date);
String weekDate=myweekDate.toString();
if (resultSet.next()) {
while (resultSet.next()) {
Attn_Type = resultSet.getString(1);
String Time = resultSet.getString(2);
String Reason = resultSet.getString(3);
if (Attn_Type.equals("I")) {
String Attn_Type_In = "In";
String Attn_Type_Out = null;
StringBuilder stringBuilder = new StringBuilder("" + i);
String date_no = stringBuilder.toString();
myOptions.add(new Attendance_Data(Attn_Type_In,
weekDate, Reason, i, date_no, month_name,Time));
} else{
String Attn_Type_Out = "Out";
String Attn_Type_In = null;
StringBuilder stringBuilder = new StringBuilder("" + i);
String date_no = stringBuilder.toString();
myOptions.add(new Attendance_Data(Attn_Type_Out,
weekDate, Reason, i, date_no, month_name,Time));
}
}
}else {
Attn_Type = "Absent";
String out = null;
String Reason=null;
String Time=null;
StringBuilder stringBuilder = new StringBuilder("" + i);
String date_no = stringBuilder.toString();
myOptions.add(new Attendance_Data(Attn_Type, weekDate,
Reason, i, date_no, month_name,Time));
}
}
}catch (Exception e){
System.out.println("My Error"+e);
}
}
I want all the data of June from date 1 to date 30 but if there are no records of the given date it should insert Absent in ArrayList, Above code is working fine for all the date but the problem is it is not adding data for 19-Jun-2019 in ArrayList even no error is been shown I am not getting what exactly the problem is please help me out.
Please Check this Screenshot for more details...after Thursday,20 it skips 19, Wednesday and displaying data for Tuesday
Ok I got the answer thanks...
We have to use do....while instead of just while....it was
just skipping single data each time.....bcoz while is not
going to check second time if data is available or not....below is
the code...
.
if (resultSet.next()) {
do {
Attn_Type = resultSet.getString(1);
String Time = resultSet.getString(2);
String Reason = resultSet.getString(3);
if (Attn_Type.equals("I")) {
String Attn_Type_In = "In";
String Attn_Type_Out = null;
StringBuilder stringBuilder = new StringBuilder("" + i);
String date_no = stringBuilder.toString();
myOptions.add(new Attendance_Data(Attn_Type_In,
weekDate, Reason, i, date_no, month_name, Time));
} else {
String Attn_Type_Out = "Out";
String Attn_Type_In = null;
StringBuilder stringBuilder = new StringBuilder("" + i);
String date_no = stringBuilder.toString();
myOptions.add(new Attendance_Data(Attn_Type_Out,
weekDate, Reason, i, date_no, month_name, Time));
}
} while (resultSet.next());
} else {
Attn_Type = "Absent";
String out = null;
String Reason = null;
String Time = null;
StringBuilder stringBuilder = new StringBuilder("" + i);
String date_no = stringBuilder.toString();
myOptions.add(new Attendance_Data(Attn_Type, weekDate,
Reason, i, date_no, month_name, Time));
}
}
}
..Output of above code is in below image..

how to recursively copySDcard directory and subdirectory to other smb directory(samba)?

i am using Jcifs library.
i try this code is working copy parent directory and file but sub directory not copy..
calling function
for (int j = 0; j < AppConst.checkfilelist.size(); j++) {
String old = AppConst.checkfilelist.get(j);
Log.d("smb_c_check_item", "" + AppConst.checkfilelist.get(j));
copyToDirectory(old, AppConst.destinationpath);
}
Function
public int copyToDirectory(String old, String newDir) {
try {
SmbFile old_file = new SmbFile(old);
SmbFile temp_dir = new SmbFile(newDir);
Log.d("smb_c_sour:desti_dir", "" + old + "---" + newDir);
// copy file
if (old_file.isFile()) {
Log.d("smb_c_file","yes");
String file_name = old.substring(old.lastIndexOf("/"), old.length());
Log.d("smb_c_file_name", "" + file_name);
String servername="smb://+ ipaddress+/";
NtlmPasswordAuthentication auth1 = new NtlmPasswordAuthentication(servername, "", "");
// smb file path
SmbFile cp_smbfile = new SmbFile(newDir + file_name.substring(1),auth1);
Log.d(" smb_c_file_path", "" + cp_smbfile);
if (!cp_smbfile.exists())
cp_smbfile.createNewFile();
cp_smbfile.connect();
InputStream in = new FileInputStream(String.valueOf((old_file)));
SmbFileOutputStream sfos = new SmbFileOutputStream(cp_smbfile);
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
sfos.write(buf, 0, len);
}
// copy directory
} else if (old_file.isDirectory()) {
String servername="smb://+ ipaddress+/";
NtlmPasswordAuthentication auth1 = new NtlmPasswordAuthentication(servername, "", "");
Log.d("smb_c_folder","yes");
String files[] = old_file.list();
int len = files.length;
Log.d("smb_c_dirlength", "" + len);
for(int i1=0;i1<len;i1++){
Log.d("smb_c_dir---",""+files[i1]);
}
// remove last character
old = old.substring(0, old.length() - 1);
// get dir name
String old_f = old.substring(old.lastIndexOf("/"), old.length());
Log.d("smb_c_old_f", "" + old_f);
//create smbfile path
SmbFile smbdir = new SmbFile(newDir + old_f.substring(1),auth1);
// create new directory
if (!smbdir.exists()) {
Log.d("smb_c_mkdir", "created");
smbdir.mkdirs();
//return -1;
}
Log.d("smb_c_dir", "" + smbdir);
for (int i = 0; i < len; i++) {
copyToDirectory(old + "/" + files[i], smbdir + "/");
Log.d("smb_copy_rec", "" + old + "/" + files[i] + ":" + smbdir + "/");
}
} else if (!temp_dir.canWrite())
Log.d("smb_c_dir_noperm","yes");
return -1;
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return 0;
}
Thanx in advance for any suggestions or help.sorry for my bad eng..
i found solution..
public int copySdToSmb(String old, String newDir) {
try {
File copyfile = new File(old);
SmbFile temp_dir = new SmbFile(newDir);
if (copyfile.isFile()) {
SmbFile cp_smbfile = new SmbFile(newDir + copyfile.getName());
if (!cp_smbfile.exists())
cp_smbfile.createNewFile();
cp_smbfile.connect();
InputStream in = new FileInputStream(copyfile);
SmbFileOutputStream sfos = new SmbFileOutputStream(cp_smbfile);
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
sfos.write(buf, 0, len);
}
in.close();
sfos.close();
} else if (copyfile.isDirectory()) {
String files[] = copyfile.list();
// get dir name
String old_f = old.substring(old.lastIndexOf("/"), old.length());
int len = files.length;
SmbFile smbdir = new SmbFile(newDir + old_f.substring(1));
// create new directory
if (!smbdir.exists()) {
smbdir.mkdirs();
//return -1;
}
for (int i = 0; i <= len; i++) {
copySdToSmb(old + "/" + files[i], smbdir + "/");
}
} else if (!temp_dir.canWrite()) {
return -1;
}
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (Exception e) {
}
return 0;
}

JSON File returning null values after few entries

My JSON File is returning only the first four values stored in it and rest it returns as null.
Here is my JSON File writing code
JSONArray data = new JSONArray();
JSONObject object = new JSONObject();
try
{
object.put("Event Name: ", Event);
object.put("College Name: ", College);
object.put("Category: ", Category);
object.put("Sub-Category: ", Sub);
object.put("Date From: ", Dfrom);
object.put("Date to :", Dto);
object.put("City: ", City);
object.put("State: ", State);
object.put("Venue: ", Venue);
object.put("Website: ", URL);
object.put("Registration Form Link: ", Form);
object.put("Contact Number: ", Number);
object.put("E-mail Id: ", Email);
data.put(object);
String text = data.toString();
FileOutputStream fos = openFileOutput("event.json", MODE_PRIVATE);
OutputStreamWriter writer = new OutputStreamWriter(fos);
writer.write(text);
writer.flush();
writer.close();
Toast.makeText(getApplicationContext(), "Event Successfully Submitted", Toast.LENGTH_SHORT)
.show();
}
Where Dfrom and Dto are dates chosen by DatePicker.
and this is my JSON File read coding
public void readForm()
{
String path = getFilesDir().getAbsolutePath() +"\n"+ "/event.json";
File f = new File(path);
f.setReadable(true, false);
try
{
FileInputStream fis = openFileInput("event.json");
BufferedInputStream bis = new BufferedInputStream(fis);
StringBuffer b = new StringBuffer();
while (bis.available()!=0)
{
char c = (char) bis.read();
b.append(c);
}
bis.close();
fis.close();
JSONArray data = new JSONArray(b.toString());
event1 = data.getJSONObject(0).getString("Event Name: ");
college1 = data.getJSONObject(0).getString("College Name: ");
category1 = data.getJSONObject(0).getString("Category: ");
sub1 = data.getJSONObject(0).getString("Sub-Category: ");
dfrom1 = data.getJSONObject(0).getString("Date From:");
dto1 = data.getJSONObject(0).getString("Date To: ");
city1 = data.getJSONObject(0).getString("City: ");
state1 = data.getJSONObject(0).getString("State: ");
venue1 = data.getJSONObject(0).getString("Venue: ");
url1 = data.getJSONObject(0).getString("Website: ");
form1 = data.getJSONObject(0).getString("Registration Form Link: ");
number1 = data.getJSONObject(0).getString("Contact Number: ");
email1 = data.getJSONObject(0).getString("E-mail Id: ");
}
after this i am passing these values to TextViews and only first four return values and rest are null.
DatePicker coding
DatePickerDialog.OnDateSetListener from_dateListener = new DatePickerDialog.OnDateSetListener() {
// when dialog box is closed, below method will be called.
public void onDateSet(DatePicker view, int selectedYear,
int selectedMonth, int selectedDay) {
year = selectedYear;
month = selectedMonth;
day = selectedDay;
// set selected date into textview
abcd = (new StringBuilder().append(day)
.append("-").append(month + 1).append("-").append(year)
.append(" ")).toString();
from.setText(abcd);
Dfrom = abcd;
// set selected date into datepicker also
}
};
and even if i try to show values from Dfrom to email all are returned null
Please Help
I think issue is with key value miss match
for example
You are setting
object.put("Date From: ", Dfrom);
object.put("Date to :", Dto);
And trying to get
dfrom1 = data.getJSONObject(0).getString("Date From:");
dto1 = data.getJSONObject(0).getString("Date To: ");
Do difference beetween "Date From: " and "Date From:" is space after ":"
so please cross check for all.
There may be some issue with your key because key is not matching in json :
Try below code :
public static final String KEY_EVENT = "event";
public static final String KEY_COLLEGE = "college";
public static final String KEY_CATEGORY = "category";
public static final String KEY_SUB_CATEGORY = "sub-category";
public static final String KEY_DATE_TO = "dateto";
public static final String KEY_DATE_FROM = "datefrom";
public static final String KEY_CITY = "city";
public static final String KEY_STATE = "state";
public static final String KEY_VENUE = "venue";
public static final String KEY_WEBSITE = "website";
public static final String KEY_LINK_REGISTRATION = "registration";
public static final String KEY_CONTACT = "contact";
public static final String KEY_EMAIL = "email";
public void writeFile() {
JSONArray data = new JSONArray();
JSONObject object = new JSONObject();
try {
object.put(KEY_EVENT, "name");
object.put(KEY_COLLEGE, "college");
object.put(KEY_CATEGORY, "category");
object.put(KEY_SUB_CATEGORY, "sub");
object.put(KEY_DATE_FROM, "dfrom");
object.put(KEY_DATE_TO, "dto");
object.put(KEY_CITY, "city");
object.put(KEY_STATE, "state");
object.put(KEY_VENUE, "venue");
object.put(KEY_WEBSITE, "url");
object.put(KEY_LINK_REGISTRATION, "form");
object.put(KEY_CONTACT, "number");
object.put(KEY_EMAIL, "email");
data.put(object);
String text = data.toString();
FileOutputStream fos = openFileOutput("event.json", MODE_PRIVATE);
OutputStreamWriter writer = new OutputStreamWriter(fos);
writer.write(text);
writer.flush();
writer.close();
Toast.makeText(getApplicationContext(), "Event Successfully Submitted", Toast.LENGTH_SHORT)
.show();
} catch (Exception e) {
e.printStackTrace();
}
}
public void readFile() {
String path = getFilesDir().getAbsolutePath() + "\n" + "/event.json";
File f = new File(path);
f.setReadable(true, false);
try {
FileInputStream fis = openFileInput("event.json");
BufferedInputStream bis = new BufferedInputStream(fis);
StringBuffer b = new StringBuffer();
while (bis.available() != 0) {
char c = (char) bis.read();
b.append(c);
}
bis.close();
fis.close();
JSONArray data = new JSONArray(b.toString());
String event1 = data.getJSONObject(0).getString(KEY_EVENT);
String college1 = data.getJSONObject(0).getString(KEY_COLLEGE);
String category1 = data.getJSONObject(0).getString(KEY_CATEGORY);
String sub1 = data.getJSONObject(0).getString(KEY_SUB_CATEGORY);
String dfrom1 = data.getJSONObject(0).getString(KEY_DATE_FROM);
String dto1 = data.getJSONObject(0).getString(KEY_DATE_TO);
String city1 = data.getJSONObject(0).getString(KEY_CITY);
String state1 = data.getJSONObject(0).getString(KEY_STATE);
String venue1 = data.getJSONObject(0).getString(KEY_VENUE);
String url1 = data.getJSONObject(0).getString(KEY_WEBSITE);
String form1 = data.getJSONObject(0).getString(KEY_LINK_REGISTRATION);
String number1 = data.getJSONObject(0).getString(KEY_CONTACT);
String email1 = data.getJSONObject(0).getString(KEY_EMAIL);
} catch (Exception e) {
e.printStackTrace();
}
}
Thanks>!!

Categories

Resources