Set every phone can use the module of android application one time - java

My case now is for example select item, when i select that item, the item will become colour and after i uninstall and reinstall back, the item still is that coloured. I want to know is it possible the item selected of android application still can keep with using the method android_id? I mean this method.
private String android_id = Secure.getString(getContext().getContentResolver(),Secure.ANDROID_ID);
Because I plan to do is every android phone can use the function one time only. Hope can understand my question. I am using android studio.

Yes you can, basically you just need external configuration file that will be saved on external folder outside your application folder. For example you can save your configuration file in sd card. Then on your startup application, always check that file

Related

How to save changes made at runtime to an android project

I am developing an android application and my app contains a few ArrayLists which have some predefined elements when the app is first installed.Now my question is, is it possible to save any changes made to those ArrayLists during runtime(adding/removing elements) to the project's source code when the app closes? I want to use this method (if it's plausible) for developing purposes only so don't worry about how other users will behave. Any help is welcome!

copy app database from second app

I have my android app (with source codes, but I am not very experienced android programmer) and I need second small app, which will be able to backup (simply copy) whole database file from first app to folder on device. I think something like "content provider" must be implemented in the first app to allow second app to copy its database (to grant permissions). Could you point me please how to do it (implement content provider) and how to make second app?
It should be just icon and when I click on this icon it will copy database and shows toast "Database backed up.". That's it.
P.S. tutorial is highly appreciated if possible.

How to use file picker in android app

I am developing a simple android app, I want to use file picker when I press button, so how can I implement file picker in my app.
I spent some time earlier figuring this out so to wrap up
Intents provide the ability to hook into third-party app components
for content selection. This works well for media files, but if you
want users to be able to select any file, they must have an existing
"file explorer" app installed. Because many Android devices don't have
stock File Explorers, the developer must often instruct the user to
install one, or build one, themselves. aFileChooser solves this issue.
You can clone it from iPaulPro/aFileChooser.

Browse pictures on Android and move them to specific directory

So I'm building an android application, I want the users to be able to press a button that opens a window/activity. I need the activity to allow the user to browse the pictures saved on the phone and be able to select those that they want. Once they select the pictures and press "ok" the pictures need to be copied to a directory for my application to access them from. So basically does anyone know of any code or help to do this and where would i be able to save user data for my app specifically on the android device. Thanks and let me know if you need any clarification!
It looks like you are expecting someone to complete your task. Instead of giving solution I would like to suggest you a way to do this, there on you can go and search and find a solution which will make you learn lot of things. Here are some articles where you can have some reading to start with.
Searching files on the android system.
Create a view where he can invoke search and select files
Storing files on internal storage
Now you need to do some homework and start hitting the keyboard, I'm sure you can do this easily

Use blackberry camera in java app to select a photo that was already on file

I know you can use
Invoke.invokeApplication(Invoke.APP_TYPE_CAMERA, null);
to get the blackberry camera application to be shown and allow the user to take photos. From which you can use a FileJournalListener to find any created files.
(As shown/implied in this forum post: http://supportforums.blackberry.com/t5/Java-Development/How-to-use-FileJournalListener/td-p/295424)
There are times however, when the user chooses not to take a photo but selects one from the file system. Since this wasn't created at the time I opened it, using the FileJournalListener is not going to meet my needs.
What should I use to get the selected file?
EDIT: The functionality I'm trying to produce I've seen in the Twitter for blackberry application
I think you should create a file picker first,
http://docs.blackberry.com/en/developers/deliverables/11958/Create_a_file_picker_856986_11.jsp
After that in the application, user could select whether to capture new picture or browse from their storage.
If user select the later, open up this file picker and for every images found user can view the image, and the application can save the path where the images located for further processing.

Categories