How to attach a picture from android gallery into my note app? - android

I'm developing a simple note app, some kind of diary but I need a function where I click on the "attach" button so I could attach files from internal and external memory from the phone, the files would be pictures and maybe, if possible, video and wav files, all of them together with the text file on the note app, and I would need to save all this in a database, so I would like to know if that is possible and how do I do it , I read about sharing files from apps to apps on android developer site but I got confused, so I would like someone to help if possible, btw sorry for my bad English I'm not a native English speaker and it's my first time asking here, so I would be glad of somebody could help with this.

Hi Leonardo Medina Lango,
You do not need to save whole file in your app's folder. Save only file path to your sqlite database. If you that files in your cloud than sync sqlite database with your cloud server from background service.

Related

How to save a file in such a way that only my app can open that file?

I am working in a project in which I have to save files like html or epub. I don't want users to copy it from their storage and run it with a different app. So I want to save it in such a way that It can only be readable with my app. Or any other way through which I can prevent the users from opening it(both rooted &non rooted devices)
Thanks in advance

How do i stream files from a website to my app?

I feel like 'stream' isn't the right word for it but how do i, let's say on my website i have jpg/mp3 files and i want to get these said files and make them appear in my android app.
Okay so... 1.) I set up a site then upload files there.
2.) then somehow retrieve files from said site to my android app.
3.) Play mp3's hence 'stream' do i put these files(jpg/png/mp3/mp4) on a sql database? then access it from the application? that's only method i could think of but i would like to know if there's another way to do it.
Oh and a the site i mentioned is where i just upload these files, so i plan to put a search bar on my app then if someone searches "soccerball.jpg" for example then it'll grab the file from the site then make it appear on the app.

how can i keep a folder in my mobile storage and a folder in my dropbox space in Sync?

i have developed a android app for farmers. it is a informative app for indian farmer.The users will be sending me the images and video files to me through my app. here i used (integrated) dropbox to receive those files directly to my dropbox space. whatever the image or video taken by the user, it will be stored on a folder in my mobile storage. Here what i want is, i want the folder in my mobile storage to be in sync with the folder in my dropbox.
How can i do this?
there is a app in market called Foldersync which exactly fulfil my requirement. how they are doing it? How can i keep a folder in my mobile storage and a folder in my dropbox to be in Sync?
Note :
i have gone through drop-box api and created a simple app to send files directly to my dropbox space and i know how to download a entire folder from dropbox.
But here my question is unique from that... pls don't answer the above points which i already know..
Please help!
Thank You
You can use the Dropbox API to keep a local client in sync with Dropbox. There are two main pieces to this:
1) Metadata:
Assuming you're using the Core API, the best way to get information about all of the file and folders in an account (or optionally under a specific path) is to use /delta:
https://www.dropbox.com/developers/core/docs#delta
With this, you can get information about everything your app can see, and then easily stay up to date with changes. There are some useful blog posts on using /delta here:
https://blogs.dropbox.com/developers/2013/12/efficiently-enumerating-dropbox-with-delta/
https://blogs.dropbox.com/developers/2013/12/filtering-dropbox-delta-results-by-path/
2) File content:
Using the metadata retrieved from #1, you can download any files you need access to locally using /files (GET):
https://www.dropbox.com/developers/core/docs#files-GET
You can upload locally changed files using /files_put:
https://www.dropbox.com/developers/core/docs#files_put
Or, for larger files, use chunked uploading:
https://www.dropbox.com/developers/core/docs#chunked-upload
https://www.dropbox.com/developers/core/docs#commit-chunked-upload
The main work here will involve programming the logic in your app to correctly receive changes from the server as well as upload local changes, in order to keep everything in sync.
Also, be aware that on mobile devices, bandwidth can be limited and/or expensive, so be careful to not accidentally automatically download a lot of data the user doesn't want or need.

how to use android_asset

I try to make Webview from to display application/x-shockwave-flash embed element in my app, but i have blank gray screen on emulator and white on device. There are many topics about this problem but any1 really solved.
I explore log of simillar app and see: file//android_asset/index.html. So question... this static file or i can get it from web or modify it.
I trying get my data video.loadDataWithBaseURL() from web, but can i have that data from local storage?
Maybe I said something wron but it's look for me like 'convert web data to local'?? Can some one help my in my problem or explain in this question.
Thank you.
file://android_asset/ is a way that allows android apps access assets by a network-based URI. But assets represent neither local nor online files, they are packed into your apk. Put any files in assets folder in a android project and they will be packed into the apk file by the builder.

Creating an array list of names on SD Card Android

I am in the process of developing an android app, and I need a way for the user to enter a Name and then save this name to a .txt file in the SD card. When the user adds another name, this file should be modified to include that name. I was thinking of an array list, but I've been trying for some time on things to use but I'm not sure how. (I don't think an object output stream would work(?)). Also, I need the user to be able to read and access this file within the app.
Thanks in advance for the help.
Is there a certain reason why you are using a .txt file? I would suggest you use a SQLite database for this particular project.
EDIT: Here is the one of the best articles you can find on building SQLite in android.
Building a Database For Android

Categories

Resources