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
Related
Okay so i have pictures on server. I would like to display them in my app as a part of a ListView row. I've already made that and now I have a question regarding the dimensions of the pictures. Since its a bad idea to save my image at 48dp sizes on server (36x36, 48x48, 72x72, 96x96 ..) and then download specific one for specific DPI device. Is it possible to only save a 96x96 and then set it to an ImageView. ImageView width and width = 48dp, and scaleType= fitCenter. Are there any better ways? please help me
You're right that you need only one image size on a remote server like 96px and then in Android app just fit it to your needs like 48px.
The easiest way to implement it would be using Picasso library.
Of course, there is a Glide, with many extra features, (so it might look at the beginnig a bit complicated for beginners), but for the most of uses Picasso is a enough solution.
You can also try a new library developed by Facebook, called Fresco,if you care also about memory using but I highly recommend you a Picasso.
Here you would find nice tutorial for this library:
https://futurestud.io/blog/picasso-image-resizing-scaling-and-fit
If you would find more information about these three libraries visit this site
Fragmented Podcast - 005 – Image libraries for Android
You can use Glide or Picasso for that. It's very easy to implement.
Here is a guide that explains a little as the two libraries and do what you ask.
Now i am facing a problem with my apps.
I want to make a animated hand on my app that help user in this way how to use it.
I give blew a picture sample. Please help. http://i.stack.imgur.com/IgAMU.png
The image you provided is how Google shows off and demonstrates their new features.
Google has created the "Blue hand overlay" and the other effects you see in the picture.
You will need to create your own image as im sure Google has some sort of copyright on every thing you see.
After you have your own "guiding hand" image you will apply the image to the screen with a transparent background and a "ok" button in order to mimic what you see in the picture.
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
I have no working experience of Java3d what so ever so I needed a quick information
where should I place images that I want to use in my project like the background of the panel
like we have Drawable folder in android.
and also I have seen that the background need the image as ImageComponent2d how to convert that retrieved image to that format
searched for it all around but no good tutorial was available
Any help is appreciated thanks in advace
Put the images on the run-time class path of the application (is the quick answer).
I have done extensive searching but I have found no piece of code that anyone has done showing how to choose an Image from the Android gallery (that's the easy part) and have it uploaded to a default Picasa album (what I need).
Anyone have android java code that can help?
This class seems to do exactly what you need (in particular the run() method): http://code.google.com/p/picasaphotouploader/source/browse/trunk/src/com/android/picasaphotouploader/ImageUploader.java