Thanks a lot sir. I got stuck how to connect to excel, but by watching this video, I am now able to connect my data in Excel sheet. Thanks a lot man for posting such a great video 🙏🙏
Very interesting tutorail indeed, thanks for sharing. You could also make a part 2 or 3 of this tutorial, by making some more adjustments to the Excel file, like creating a list or a table inside that excel file, or even some functions, that would be awesome. Good work!
Could you design a Hearing Aid System by inverting signals A/D and D/A or using one algorithm. For example: A mic or any audio signal with noise as input, then using algorithm to impalement a clear output signal
Below is another video which shows how to add images in by setting the Rows in anchor: programmerworld.co/android/how-to-insert-put-image-in-an-excel-file-from-your-android-app/ It may help to understand how to add rows dynamically. For reference, complete source code and details shown in this video is also shared in the below link: programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/ Cheers Programmer World programmerworld.co -
Hi Sir, I tried HSSFWorkbook but It only limited to 255 rows and columns, can you please advise how to increase their limit or how to use XSSFWorkbook, When I tried XSSFWorkbook it giving an error. Please suggest
This tutorial shows how the data in each cell of the excel file can be set using the below API: hssfCell.setCellValue() Now, if the input data is in listView and every data has to go into different cells, then one has to just ensure that each cell of the excel is populated with the respective value/ data from the listview items. For reference, details shown in this video is also shared in the below link: programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/ Cheers Programmer World programmerworld.co -
Instead of hardcoding the filepath as in below: private File filePath = new File(Environment.getExternalStorageDirectory() + "/Demo.xls"); take the file name and path input from the user in some edit text and use it to form the path. Below page may help for this: programmerworld.co/android/how-to-access-public-files-from-the-external-directories-such-as-download-or-image-picture-folder-in-your-android-app-android-12-api-31/ Alternately, one can use below concept to browse the file system in Android: programmerworld.co/android/how-to-access-file-system-using-explorer-or-browser-in-your-android-app-complete-source-code/ For reference, the complete source code shown in this video is also shared in the below link: programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/ Cheers Programmer World programmerworld.co -
For multiple rows, add them by creating multiple rows using below line of code: HSSFRow hssfRow = hssfSheet.createRow(0); HSSFCell hssfCell = hssfRow.createCell(0); hssfCell.setCellValue("ID"); HSSFRow hssfRow = hssfSheet.createRow(1); HSSFCell hssfCell = hssfRow.createCell(0); hssfCell.setCellValue("Name"); HSSFRow hssfRow = hssfSheet.createRow(2); HSSFCell hssfCell = hssfRow.createCell(0); hssfCell.setCellValue("Mobile Number"); and so on ... For multiple columns, add them by creating multiple columns using below line of code: HSSFRow hssfRow = hssfSheet.createRow(0); HSSFCell hssfCell = hssfRow.createCell(0); hssfCell.setCellValue("ID"); HSSFCell hssfCell = hssfRow.createCell(1); hssfCell.setCellValue("Name"); HSSFCell hssfCell = hssfRow.createCell(2); hssfCell.setCellValue("Mobile Number"); and so on ... For reference, the complete source code shown in this tutorial is also shared in the below link: programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/ Cheers Programmer World programmerworld.co -
To add more cells just repeat below by increasing the value of x. HSSFCell hssfCell = hssfRow.createCell(x); hssfCell.setCellValue(editTextExcel.getText().toString()); To add rows also, you can keep repeating the below: HSSFRow hssfRow = hssfSheet.createRow(x); My below pages may help: programmerworld.co/android/how-to-create-excel-file-from-listview-data-and-save-it-in-download-directory-from-your-android-app/ programmerworld.co/android/how-to-insert-put-image-in-an-excel-file-from-your-android-app/
but if we add new name in app it stores the name to the first name instead of using another row , and the first name hides ........ is there any solution????
I think if you want to write the contents in multiple lines, then you may have to create new rows and cell in the workbook sheet. So, please keep repeating below code (iteratively) for each new line of the text needed to be written in the excel. HSSFRow hssfRow = hssfSheet.createRow(0); HSSFCell hssfCell = hssfRow.createCell(0); hssfCell.setCellValue(editTextExcel.getText().toString()); Something like below: Row row = sheet1.createRow(0); Row row1 = sheet1.createRow(1); Cell cell = row.createCell(0); Cell cell1 = row1.createCell(0); cell.setCellValue(name.getText().toString()); cell1.setCellValue(phone.getText().toString()); The above is also discussed in the comment section of the below page: programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/ Cheers Programmer World programmerworld.co/ -
Just insert the Array data one by one in the cell using the below command in the FOR loop: hssfCell.setCellValue(editTextExcel.getText().toString()); Source code of this video can be found in the below link: programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/ Cheers Programmer World programmerworld.co -
Great sir may tou plz, give video for excel to sqlite import in android. Plz I have to implement it on my final year project . I tried but did not find any working solution. Thanks.
Can you please check my below video on step counter App and see if it helps: ua-cam.com/video/o-qpVefrfVA/v-deo.html Cheers Programmer World programmerworld.co -
@@ProgrammerWorld I have seen it but it runs on starting the app and resets only when i clear app storage. It doesn't have a start stop button like other fitness apps. Can you please add one?
@@abhishekr.9691 Adding stop button will be pretty simple. In the onClick method of the button, either you close the App (by using finish() API) or stop incrementing the stepCount variable in the code (or you can reset this variable also). I hope the above explanation helps. The complete source code of this tutorial can be found in the below link: programmerworld.co/android/how-to-create-walking-step-counter-app-using-accelerometer-sensor-and-shared-preference-in-android/ Cheers Programmer World programmerworld.co -
What is the error/ exception it is throwing? Did you try with the latest version of the dependency and checked if it works? 'org.apache.poi:poi:5.2.3' For reference, details shown in this video is also shared in the below link: programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/ Cheers Programmer World programmerworld.co -
thank you so much for replying it means a lot to me. sir but my problem isn't fully resolved. please help me out its really urgent. I want that image first clicked by the camera and then inserted in the excel table with other data. Sir Please help me out on this Please its a request from your Subscriber🥺🙏
Thank you So much sir its means a lot to me. You helped alot, if possible then please make a video on this topic to be more precise or clear. Built an app which captures image and take other text data and put a button to create an excel file and insert all the data with the captured image in the excel table. If possible please cover this in your video.🙏🙏
Hello Sir, It is creating a new file everytime I am opening the app. Is there any way to store this file as permanent and data keep on appending everytime I write something in it?? Please help
Something like below can be used to open an existing file and then work on it: FileInputStream fileInputStream = new FileInputStream("Old.xls")) POIFSFileSystem poifsFileSystem = new POIFSFileSystem(fileInputStream); HSSFWorkbook hssfWorkbook = new HSSFWorkbook(pOIFSFileSystem); Hope the above helps. For reference, the complete source code shown in this tutorial is also shared in the below link: programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/ Cheers Programmer World programmerworld.co -
What is the exception error message? On which object the exception is thrown? I assume you have implemented the required library in the gradle file. Cheers Programmer World programmerworld.co -
@@ProgrammerWorld When I implement "implementation 'org.apache.poi:poi:5.2.2'" it wont let me run the application it shows this error: Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
@@orkarp That's because same libraries are being included through other implementation also in your project. That's why it is giving duplicate runnable error. Will recommend remove other dependencies causing this error. Otherwise, just simply start a new project and just include the mentioned dependencies in my video - implementation 'org.apache.poi:poi:3.17' For reference, the complete source code shown in this video is also shared in the below link: programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/ Cheers Programmer World programmerworld.co -
Yes, I think org.apache have created libraries for docx and ppt files also. Just implement the respective library and import it in your Java code. As of now I do not have any tutorial to demonstrate this. Good Luck Programmer World programmerworld.co -
I believe this line has been deprecated: private File filePath = new File(Environment.getExternalStorageDirectory() + "/Demo.xls"); What do you recommend to replace it?
I think using URI concept may help. One of the examples is shown in the below: programmerworld.co/android/how-to-access-public-files-from-the-external-directories-such-as-download-or-image-picture-folder-in-your-android-app-android-12-api-31/ Cheers Programmer World programmerworld.co -
As per the code shown in this video, the excel file gets created at external directory: private File filePath = new File(Environment.getExternalStorageDirectory() + "/Demo.xls"); Please note, for reference the source code shown in this video is also available in the below link: programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/ Cheers Programmer World programmerworld.co/ -
Thanks a lot sir.
I got stuck how to connect to excel, but by watching this video, I am now able to connect my data in Excel sheet. Thanks a lot man for posting such a great video 🙏🙏
Amazing video. It is very short and it goes straight to the point. Thank you so much!
Thanks a lot sir. Was searching for a lot of time still couldn't figure it out so far. Ur vid did the work, helped a lot in my project ✨
How can we save recycler view data into Excel sheet
Plzz help me
Very interesting tutorail indeed, thanks for sharing. You could also make a part 2 or 3 of this tutorial, by making some more adjustments to the Excel file, like creating a list or a table inside that excel file, or even some functions, that would be awesome. Good work!
Thanks Jorge for the suggestion. Yes, will come out with a series on this topic.
Thanks and Cheers
Programmer World
programmerworld.co
-
Jorge Lopes, hey did u find how to do that? I needed help with same..
@@ruknaraksayab2735 I didn't, that's why I asked for that eheh
Great work. Thanks a lot.
Could you design a Hearing Aid System by inverting signals A/D and D/A or using one algorithm. For example: A mic or any audio signal with noise as input, then using algorithm to impalement a clear output signal
Thank you for this vid, but do you have a vid on how to add rows dynimcally?
Below is another video which shows how to add images in by setting the Rows in anchor:
programmerworld.co/android/how-to-insert-put-image-in-an-excel-file-from-your-android-app/
It may help to understand how to add rows dynamically.
For reference, complete source code and details shown in this video is also shared in the below link:
programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/
Cheers
Programmer World
programmerworld.co
-
Hi Sir, I tried HSSFWorkbook but It only limited to 255 rows and columns, can you please advise how to increase their limit or how to use XSSFWorkbook, When I tried XSSFWorkbook it giving an error. Please suggest
This code is applicable for data in list view to excel?
This tutorial shows how the data in each cell of the excel file can be set using the below API: hssfCell.setCellValue()
Now, if the input data is in listView and every data has to go into different cells, then one has to just ensure that each cell of the excel is populated with the respective value/ data from the listview items.
For reference, details shown in this video is also shared in the below link:
programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/
Cheers
Programmer World
programmerworld.co
-
muito obrigado meu camarada!!!!
hello, how to change folder name and file name base in the user's input?
Instead of hardcoding the filepath as in below:
private File filePath = new File(Environment.getExternalStorageDirectory() + "/Demo.xls");
take the file name and path input from the user in some edit text and use it to form the path. Below page may help for this:
programmerworld.co/android/how-to-access-public-files-from-the-external-directories-such-as-download-or-image-picture-folder-in-your-android-app-android-12-api-31/
Alternately, one can use below concept to browse the file system in Android:
programmerworld.co/android/how-to-access-file-system-using-explorer-or-browser-in-your-android-app-complete-source-code/
For reference, the complete source code shown in this video is also shared in the below link:
programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/
Cheers
Programmer World
programmerworld.co
-
@@ProgrammerWorld thank you I will try this
How to add multiple row of data add on single click (ex. set of id,name,mobilenumber)
For multiple rows, add them by creating multiple rows using below line of code:
HSSFRow hssfRow = hssfSheet.createRow(0);
HSSFCell hssfCell = hssfRow.createCell(0);
hssfCell.setCellValue("ID");
HSSFRow hssfRow = hssfSheet.createRow(1);
HSSFCell hssfCell = hssfRow.createCell(0);
hssfCell.setCellValue("Name");
HSSFRow hssfRow = hssfSheet.createRow(2);
HSSFCell hssfCell = hssfRow.createCell(0);
hssfCell.setCellValue("Mobile Number");
and so on ...
For multiple columns, add them by creating multiple columns using below line of code:
HSSFRow hssfRow = hssfSheet.createRow(0);
HSSFCell hssfCell = hssfRow.createCell(0);
hssfCell.setCellValue("ID");
HSSFCell hssfCell = hssfRow.createCell(1);
hssfCell.setCellValue("Name");
HSSFCell hssfCell = hssfRow.createCell(2);
hssfCell.setCellValue("Mobile Number");
and so on ...
For reference, the complete source code shown in this tutorial is also shared in the below link:
programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/
Cheers
Programmer World
programmerworld.co
-
what about more cells ?
To add more cells just repeat below by increasing the value of x.
HSSFCell hssfCell = hssfRow.createCell(x);
hssfCell.setCellValue(editTextExcel.getText().toString());
To add rows also, you can keep repeating the below:
HSSFRow hssfRow = hssfSheet.createRow(x);
My below pages may help:
programmerworld.co/android/how-to-create-excel-file-from-listview-data-and-save-it-in-download-directory-from-your-android-app/
programmerworld.co/android/how-to-insert-put-image-in-an-excel-file-from-your-android-app/
but if we add new name in app it stores the name to the first name instead of using another row , and the first name hides ........ is there any solution????
I think if you want to write the contents in multiple lines, then you may have to create new rows and cell in the workbook sheet. So, please keep repeating below code (iteratively) for each new line of the text needed to be written in the excel.
HSSFRow hssfRow = hssfSheet.createRow(0);
HSSFCell hssfCell = hssfRow.createCell(0);
hssfCell.setCellValue(editTextExcel.getText().toString());
Something like below:
Row row = sheet1.createRow(0);
Row row1 = sheet1.createRow(1);
Cell cell = row.createCell(0);
Cell cell1 = row1.createCell(0);
cell.setCellValue(name.getText().toString());
cell1.setCellValue(phone.getText().toString());
The above is also discussed in the comment section of the below page:
programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/
Cheers
Programmer World
programmerworld.co/
-
Thank uuuuuuuuuuuuuu😭
sir hum array ki value kaise print krwayenge means multipledata
Just insert the Array data one by one in the cell using the below command in the FOR loop:
hssfCell.setCellValue(editTextExcel.getText().toString());
Source code of this video can be found in the below link:
programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/
Cheers
Programmer World
programmerworld.co
-
Thanks sir
Great sir may tou plz, give video for excel to sqlite import in android. Plz I have to implement it on my final year project . I tried but did not find any working solution.
Thanks.
Hello bro, did u find hiw to do that?
I needed help with same
Can you please make a Android app to track steps on START button click and display total distance, avg speed and time after clicking STOP ?
Can you please check my below video on step counter App and see if it helps:
ua-cam.com/video/o-qpVefrfVA/v-deo.html
Cheers
Programmer World
programmerworld.co
-
@@ProgrammerWorld I have seen it but it runs on starting the app and resets only when i clear app storage. It doesn't have a start stop button like other fitness apps. Can you please add one?
@@abhishekr.9691 Adding stop button will be pretty simple. In the onClick method of the button, either you close the App (by using finish() API) or stop incrementing the stepCount variable in the code (or you can reset this variable also).
I hope the above explanation helps.
The complete source code of this tutorial can be found in the below link:
programmerworld.co/android/how-to-create-walking-step-counter-app-using-accelerometer-sensor-and-shared-preference-in-android/
Cheers
Programmer World
programmerworld.co
-
Doesn't work for Android 11, how do I fix please?
What is the error/ exception it is throwing?
Did you try with the latest version of the dependency and checked if it works?
'org.apache.poi:poi:5.2.3'
For reference, details shown in this video is also shared in the below link:
programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/
Cheers
Programmer World
programmerworld.co
-
Can u guide me how to create xlsx file ??
I think the steps will remain same, just keep the file name extension as .xlsx. It should work.
Cheers
Programmer World
programmerworld.co
-
@@ProgrammerWorld nope tried this but unfortunate enough to get what i want...
sir i want to upload an image too but i am unable to do that please solve my problem its very urgent please sir
Please refer below, it should help:
programmerworld.co/android/how-to-insert-put-image-in-an-excel-file-from-your-android-app/
thank you so much for replying it means a lot to me. sir but my problem isn't fully resolved. please help me out its really urgent. I want that image first clicked by the camera and then inserted in the excel table with other data. Sir Please help me out on this Please its a request from your Subscriber🥺🙏
programmerworld.co/android/how-to-create-custom-camera-app-to-take-pictures-in-android-phone/
programmerworld.co/android/how-to-create-a-simple-android-camera-app-or-mirror-app-to-preview-the-images-using-android-studio/
Thank you So much sir its means a lot to me. You helped alot, if possible then please make a video on this topic to be more precise or clear. Built an app which captures image and take other text data and put a button to create an excel file and insert all the data with the captured image in the excel table. If possible please cover this in your video.🙏🙏
sir please help @@ProgrammerWorld
How export image to exe
Please refer below page:
programmerworld.co/android/how-to-insert-put-image-in-an-excel-file-from-your-android-app/
Hello Sir,
It is creating a new file everytime I am opening the app.
Is there any way to store this file as permanent and data keep on appending everytime I write something in it??
Please help
Something like below can be used to open an existing file and then work on it:
FileInputStream fileInputStream = new FileInputStream("Old.xls"))
POIFSFileSystem poifsFileSystem = new POIFSFileSystem(fileInputStream);
HSSFWorkbook hssfWorkbook = new HSSFWorkbook(pOIFSFileSystem);
Hope the above helps.
For reference, the complete source code shown in this tutorial is also shared in the below link:
programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/
Cheers
Programmer World
programmerworld.co
-
Sir my Android project give run time exception....plz help
What is the exception error message? On which object the exception is thrown? I assume you have implemented the required library in the gradle file.
Cheers
Programmer World
programmerworld.co
-
@@ProgrammerWorld When I implement "implementation 'org.apache.poi:poi:5.2.2'"
it wont let me run the application
it shows this error:
Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
@@orkarp That's because same libraries are being included through other implementation also in your project. That's why it is giving duplicate runnable error.
Will recommend remove other dependencies causing this error. Otherwise, just simply start a new project and just include the mentioned dependencies in my video - implementation 'org.apache.poi:poi:3.17'
For reference, the complete source code shown in this video is also shared in the below link:
programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/
Cheers
Programmer World
programmerworld.co
-
It is possible to create a docx file
Yes, I think org.apache have created libraries for docx and ppt files also. Just implement the respective library and import it in your Java code. As of now I do not have any tutorial to demonstrate this.
Good Luck
Programmer World
programmerworld.co
-
I believe this line has been deprecated: private File filePath = new File(Environment.getExternalStorageDirectory() + "/Demo.xls");
What do you recommend to replace it?
I think using URI concept may help. One of the examples is shown in the below:
programmerworld.co/android/how-to-access-public-files-from-the-external-directories-such-as-download-or-image-picture-folder-in-your-android-app-android-12-api-31/
Cheers
Programmer World
programmerworld.co
-
if we are using our android device what will be the location of the spreadsheet
External storage
As per the code shown in this video, the excel file gets created at external directory:
private File filePath = new File(Environment.getExternalStorageDirectory() + "/Demo.xls");
Please note, for reference the source code shown in this video is also available in the below link:
programmerworld.co/android/how-to-create-an-excel-file-from-your-android-app/
Cheers
Programmer World
programmerworld.co/
-