Question

How can we access the secure element in Android phone. Basically I need to store some secure data and retrieve it, I want only my application to access this data. please let me knwo the steps to do it.

Was it helpful?

Solution

While Android does support a secure element and has some code internally pertaining to it, there is currently no corresponding Java API (see available NFC APIs). There is, however, an effort known as SEEK to create an open source stack for communication with the SE (see the GitHub project), however this is not an official implementation from Google. Last I heard it seemed like Google was leaning toward not providing such an API.

OTHER TIPS

Store the data in sqlite database in android.

This will be stored in application sandbox so that other applications can not access them unless you give Public URI through Content Provider to access them.

If you are having very few elements to store.. then you can try using shared preferences... they are very easy to create,retrieve and modify the values from within your application.. and to make them private for your application..use

getSharedPreferences(yourfile, MODE_PRIVATE);
this make the file" your file" private for the application which created it..

now if you have large number of values.. then sqlite database is better..

Every application by default during the installation is assigned with a unique Linux user Id (UID). Moreover, during the installation a so-called home folder is created for each application (you can imagine it as a user's home folder for an ordinary Linux). As in Linux only the owner of the folder can access home folder by default (we do not consider root user) in the same way in Android only application with a particular UID can access home folder. So your application can store data in their home folder and Linux kernel will take care of no other applications have access to this home folder of the application.

So as it was proposed you can store your data in a sqlite database or in a sharedpreferences file, that are by default are stored in the home folder of the application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top