Data Access Layer for Android - java

Im currently trying to build my first android app and its a learning curve (I will overcome!) seeing as I have come from a .net C#/vb.net web background (no java background)
I worked through the Notepad example that google provide and now working on my own app which has three tables in the sqlite database.
I'm having to build a method for each insert, delete, edit etc and then more for reading the database.
I was curious to see if their are any nice Dataaccess layers out there that help with this (I've grown a custom to fluent NHibernate and using linq)
It seems a lot of work to be writing all this sql inside the java files!

Related

How to use a SQLite database with LibGDX application [android]

I am developing a game for Android using LibGDX and a key requirement of this project is to be able to store and query data in a database. I need a database for several reasons; one main reason being the need to store user details when they sign up and validate them when they log in. I also need the database to store dateandtime stamps, game stats, e.t.c.
I was thinking of using SQLite to implement this and I have already designed the relational database, however, I cannot find a feasible solution to doing so on LibGDX. I have seen forums and posts mentioning the use of interfacing, however, I have researched and tried doing this method for far too long now and to no avail. I have read this article - https://code.google.com/archive/p/libgdx-users/wikis/SQLite.wiki but it doesn't help at all. I have also seen a few third-party extensions for enabling the use of SQLite databases.
This is the link to one I attempted to use which uses interfacing - https://github.com/Inexsoft/libgdx-database-extension
This is the link to one I attempted to use which gives several project files in order to somehow enable the use of a database with LibGDX - https://github.com/Inexsoft/libgdx-database-extension
I am able to implement an interface for Native Functions on a basic level such as opening a website - also from another post I saw on here (Using SQLite from libGDX on Android). However, I have no idea as to how I can develop that example any further to accommodate the use of a database. Please note that I am willing to explore other options in order to store this data, however, it really needs to be in a relational database form due to the nature of my project requirements. It does not have to use SQLite, if there are better alternatives out there.
Any help will be greatly appreciated as I have no other resort left and the project deadline is fast approaching.

How to create and link image database with java code for android application processing

i am making an android application on CBIR i.e reverse image search for my final year project. I have started with developing an algorithm for the same in java using eclipse which is working properly. But its basing its search upon the images in the folders of computers. However in my case in the end i have to port my java code to android. So how will i make it possible to fetch images from my folder for processing on the android app.By searching on google i got an idea of using Xampp for the same but the php code is working to an extent but not storing the images in the phpmyadmin database. What is the most feasible way to do the same, i am stuck at image database part. Please help with the choice of software and methods for the same.

Accessing Data from Python GAE Datastore using Java

I have set up a Google App Engine website project using Python, with the webapp2 framework. It's neat and seems to be working perfectly. I can run queries in the backend of my website using python.
However, recently I've decided I want to have an Android (and maybe iOS) app as well as a website. The app will almost clone the website. Now, I have no idea how to query this data or access the datastore using Java, since up till now it's all been using the ndb import in Python.
How exactly would I approach this? I doubt that I need to create a new project in Java on GAE?
Has it something to do with Remote API? Looking into that now. And if so, it seems like none is available for Swift language.
Should I consider using a different Database system, and forget about GAE?
I only wish to read the data in Java, not write to the database.
For this you can use Cloud Endpoints. You expose the information you want on an API, and you consume it from iOS or Android. Here there is a tutorial that covers it.

How do I connect my Desktop Java Application to an Existing GAE Datastore?

Currently I have a very basic desktop Java application in Eclipse that is meant to add entities to an existing project's datastore on Google App Engine. I have it all setup right now but since I am new to working with Google App Engine, I have no clue on how to get the application to send the Entities into the datastore of my existing project.
I tried looking this up online but most of what I found was for making java web apps. My goal is to have the application running as its own application, not through a browser.
So, what do I have to do to make the application connect to my GAE datastore? Is there some code I need to type, or perhaps some xml file I need to have within the project? I am just using the Java Eclipse plugin for Google App Engine.
Thanks for the help!
Based on the language of your question, I think you really need a big-picture sort of answer, rather than any specific code. Therefore:
You have a desktop application. This runs on some desktop computer.
You have a Google App Engine application with its data store. This runs in Google's data centers.
These are not the same computer. Therefore, they must communicate over the network in some fashion — that is the missing piece you're looking for.
Since GAE is designed around doing web applications, I recommend you think of this as a “web service” situation — that is, your desktop application makes HTTP requests to your GAE application. (The situation is simplified over the general case because you are writing both the client and the server.)
I recommend you read about designing simple web services and do whatever seems to fit your application.
One important warning: Unless your GAE application only ever has one user, you must not simply write a bridge that gives access to the data store over HTTP, because then anyone can make arbitrary changes to other people's data. As it is said for multiplayer game design: don't trust the client — that is, only accept network requests that make sense according to the rules of your application, and do not expect the client to enforce those rules. This is because anyone can make requests to your GAE application using something other than your desktop application, so you must assume you could receive arbitrary requests. This is the fundamental nature of the Internet.
For example, in the simple case of a multi-user application whose users do not interact with each other using the application, this means that every request that, say, updates a record, should only update a record which belongs to the logged-in user, not one of any other user.
For anyone that gets this problem in the future, I got an answer to it. I just tried experimenting around with the project settings and found it. So as it turns out, after you have installed the GAE Eclipse Plugin, you can just right click your project folder in the Package Explorer, go the Google sub menu, then click on App Engine Settings... .
From there, you need to check the Use Google App Engine checkbox, then in the deployment section, just fill in your project's Application ID. Your project's application ID can be found under the Application Settings tab of your project's online Google app engine dashboard. It is listed there as your Application Identifier.
Turns out that for me, I will need to find a different solution as you cannot integrate GAE with a desktop application that uses the Java Swing library. Bummer :/

Google charts and database - what to learn in java for this?

recently i discovered Google Charts and it will be very good tool for me. I'd like to create web application, so i started learning java and java servlets (JSP), and also start reading about Spring. But.. this variety of frameworks, servlets and all stuff related to creating web app is difficult to understand for me..
My goal is web application with charts with values from my Firebird's database.
I'm programming in Eclipse.
I've noticed that on stackoverflow are few topics about database and google charts, but i'd like that somebody could show me way of achieving my goal, without learning everything about java.
If you are using Google Chart, its just a URL you are generating for your JSP. You don't have to learn anything special, other than how Google charts works. If you are using a database you may need to learn JDBC or a database framework.

Categories

Resources