copy app database from second app - java

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.

Related

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

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

Where to store images for android app?

I'm creating a android application for Tourists. In that application user will be able to take photo and send them to storage. Other users will be able to display this photos on their devices. My question what kind of storage I have to choose to only display that photos without downloading them ?
If one person takes the picture and another can view it on another device, it means you will have a server involved. This means you'll need to download a version of the image (even just a low quality version of it as cache) or you cant view it. Check out firebase ->firebase<- quite handy & well documented to do this kinda thing

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

Architecture for Java, Android, Database Application? what should the app look like

I have a site where, via Android, a user needs to:
fill in a document (simple html I think).
the next step would be to sign on the Android.
the data should be saved into a database inside the site.
Points I should mention:
the UI should be as simple as it gets
I am the one who should build the web database
So therefore my idea was :
the application would open an browser where the user will insert all his stuff into the html.
the html will save automatically all the data into a class called data.
the next intent of the application would be the surfaceView (where like a painter the user will sign).
the surfaceView will be saved into png and with data both will be stored in another class which will be inserted into the server.
so in this class would be two files the png one and one contain all the info that was on the html as strings (Jonathan Leffler I hope this one solves my misleading)
the server will take this class and parse it and save it into tables.
Someone has another idea?
In which language should I write it? I thought Java and Android where the database would be MySQL. Does anyone have another idea?
another idea I have is to change this html file into Android sheet
so all the information would be stored on the device and by clicking upload all the information would be sent to the internet site where a server will store it in his database
Can someone point what would be a better solution
note:in my second solution no internet availability is needed so it can work offline where in the first case its needed.
I would like to hear more then on solution on to pick the best who fits my qualities
You will need a webpage optimized for mobile display for Android. That should be PHP and MySQL.
The next thing would be a native Android application written in Java. That will probably use some local data, so it will use mobile SQLite database on the phone.
When the user logs into your website, that is done by the web, and later it will redirect the user to a custom scheme something like signature://capture . The webview will detect this scheme, and will launch your native app.
You will setup your Android application to react to this custom scheme, so it will open up, and will open up the SurfaceView. Then the user will be able to touch the screen, to give his signature.
When you capture the signature, either the set of the points (reccomended) or the generated image (will cause postprocessing issues) you will issue a simple HTTP Post method, that will send/post the data to your server.
So you will end up having in your web environment the captured signature.
Good luck with development.

Categories