Send email from game on libGDX engine on Android device? - java

In my debug version of game, I want to take actual information about game progress from many users on my email. As you know, code in libGDX is writing on native Java without Android context. What suggestions do you know for my problem?

See this page on the libgdx wiki: Interfacing with platform specific code.
What you need to do is create an interface with the methods you need. Then create a class implementing that interface in your Android project. (And other projects if needed, if not needed, just create dummy-files that do nothing)
Then instantiate that proper class where you launch your game, and pass in the object to the game and use it there.
Just follow the guide, and then you can use Android stuff in your game (through an interface).

You can try to use ACRA (Application Crash Report for Android). It automaticly sends you crash reports about every error in your application, that is very usefull by itself. And as I see it has method to declare your own varibles which will be send. That may be what you want. Also it's recommended by libgdx.

Related

Creating android 3d game with Android Studio and Unity

I'm trying to create a TBS game with an isometric view for android. I began with Android Studio and I've already designed core parts of the UI including login, registration, authentication, and menus. I'm now trying to create the actual game and I've discovered that in order to make a 3d game, the only reasonably efficient path is to create the game from an engine like Unity3d. Is this true? How can I keep the progress I've already made while doing this? For example, is there a way I can launch and instance of the Unity game and pass the variables needed, while the rest of the app is made using Android Studio? Unity uses C# and I'd prefer Java, is there a way around this? The authentication and user information currently uses Firebase, if I need to rebuild this app in Unity, how can I use Firebase? Thanks for the help.
Check out this: https://www.assetstore.unity3d.com/en/#!/content/58337
That is the firebase API that you can use within Unity,
I do also believe that Unity has some features available for UI so you should be able to build it completely within Unity. Also, you can write the scripts in C#, JavaScript but I don't believe Unity supports Java for scripting out of the box.
Edit
I also just realized, C# is pretty similar to Java, you should really like it.

How to use javaanpr in Android app?

I would like to use this library for Car plate recognition in my Android app.
I red about JNI, but i'm still not able to get some good explained tutorial, how can i use use this library in my Android app.
http://javaanpr.sourceforge.net/
Thanks for any advice.
In it's current state, you will not be able to use JavaANPR on Android. The problem is, that JavaANPR's core functions use the java.awt package quite heavily (for example Photo.java) and Android doesn't support AWT mostly (AWT contains native code, and Android has it's own android.graphics package). There have been some attempts to port AWT to Android, but AFAIK they all failed/died eventually.
Disclaimer: A while ago, I forked JavaANPR in order to make it more library-like. It shouldn't be too hard to port the AWT code in JavaANPR to android.graphics though and you are more than welcome to submit a pull request!

Creating an android app from an Eclipse Java project

I know that questions like this have been asked before, and I have been sifting through them. So here is my situation: I have a decent amount of experience using Java, specifically Eclipse, and I have a game ready that from my current standards, could be uploaded to the Google marketplace.
However, I have the project saved as a Java project. How do I make this project into an android app? I have attempted using the ADT plugin for Ecclipse, and changing the nature of the project file but I am beyond confused regarding how to proceed.
Right now I can click: Run < Run as < Java application.
The goal is to be able to click: Run < Run as < Android application.
I don't know of a streamlined way of doing it. Is your game using Swing as a UI? JavaFX? Is it text?
Regardless, I imagine your game would need to be wrapped in an android activity in some way. e.g. The activity can invoke the browser to run your applet (if your game is an applet).
I'd first create an android project, then copy your source from the java project into the android project. The manifest (R) will be updated with the new resources, etc.
Then you have to finish wiring everything up.
It's going to take more than that. Android has it's own UI system and lifecycle that differs from raw Java. Depending on how you've written the game you may be able to reuse a lot of the drawing and logic code but you going to need to make a lot of changes to the input and allowing multiple screen sizes.
Without seeing your code I can say exactly what you'll need to do but I can tell you it's not going to be as simple as Run As... Android Application.
Although android apps are written in Java code, this doesn't means that it is possible to "translate" a java program or a game in an android app simply clicking a button.
If the game are complex I suggest that you rewrite the game using a framework for develop android game!! You can reuse some logic but sure you have to create all the graphics and readapt the game to run in android devices.
GOOD WORK!!
Be patient and star from here:
Androi Developers
It is not possible. You can implement the application logic in Android in the same way that you used in Java, but you cannot simply convert the java project into Android project. Some packages used in your java project (like swing) can't be used in Android.

Building a music player for both android and Desktop at the same time

I'm going to build a music player working on both Android and Desktops. It won't be anything special, I'm doing it more to training myself and know more or less what problems I might encounter if I want to do a real app/program one day. Therefore, since I'm already rather decent at web technologies, I'll try to use something else: Java.
My app / program with have to
be able to read music files and play them (I'm planning on reading the files myself, meaning that I only need to be able to read "raw" sound, WAV or such)
be able to write to music files (to change tags)
be able to communicate with another instance of the program on another device that's on the same network (I want to be able to use my phone as a remote control and my pc as a remote control for my phone)
If possible, show some play/pause buttons on the screen even if it's locked (probably just on android)
And this is where I need your help: What you I do to write as little "device specific" code as possible?
It's obvious I can reuse classes used to encode/decode some music types. Finding the files, reading them, writing them, playing raw sound and connection to the network will be easy to abstract if needed.
But then there is the UI and it looks like if I don't plan carefully, I'll have to do it twice... I've seen libGDX but they kinda insist a lot on the fact it's for games...
All I need is some way to build a simple UI (a few buttons, the cover of the albums) that'd work for both the desktop and the phone.
Should I use libGDX, the "normal" libs (*WT, Swing, neither of which seem to be "compatible" with Android) or something else?
I'd also like to request as few permissions as possible. Meaning that I'd like to have a base music player that only request access to the sd card, and then features requiring additional permissions would be added as other apps/programs or addons.
From what I understood, the only way to achieve this is to create a second app and make the user install it. I think I'll manage to make the two apps communicate (with Intent?) but is it really the only solution?
Thank you in advance for your answers.
Maybe you could consider building the app with something such as Phonegap: http://phonegap.com/ This would let you use your web technologies strength and write a very slim layer of device specific code if any at all!
As for getting a phonegap app to run on the desktop....you could use something like :http://ripple.incubator.apache.org/ to have it run on the desktop. I know this is slightly different and you wanted to tackle writing something in Java - however this is the way mobile development is moving so you may want to get started like this!

Making a pluggable Android messaging app

I'm making a messaging app and I want to be able to extend it by using plugins.
The plugin might, for example, replace :) with a smiley image.
I've written some test code which uses intent filters to find the plugins, but I can't find a way to create an instance of the that plugin class.
Is it possible to do this, and if not, what would be the best approach/best alternative to this?
Thanks.
Because applications in android each run in their own VM, I don't think the classloader of your application will have access to the classes defined in the plugin. What you can do, however, is to pass the data between your main application and the plugin via Intents. If the plugin needs data from the main application, create a ContentProvider to make the data available.

Categories

Resources