I'm building an app similar to Facebook Messenger on Android and I would like to display a GIF as the chat head/bubble. I know the chat head operates as a service and found a way to display GIFs on activities (http://android-er.blogspot.ca/2014/03/play-animated-gif-with.html), but can't get it to work for a service.
Separate, but likely related issue: I'd also like to display GIFs in the popup window (after the chat head is opened).
Android actually can decode and display animated GIFs, using android.graphics.Movie class.
This is not too much documented, but is in SDK Reference. Moreover, it is used in Samples in ApiDemos in BitmapDecode example with some animated flag.
Find here:
https://stackoverflow.com/a/7772170/3626214
Related
I am trying to develop a custom gif keyboard for my company with very little experience. I want to pull gif images from our company server into a simple gif keyboard so that our marketers can text gifs to accounts. So far I have found information on
developing an IME: https://developer.android.com/develop/ui/views/touch-and-input/creating-input-method#java
adding image support:https://developer.android.com/develop/ui/views/touch-and-input/image-keyboard#kotlin
setting up a content provider:https://developer.android.com/guide/topics/providers/create-document-provider
and even sample code for a Commit Content Sample IME
I really am just needing some basic code to generate a gif keyboard like the image in the developer documentation, but am not quite finding the resources necessary to achieve that.
Example of Image Keyboard
I feel like I've got all the pieces but no instructions for how to assemble them. Any guidance would be greatly appreciated.
Specifically, I'm not sure how to code to access my content provider in the Commit Content Sample IME sample code. What code do I use and where does it go?
I have done a lot of research, but couldn't find the answer. Currently I'm using agora.io.
What I mean :
I want to add into my android app voice call, but on the same screen.
It has to be possible write some messages during a call without ending it, like at this screen
Is it even possible to do it with agora.io or should I change the lib to another one?
Agora video sdk can achieve that. You can use RTM sdk for messaging functionality and RTC sdk for video call. To put them in the same screen, you need to put the video ui on top of the messaging ui.
Stuff like this. I'm not sure how to quite do that outside of a screen capture program. Or perhaps they are using an emulator with that function?
GIF
There is an app called screencast pre installed in Android. Use that to record screen actions and then convert it to a gif using an online software
Can I use a HTML page as a Live Wallpaper?
Or is it possible to capture a web page as an image and set it as a wallpaper?
Any help would be greatly appreciated.
I am the author of the mentioned WebLiveWallpaper. It can use both techniques: Showing a web snapshot from snapr, webthumb, ... but normally it is really a WebView which has disadvantages but also some advantages. A web snapshot/thumb image cannot update animated images fast enough. But it avoids the problems a 'hacked' WebView in a live wallpaper has (like missing images, huge memory footprint).
I think what you want is using one of these:
http://www.websnapr.com/
http://webthumb.bluga.net/home
http://snapr.seekxl.de
They all have more and better documentation on their sites than I can put in here. Mostly it is simply a picture from their url with your key and some settings.
There is an app on the market called WebLiveWallpaper that does this. There is an option in it for how often to refresh the view of the web page, which leads me to believe that it is simply taking a snapsnot of the page and presenting it as an image some how. Unfortunately I wouldn't know how to go about setting that up. But I think you're definitely going to want to go the image route.
Edit Here are some links that may help you out:
Open source Java library to produce webpage thumbnails server-side
http://www.acasystems.com/en/web-thumb-activex/
http://www.fileguru.com/apps/convert_html_to_image_in_java
I have not used any of these components before so I'm not positive about them but they seem like they can do what your looking for .
I'm working on android application that will have basic image gallery functionality included. I've managed to build activity that fetches list of photos from my application backend API and render them in android gridview within activity layout.
This is how it looks like at the moment:
However I'm having difficulties to build same gallery experience for user's device photos that were taken by camera and stored on device. Two solutions I considered were:
Building my own image gallery.
Starting default android image gallery using intent.
Solution 1: I belive that first solution will take me too much time to developed. I started with this tutorial but as soon I implemented it I found out that it is running too slow. Then I take a look at android camera source code to find solution but again I found that it will take me too much time to review the code and to build my own gallery from scratch. I also believe that it is not in Android OS philosophy to rewrite functionalities that already exists but to use Intents to start activities that can handle actions you need. This lead me to second solution.
Solution 2: I tried calling default android gallery using intent in order to browse user's device photos by soon I was stuck again. Problem this time was that as soon as user tap on photo, gallery exits and returns to activity that originaly started it, and I expected (and I want) to start large image preview instead. I saw that others had this problem too how to open gallery via intent without result.
Because I didn't find the fix for this I decided to quit.
My question is how can I overcome these problems and build gallery that is similar to one I already have for web photos.
If anyone could give me reference I would be most thankful.
this question is pretty old but, as it has a lot of views and quite a lot of upvotes, it could be good to bring an answer to it.
So, first the tutorials evolved a bit and you can find some cool stuff for your #1 option:
This is the one I prefer
This one uses a deprecated UI element but is also cool
This uses an Adapter which is, to me, the best way to proceed.
For your #2 option, I do not see any idea to not to return to the original activity because you still do not have control over the result of the intent you send through the system.
But there are another solution that you didn't mention: there are librairies which are very cool and that you could customise to get exactly what you want:
This one is a bit fancy
This one seems also to be pretty cool but you could have problems importing it because it's not a gradle project
This is the one I would definitely use.