Padmani
- Forum posts: 3
Nov 28, 2018, 7:40:26 AM via Website
Nov 28, 2018 7:40:26 AM via Website
Hi,
I am trying to develop an android app using android studio 3.2.1. and running in emulator.
I am trying to access an excel workbook as database which is in my local system.I imported the required poi jars in LIBS folder. File not found exception is thrown.
Help me to resolve this problem.
code:
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
try {
FileInputStream inp = new FileInputStream(new File("C:\\Users\dosh\\Building.xlsx"));
XSSFWorkbook wb = new XSSFWorkbook(inp);
XSSFSheet sheet = wb.getSheetAt(0);
Row row = sheet.getRow(3);
Cell cell = row.getCell(2);
cell.setCellValue(200);
Log.d("FILE","found the excel file");
println("File not found");
}
catch(Exception e) {
Log.d("NO FILE","Unable to find the excel file");
}
}
}
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.