I wanted to know the best way of taking a list of images which come from an HTTP request, each image then needs to be retrieved.
I would then like to use the images to make an animation behaviour so it looks like the list of images is for example an animated gif. Moving between each image using a configurable time period.
This needs to be done using GWT. I saw that you can create a custom animation by using extends Animation and I also saw AbstractImagePrototype but I'm not sure what to use, also exists AnimationScheduler.
I made a simple example with javascript using setInterval but its not clear in GWT how this should be done.
Thanks for any help.
Related
My goal is it, to make an API-endpoint, where people can provide a String, that will then be added to a randomly selected gif, which will then be returned.
The text will be provided through a link (query param).
Someone recommended me to look at Convert each animated GIF frame to a separate BufferedImage but I'm not completely sure, if the provided solutions would work, for what I want to achieve.
I already did some endpoints, where I create images depending on certain values, which are returned as bytes[] in a getOutputStream().write(), but those are (obviously) only png-images.
Other things to note are, that I store the gifs, which should be edited, locally on the server and that I use sparkjava, to listen for get actions on the endpoints.
Is the recommended answer in the above question a good solution, or is there a better one?
I want to create a graphics or graph like a half moon as follows-
I am new into graphics design in android and even new to android.
Any suggestion will be great.
I have already followed the android's graphics tutorial. Need more pointers to achieve the same.
I've found the link https://code.google.com/p/charts4j/source/browse/tags/v1.2/example/com/googlecode/charts4j/GoogleOMeterExample.java#50
but need some more accuracy.
You can try Guage view. There is already a post on that topic u can find it here
The Git for that porject is here
Just download the project and add it to yours. Then use the guage view in your layout and also define the parameters like setTargetValue(); and whatever else you want
I have successfully implemented it in my project. So feel free to ask me any doubts.
Thanks to evelyne24 (Github) for creating Guage view.
The Guage view looks like this
I'm building a very basic gallery on android, it shows the last image on the camera folder and the user can slide left to see the previous one.
I finished an implementation using a viewpager, and a pagerAdapter using sampleSize to scale images. My problem is that the implementation is nowhere as efficient as the default gallery app, every time you slide an image you have to wait around 200ms for the next one to load. So basically my idea on how to implement it is not working out.
How can I do this efficiently, and if possible with an implementation that allows zooming in and out later on?
This looks promising but I don't know how to implement it with files instead of drawables
http://www.androidviews.net/2012/11/photoview/
EDIT:
I've managed to improve speed a bit using photoview (a hacked viewpager), however it takes too much to convert the filepaths to bitmaps or drawables.
I have tried these two methods suggested by dilix and iDroid Explorer:
// Method A
Drawable d = Drawable.createFromPath(imagePath);
imageView.setImageDrawable(d);
// Method B
Bitmap myBitmap = BitmapFactory.decodeFile(imagePath);
imageView.setImageBitmap(myBitmap);
But both produce error Bitmap too large to be uploaded into a texture. I need to get the image to the imageView as fast as possible and somehow bypass this error and maybe I'll get a decent speed. Right now I'm scaling the images and converting them to a drawable but it's not very efficient.
Check this awesome website : http://www.androidviews.net/
and maybe this is what you want: http://www.androidviews.net/2012/11/photoview/
It has page scroll, zooming and panning as you need
I have used it in my project with some modifications and lazy image loading. It is working exactly as you need.
See the official documentation for a great example that will walk you through using bitmaps with a viewpager efficiently. You should use a cache of the images that have already been loaded, and the images should be loaded outside of the UI thread. You also want to scale the image to the minimum size needed for your display (usually powers of two - note that the image won't always scale to what you ask it to!)
ViewPager also loads images in the background to prepare for the next slide, which is set with the setOffScreenPageLimit method (the default is usually good, I think it's 2.)
https://developer.android.com/training/displaying-bitmaps/index.html
I am not sure whether you got correct solution or not. But if you want to continue with your own implementation with your given link then:
http://www.androidviews.net/2012/11/photoview/ //this link is given in your question
And you can see this SO for how to convert file's path in to the drawable. Now, you get drawable of your specified file and implement on the link you have given.
I think that link will works nice.
Feel free to comments.
1)
This looks promising but I don't know how to implement it with files
instead of drawables http://www.androidviews.net/2012/11/photoview/
You have to store not list of drawables in you adapter, but links to files on your sd card and then load it.
2) But i can imagine that file instead of drawables won't be so efficient because to load from files you have to parse it from sd card.
I think you can save time by loading several images in your memory simultaneously (compressed) and when you swype to your othe image you'll already have the image and memory and while swyping you can start loading other image in memory.
When fling over the gallery you may not load images and load it after almost stopping.
It's the main problem: memory consuming vs performance.
UPDATE
I think better than exploring this by yourself will be exploring existing code of google gallery: https://github.com/CyanogenMod/android_packages_apps_Gallery
As i checked - they store cache (almost as i've said about loading multiple bitmaps) and store only resized images - seems to be efficient.
I want to be able to add a text-messaging balloon every time the user revives data from a HttpGet, I want it so that it looks nearly identical to the default Android text messaging UI. I'm fine with all the code, I just need a way to create the UI and create another text balloon every time data comes back from a HttpGet request.
Thanks ever so much, for the answering this questions and I'm sure there's an easy way to do it, yet I've found no way by using the 'ole Google.
I am doing something similar for my app am doing the following to achieve it:
You will need a 9-Patch-Image (a stretchable PNG, see here) that represents the bubble. You want to make the part stretchable that does not include the corners of the bubble. You can create the bubbles using an image editor of your choice (I'd recommend a vector graphics editor like Inkscape). Then use the 9-Patch editor included in the Android Developer Tools to transform the PNG image into a 9-Patch PNG.
Create a custom layout file for one bubble. Create a textview inside it, and add your bubble as a background resource. (android:background)
Use an arraylist with a custom adapter to inflate and fill your items.
So far, this will give you identical bubbles as background for all messages.
If you want to get fancy, you can create different bubbles for participants, and use the setBackgroundResource method in your Adapter to set the correct background.
Further, if you wish to align them left or right, like in the message app, you will need to add spacers to the left and right of your TextView in the layout file. I used FrameLayouts with a fixed width. Make sure to set their visibility to GONE.
As with swapping the different bubble colors, just set the visibility of the left/right spacer.
I'm trying to do something quite simple, but I'm having a hard time finding good examples on the net to what I want specifically.
I'd like to somehing very similer to what it's here:
Dao
It's a simple game called DAO and I just need to have a background image with 16 squares (4x4) and drag and drop the images (pieces) on each square to the others. I'm developing the interface using swing and I simply want to know a good place to find tutorials for such implementations or a simple suggestion on how to do it.
Thanks in advance
Shameless plug:
have a look at my simple example via my google project
http://code.google.com/p/jchronos/
There is code to drag list item across list boxes. Same should be applicable to JLabel
Look at sources
http://code.google.com/p/jchronos/source/browse/trunk/src/org/jchronos/ui/QuadrantPanel.java
http://code.google.com/p/jchronos/source/browse/trunk/src/org/jchronos/ui/ArrayListTransferHandler.java