Actually I am developing one application in that when application run
first time it will create one txt file and save IMSI number in that
file. when mobile boot it will matches it's current IMSI number with
IMSI number present in the txt file.But I don't know how to check programatically that
file is exist or not.
Please help me
Life is easy because we write the source code.....
You need to read up on Java File IO; creating and writing to files on Android is similar to what we do in Java (save for some extra settings like permissions).
java.io.File class is an abstraction for a file or directory on a System. And you can use its interface to do lots of stuff including questioning existence of a File. For details of what interface the class provides, you need to read the documentation.
For instance, if you want to check if a file named "temp.txt" exists on my sdcard, create a File object representing this file and call exists() method.
I am developing one application that will create one txt file when it runs first time and saves IMSI number in that file , After that when phone boots every time it checks that IMSI number with IMSI number which is stored at txt file. But when I run this program it gives me Null pointer Exception. I have following code.
when I had checked whether the file is created or not in data/data/com/micro/files/ The file is not present.
Because file is not created therefore it throws run time exception (NullPointerException) , Please help me
subject: How to find out programatically that file is already exist or not?