android get image from gallery and save another activity - java

I am making an app 'food maker' but the problem first is how to pick an image from the gallery second save this image into external storage like SQLite and shared preferences 3rd this store image and some title how I retrieve this image and title an another activity to open this and see this that set .....

Welcome, Please read How do I ask a good question? and edit your question accordingly.
You are asking multiple questions and i am not sure where your problem is...
i'll try to tackle the problems 1 by 1.
picking an image from gallery can be done by following this solution
saving a file to external storage can be done by following this solution
you can display/load an image from external storage by following this solution
Good luck

Related

Android Studio reading xmls from sdcard

I'm trying learn more about java as much as I can but I don't know if I'm searching wrong questions.
Basically I want to understand how apps can possibly put files on the SDcard that the user can edit and that will directly affect the app.
For example. The SD card folder contains colors.xml, is it possible for the user to edit that file to change say the background of the app? Or is there a better way? Such as an in app text editor that can directly edit the color.xml?
Thank you.
You can use PreferenceActivity or PreferenceFragment (in case you want Fragment):
https://developer.android.com/reference/android/preference/PreferenceActivity.html
https://developer.android.com/reference/android/preference/PreferenceFragment.html
They are default Android UI to modify settings stored in SharedPreferences:
https://developer.android.com/reference/android/content/SharedPreferences.html

Choose a Image from Gallery and send to another Activity

So I have an app and in this app in the first activity you choose a image from the gallery or take a photo with the camera.
Then there are a few Activitys between the Activity I needed the picture. So how can I send this image choosen in the first Activity to the activity i need it in? I thought I can make it like these putExtra() Method but I was reading that I costs a lot of memory to send bitmaps to another Activity.
My Goal is to edit this Image as a bitmap in the last activity!
So who got some solutions how i can fix this Problem?! Any Ideas? Thank you!
I use Library called sandriosCamera, it is very costumizable and works in that it less than android 5.0 too (So use CameraApi and CameraApi2). It includes recent image in gallery picker and too shows a preview of the image doing a matrix (Rotate) when the image has an incorrect orientation.
Read this in android arsenal and look the github for the library code https://android-arsenal.com/details/1/4962
Then I pass with a putExtra() the image path (because of the image is temporal and then I need to getExtra() of the intent to have the path of the image in my SendActivity.
Hope it helps with all your problems.
PD: I recommend to download the master.zip and not to import as a library with gradle, because you can costumize if you want (But then you need to fix problems). Before of import to the gradle or manual I recommend too to update all your android tools, max version, etc.

Downloading most recent Image from server in image view in android app

I am a newbie and as soon as I started learning the language I got one project. Most of it is done but I am strugglig in a basic programming problem. My app is supposed to provide the images of the price lists set by the commissioner in our city by downloadin from thir original website. The problem is after every few days a new image appears as new prices are set and the image's url in my app becomes obsolete. the new image that appears on the website does not have a ur that follow a pattern like image1,2,3 but it is a random number every time. Can someone please help me how can I solve this problem of mine?
PS. I know how to get an image in the imageView. All I want is to make the app smart enough to download the most recently added image every time. Please please respond. Thanks
You could search the image URL from the website using an html parser like Jsoup and then load the image into an imageview using the Picasso or Glide library

Add A Image to the Gallery by Code/Programmatically - Android Eclispe

I need help with a certain part of my project. How do you add A photo of your choice from the SD directory to the Gallery in my app by code/programmatically? I searched on the internet and I find uninformative ways and ways to add multiple images to the gallery when I just want one. Please when explaining it, please explain the information behind the code and the best ways possible so it can make sense. Also please could you show me how to get a photo inside of an directory in the SDcard directory. It's appreciated.
Thank you :)

Image Edit SDK for Android?

I'm working on a project that requires taking pictures and putting stickers on that photo. From what I understand this requires 3 main actions:
1. User should be able to resize the sticker.
2. User should be able to rotate the sticker.
3. And once done, the whole thing should be merged into a single image.
I'm having a really hard time starting this since I simply don't know where I should start. Should I find, or ever write my own code to do the above, or maybe try to use existing projects (but I was not able to find any open-source ones).
I've heard about Aviary, but it was recently purchased by Adobe, and it is now part of the Creative Cloud, which is quite vague regarding the price, if there is any.
Where should I start?
Thanks.
We at Img.ly have released an image editing SDK for Android as part of our PhotoEditorSDK product suite.
Users can resize rotate and adjust stickers out of the box and you can also add your own stickers and assets.
You can find a demo application here. You can use the library for free in your open source projects, but there is a license fee for commercial applications.
For Resizing the image add two buttons one for increasing the image size and the other for decreasing . Then in the set an onClickListener() for that buttons.
Inside that function first get the dimensions of the image using getWidth() and getHeight() , then use setWidth() and setHeight() to change the size.
for Rotating the sticker refer this link
After all these things use a canvas to save the sticker and image as a single file . for doing this refer this link.
In future do not combine all your queries in a single question.
I use these libraries and plugins in my projects
for cropping an image use this : Cropper
for rotating an image you can use this: PhotoProcessing
and at the end you can get the whole image in to a single image-view

Categories