Is this possible with libgdx? - java

I'm trying to develop an Android app for my own project. I was wondering if it is possible to develop such an app using libGDX, and if not, what do I need to learn to code this? (My only experience with Android app development is through libGDX for some simple games).
I would like to make an app that displays a story beautifully. (Think text rpg, but a poem instead or short story). The user will press a button for the story/poem to advance. (Think powerpoint) There will be a simple gradient background. (The gradient needs to be able to fade to different colours) And the text should fade in and out as well.
I'll need tight control over the audio. Ideally there will be a voiceover that syncs to when the text fades in. Some parts will have sound effects, or when the user reaches the end of a paragraph, the current bgm will fade out (regardless of whether or not the song is finished), and when the user press continue to the next paragraph, a new, different bgm will fade in.
I would just like to know if it is possible to make this app through libGDX. If it is, I'll continue to learn from tutorials. Or else I'll learn whatever is necessary to accomplish this.

In a word, yes.
If you have earlier LibGDX experience, it would be fairly easy to do in LibGDX.
The references required for features that you enumerated are
Drawing a gradient in Libgdx
Streaming music
Sound effects
Actions for fade effects
Hope this helps.
Good luck.

Related

How To make Video Background transparent In ExoPlayer Android

I want to remove background color of video in exoplayer or make it transparent i.e if video background color is red then make it transparent and view behind exoplayer must be visible.
Note : I don't want to make changes in Exoplayer background only remove video background which is playing in ExoPlayer
I have made lots of search in google but unfortunate did't got right answer, Please let me know its possible or not and its possible using any other way please direct me.
Thanks in Advance
Exoplayer is not really designed to modify a video file like this while displaying it.
Given that the background may change from frame to frame, I suspect you may find it hard to find any solution that will be able to do this quickly enough on any regular Android device, as there will likely be quite a bit of video processing involved.
If your background is static, like the room behind the speaker in a Zoom or similar conference call, then it may be a bit easier and you could look at OpenCV background substitution techniques:
https://opencv24-python-tutorials.readthedocs.io/en/latest/py_tutorials/py_video/py_bg_subtraction/py_bg_subtraction.html
Most of the examples will be in Python so you will have to explore support in Android OpenCV, which is usually a subset and can be a little tricky to set up (check Q&A on SO for this). Android OpenCV also still uses Eclipse rather than Studio in the documentation at the time of writing, which is something to be aware of.
If you have the luxury of removing the background on the server side before you stream the video to the Android device then things will be easier and you should be able to find up to date example using Python and the OpenCV techniques linked above.
If you use case is a 'Greenscreen' background example, then ffmpeg can also provide you filters to change the background as you wish, including making it transparent. The documentation is here: https://ffmpeg.org/ffmpeg-filters.html#toc-chromakey
It includes an example to change the green screen to transparent in an image (png image in this example):
ffmpeg -i input.png -vf chromakey=green out.png

Globally repurpose play/pause software buttons for all android media apps?

I began creating an app that will run in the background and globally repurposes the play/pause/forward/backward buttons to change the volume which is intended to apply to any media player.
Example: While streaming media in Pandora or Youtube, pressing pause will
lower the volume then activate pause and pressing play will increase the volume then activate play.
I find that onMediaButtonEvent() will give me a similar effect except that this is localized to only within the app it is written in and applies to only physical hardware play/pause/forward/backward buttons.
Also, I can use onClick() which allows me to decide what happens when a play/pause/forward/backward button is pressed but this is limited to within the app.
Can anyone offer any insight on if there is another function, a work around or if this is even possible? Maybe i am looking in the wrong direction and there is something that needs to be modified in the kernel which is out of bounds.

Android game special requirements

I'm making a game for android (inspired by brickbreaker), and am just finishing it up.
Thinking about special android requirements for the game, such as how to handle the various screen sizes, or not needing a back button.
What are other things i should be thinking about?
Have you also considered:
Screen rotation
When the process goes into the background
Checking for memory leaks
Distribution (perhaps in a later stage of development)
Operating system specifics
Good luck with your project!

Seeking help in a basic, bare bones method of creating a 2D OpenGL-ES 2.0 Game

I have made many Android applications that use Java code and the XML layouts, however I am very new to OpenGL ES. I have programmed games in Swing Java, including pong, and an intermediate level 2d platformer (with a map editor, too!). I have extensive knowledge in Java, however, OpenGL is a new doorway I wish to open.
Using guides online, I have made simple things in OpenGL ES, including a cube that I manually mapped the co-ordinates for (which was a very fun experience), and drawing a triangle on the screen.
My question is, how can I make a 2d game with OpenGL ES? Now, what I've tried doesn't quite work well, as the images I draw arent to scale, and no matter what guide I use, the image is always choppy and not the right size on my Nexus S that I am debugging to.
What I need to learn to do is, be able to draw images and objects to the screen with OpenGL ES, and learn how to perform a game loop. I havent looked into a game loop in Android, but will soon. What I want to master first is drawing crisp, HD images to the screen, which just won't work for me.
If you require me to post examples of what I have done in the past, of course I will. But I am hoping you can help me with a fresh start. Thank you.
TL;DR: How to draw crisp, HD, 2D images to the screen using OpenGL ES, and how to have a game loop in Android?
You probably heard of Cocos2d, a 2d gaming framework that works as a wrapper on OpenGL.
It was originally developed for iOS, but it was ported to Android to.
The project page:
https://github.com/ZhouWeikuan/cocos2d/tree/master/cocos2d-android
Great starters guide:
http://dan.clarke.name/2011/04/how-to-make-a-simple-android-game-with-cocos2d/

android - capture of the entire screen programatically

Is it possible to capture the entire screen from Android application code? I'm developing an application like VNC for Android platform.
Regards
I think that depends on what you are trying to capture. I'm sure you can use Moss's method to create a screenshot from your own application - that is, something you render yourself.
As I understand it however, capturing from other views, apps, etc. is designed to be impossible for security reasons. This is to avoid apps being able to take screen shots from other apps, which would make it easy to steal sensitive data.
yes it is. You just need to create a canvas and assign it a Bitmap, then draw to that canvas instead of the canvas you use in your onDraw method and save the bitmap on the SDcard for example.
Just to renind you that this method will work if you handle the drawing, so you should use a custom home screen for it to capture wether you want. (just get the default android home screen :D).
I don't have personal experience with it, but this open source project sounds like it might either solve your problem, or provide you clues as to which API to use:
http://sourceforge.net/projects/ashot/
Screen capturing tool for Android
handsets connected via USB to a
desktop/laptop. It is great for
fullscreen presentations, product
demos, automatic screen recording, or
just a single screenshot. Without
root.

Categories

Resources