Compile code with reference to Android without the SDK - android

We are building a game for Android that uses a server to allow people to play online. The server shares the same project than the application because it works by serializing classes to exchange messages between the clients and the server. So we have so classes that are both used by the server AND the android application. Of course, the server does not use Android code so that it can be run on a Desktop computer. For now, everything works fine on our PCs.
The problem is that we have almost finished the game and the server and we want to install the latter on a dedicated server. We just realized that it was not possible to compile it on the server (it is a strong requirement that we cannot bypass, we have to provide the source code that will be compiled on the server) because the Android SDK is not installed on the server and Java encounters errors while compiling the shared classes that contains Android code (not used by the server, once again). So we are in a difficult situation as we cannot require to install the Android SDK on the server just to be able to compile the program... Especially because the server never runs Android code so once compiled, the SDK should not be required anymore.
We are aware that it is a design flaw, but we cannot just delete the server and restart a new one with a better architecture right now, we are stuck... Additionally, the shared classes cannot easily be refactored as the whole architecture of the project is based on the fact that the server can serialize them and the client just has to call a method in them that runs Android-specific code.
What is your opinion about the possible solutions?
Thanks!

In Android SDK you can find a file called android.jar. For example for API level 22 its location is $ANDROID_HOME/platforms/android-22/android.jar. This file contains all the public classes and method stubs, so you can use it for compilation as a runtime dependency.

Related

Are there any up to date graph databases for android?

Computer science student trying to get my feet wet with android development. I am trying to build an app where I am pretty sure a graph database is going to be required (its an app the creates relationships between user created objects, think of a unidirectional mind map).
I have found a few graph databases ported for android.
Neo4j for Android
Titan for Android
Sparksee Mobile
My issue with the first two is that I am not sure if they are even up to date. The last commits are from 2013. I attempted to build the sample project for neo4j for android but got stuck where it required me to use android sdk version 14 (My current sdk manager api 23 doesn't include the option to download api 14). Now I am not sure if I should continue trying to get it to run because I have no idea if it will even work on my app 23 projects.
Sparksee mobile looks like it might work but the licensing is making it really complicated for something I have 0 plans on ever monetizing.
I'm surprised a graph database for android is so hard to find. When I recently learned what a graph database was I can see it being immensely helpful in a ton of applications, yet I feel like I am searching for some obscure thing. I simply can't imagine how any kind of social network or navigation app is built without some kind of graph database. Perhaps I am misled and am just barking up the wrong tree. Any advice?
The Neo4j for Android project that you reference is a port of a very outdated version of Neo4j (and as you mention is built against an outdated version of Android).
Instead of running the database on the Android device, you should consider running the database on a server and using the database's API to interact with it. Sparksee Mobile is the only graph database that I'm aware of that targets running on mobile devices.
For Neo4j, services such as GrapheneDB provide free or very low cost hosted Neo4j instances that you can use for development and testing.
Another option is to go with a hosted graph db. IBM Graph provides a REST API that you can call from any platform and it's basically TP 3.x and Titan 1.x. Here's a link to where you can create an instance https://console.ng.bluemix.net/catalog/services/graph-data-store/

Making android app work with a python web server

I have a small android application made in eclipse.
Now i need to build a web server with python so they could work together.
Should i make a new python projekt then in some way link it to my application?
Or
Should i use jython and rebuild the app in a jython project?
I have used Visual studio before, and eclipse is not my hometown, så i would really appreciate clear answers.
You don't seem to have a clue about how the android app and the web app are supposed to work together...
You can (theoretically) use just any language and techno you find appropriate for the web app since the communication between the android app and the web app will be http requests / responses.
Also, you can use whatever code editor you want to write Python code, as long as it (the code editor) supports Python.
You can use Kivy to write Python apps that work on Android (as well as just about any other system). Python, they say, has a built in module that you can easily make a web server with. I'm about to try it, I believe.
See
* kivy.org
* http://m.linuxjournal.com/content/tech-tip-really-simple-http-server-python

Connecting to a MongoDB with Android in Eclipse

I am currently developing an Android application, which is going to use a database from MongoLab. Another member of my team has already created a working database on mongolab.com, I am just having trouble connecting to it via Eclipse.
I have looked all around Google and at countless tutorials, but I really don't know much about what I'm doing.
The best tutorial I have found is from mkyong.com. It seems the second section labeled Java MongoDB Examples is what I am looking for, but I cannot get the library being used in those examples imported into my projects.
Is there a URL I can search for in Help >> Install New Software in Eclipse? I have downloaded the mongo-java-driver, but do not know how to incorporate that into my Eclipse.
To clarify again, I have no need to create a MongoDB, I am just trying to connect to an existing database via an Android project in Eclipse.
You must add the driver jar to your CLASSPATH, please refer to this FAQ.
If you have done this correctly Eclipse should be able to provide import for the the Mongo class if you type something like:
Mongo mongo = new Mongo("localhost", 27017);
I think you need to use the rest API provided by the Mongo Lab , not the java API. Send Http call to the server and get the response and parse it using JSON Parsor, that should do it.
Java Mongo driver 2.6 is compatible with Android.
The actual version 3.0.3 isn't compatible with Android because javax.security.sasl.* isn't implemented on Android.
I'm working on a forked version of 3.0.3 adding javax.security.sasl classes of this project https://github.com/koterpillar/android-sasl

Convert Android app to Blackberry smartphones and tablets

The android app reads from database but doesnt write anything to DB,
the app display a few web pages, and other simple things like list of search results...
Please note that I managed to convert the .apk file to .bar without any problems using BlackBerry automated tools, so, the code is compatible with Blackberry SDK. However, I to need create all necessary deployment files, .cod, .jad, .bar, etc,
how can I do that?
is it true that I need to re-write it?
I have imported the android project to Blackberry project and everything seems fine except class R it seems there is no class R in blackberry, what should I do to it?
To see the app on Android market https://play.google.com/store/apps/details?id=com.hazcheck.dgl
to see the app on iTunes http://itunes.apple.com/us/app/hazcheck-dgl-lite/id518643993
Thanks for your continuous help
It's possible to have domain model and other parts same for Android, BlackBerry and J2ME. But be aware that it should be compatible with java 1.3 so you could miss you sugar like new classes, reflection, annotations, etc. This also requires additional effort on design and support level. And the last point the UI and other platform depended parts should be written from scratch.
I would write BB app from beginning for your case because you're saying it's simple app and Android version is already finished.

Can we use Tomcat Server in android app

I am developing Android Web App using JSP with xml parsing. I developed it in Java using Tomcat Server but I couldn't develop in Android. I am new to the web app development. So can anyone kindly suggest me how to proceed further...
waiting for a response guys...Thank you
It is likely that you don't need tomcat on android. After all tomcat is (apart from everything else) a web server. This means that the phone your app is run within should be serving requests from other clients. I doubt you can make sure your phone IP is fixed, and even if that's the case, phones are not meant to be servers.
What I suspect you have done is - you've implemented some functionality in the context of JSP and servlets, but this functionality can easily be run without jsp/servlets. Remove the servlet-api.jar from your classpath and make your functionality work without these. Then you can easily use it in an android app.
While it should be possible from just the hardware standpoint, it should be nearly impossible to get tomcat running in the dalvik pseudo-java envrionment that android provides. the dalvik vm that Android uses is not a Standard Java VM, hence tomcat can't run on it.
I would suggest to look into the Maemo world, specifically the n800 and n810, which are a bit more hackish but also a lot more closer to linux than android. I've successfully run OSGI based apps on those machines. And they are still mobile devices you can use.
Check this site for some examples: http://wiki.maemo.org/OpenJDK_6.0_0_%28Cambridge_Software_Labs%29_on_N900
Look at i-Jetty. It's a web server that runs on the Android platform.
Why crazy? It is possible to make an ip pseudo-staic and then use a phone or tablet as a server instead of running a big power consumpting desktop 24/7. Of course for very simple purpos3 and probably as an experimental stuff. But not bad idea. I have written few years ago a tool for intarnal lan communication in the company which comprises synced and asanced messaging sastem, files and folders exchange functions, firewall solved access and everything in one jar cca 390 kb without any dependencies...there is also built in a http servlet and it runs on dalvik without problems - I have tested it. So the way is there, Even if the intention is not 100% clear.
You want to run Tomcat inside Android using dalvik? That is crazy. If it is a Web App host it somewhere and use the browser.

Categories

Resources