Can I use the Room Persistence Library for Java desktop applications? - java

Is it possible to use the Room Persistence Library from Google's Android Architecture Components in a java desktop application or in other words – as I haven't found anything on that – which things needed to be done and how complicated would that be?

No, you can't. When creating a Room database, you need to supply an android Context, but that does not exist outside of android projects. I would suggest trying an ORM like exposed or ktorm instead

Related

Integrate my android application with existing POS(point of sale) system

Is it possible to integrate a third party app with the already available Point of Sale Systems present in retails/restaurants?
Do they expose their APIs or any such thing where I will be able to integrate my system with them. Any help would be appreciated.
No doubt, we can develop applications for them using Android. But, basically all the restaurants, retails don't use the same Software, that depends on them, which resource they are using. And we can't say whether they are exposing their API to develop the Android application or not. To make android application for those type of applications we need to talk with the application provider or we need to design our own API.

Create Android apps in Eclipse sharing common library

is it possible to create java libraries the apps can use shared?
It is totally clear to me how to create a library project and how to use it while shared between several another projects, compile each project into different apps.
But in this case the library gets compiled into each app separated.
What I want is to create a library, compile it, install it into the device (or emulator) and several apps calling into this library.
And when it is needed to change something the apps use shard in this library, I just re-work the library, re-compile it, replace it on device (or emulator), and the apps use the new library, all apps use the new functions.
Is it possible?
I googled it, but I couldn't find the solution.
I am using Win + Eclipse, I can't use native code (since I know only Java).
Thanks
UPDATE: Thank you for your suggestions, I know about using Services and Activities started explicitly in order to share functionality.
I asked about libraries because I am investigating the possibilites. If there is no way to use common library, what is the purpose of uses-library... in the app manifest?
Thank you
It's more likely that you need a service as a library. Have you considered this possibility? You can create it as a separate application, define an interface for your service and use it in other apps. So as the interface does not change this will not influence on other apps that depends on this service.
The Android model installs each application as a separate user (UID) on the device and the users have no access to other application's/user's files. Therefore, you can't share libraries as such.
As Yury suggested, you might need a service or an activity that can be invoked from multiple applications.

Using an existing GORM data model in standalone Java app

I have an existing Grails app and a separate, existing Java app. I would like the Java app to access the same database schema as the Grails app. Is there a way I can rip out the domain classes and GORM dependencies from the Grails app into a library that the Java app can access?
I'd also be happy to hear alternative approaches that would be less work than rewriting my DAO layer in the Java app.
This isn't supported and may or may not work. See
http://www.grails.org/GORM+-+StandAlone+Gorm
You could always use pure Hibernate from your Java app and create the Hibernate model by reverse engineering your existing Grails database scghema.
Here's another workaround:
http://burtbeckwith.com/blog/?p=72
You could use web services and call into grails service classes from the Java app.

How best to implement a cohesive Model layer for Android MVC apps?

I'm pretty new to Android and Java, though I've really been excited about what I've learned so far. I'm a little uncertain though on how to implement the Model layer.
I come from a background in PHP web applications with Zend Framework and the like. I'm used to having an ORM component, through which the Model maps to a database. I haven't really seen anything like this yet for Android, although it's possible I've just not looked hard enough.
Are there any good tutorials, articles, 3rd party libraries, etc. that specifically address setting up your Model layer for Android apps?
Thanks!
Another option for Android ORM is ORMLite. It uses native Android OS calls to support SQLite on Android and also has JDBC support for other database types.
http://ormlite.com/
Take a look at ActiveAndroid. It's an active record style Android ORM. Here's a sample project: https://www.activeandroid.com/help/sample-project/
There is a lightweight SQLite wrapper 'android-active-record' designed with persistent Models in mind. It allows transparent persisting of Java objects similar to what ActiveRecord do in Ruby or CakePHP. Give it a try http://code.google.com/p/android-active-record/

Android Framework?

Are there any frameworks out there which make it even more easy than it is to build Android applications and would you be interested in one?
Soon there will be!
I am working on DroidFu, an Android shared library which will give you:
tons of utility functions available directly in Activities (and Services), such as spawning list and error dialogs, checking for Intent availability, and other workarounds/replacements for cases where Android lacks desired functionality
easy handling of asynchronous tasks (takes care of resurrecting dialogs after orientation changes)
Easy XML parsing using a convention over configuration based XML pull parser
new adapters and widgets, such as as ListAdapterWithProgress (rendering a loading spinner as the last element when loading something) or a GalleryItem widget which will lazy load an image via a URL while rendering a spinner
an ImageLoader which can load images from the web asynchonously, backed by a FIFO cache, great for rendering avatars in lists and stuff
I plan to make this available on GitHub.
stay tuned.
update (Feb 2013)
Sorry to say that no one is working on this anymore. All people involved in the project have moved on, and since the lib was mostly used in the Qype app, no one feels like maintaining it anymore (Qype got acquired by Yelp btw, so I'm not even sure if we would be allowed to, since most of it was developed during my working hours at Qype.)
For anyone who feels like salvaging it, sources are here.
I just found out about App Dev Wiki. As described on its website:
This wiki is meant to collect links, tools, libraries, and anything
that is useful for mobile development.
Currently listed android frameworks are:
ignition
droid-fu
RoboGuice
Commonsware
ActionBarSherlock
Spring Android
DroidParts
One of the best right now IMHO is Appcelerator
Free and open-sourced, develop one app for all major platforms (cross-platform), compiles the app to native code, has a rich API...
I enjoyed playing with it.. very easy to learn :)
Hope this help!
P.S.: even though it sounds like I work there, I don't... unfortunately for me :(
Not really a 'software framework', but a tool to create simple apps easily (that's what Google says):
http://appinventor.googlelabs.com/about/
I don't use this tool since I'm not a big fan of this approach, but you could give it a try.
You can build many different types of
apps with App Inventor. Often people
begin by building games like MoleMash
or games that let you draw funny
pictures on your friend's faces. You
can even make use of the phone's
sensors to move a ball through a maze
based on tilting the phone.
But app building is not limited to
simple games. You can also build apps
that inform and educate. You can
create a quiz app to help you and your
classmates study for a test. With
Android's text-to-speech capabilities,
you can even have the phone ask the
questions aloud.
To use App Inventor, you do not need
to be a developer. This is because
instead of writing code, you visually
design the way the app looks and use
blocks to specify the app's behavior.
There's also phonegap, which you can use to write android apps using html+javascript.
http://www.motherapp.com/ apparently converts 'HTML' to 'applications'.
There are several frameworks of different scope and purpose to make mobile application development faster, or cross-platform, or code-free.
Technology thrives on competition and new ideas, so please don't take the presence of several other solutions as a deterrent from making your own if you think you can build a rounder wheel.
The Simple framework is fully compatible with Android. Its an annotated approach for XML serialization and data binding, and is fully bi-directional. So you can read or write XML on the Android platform. Whats more is its really lightweight and has no external dependencies. In essence its like a JAXB substitute for the Android platform. For more information check out the Tutorial.
To continue the list :
I am working on the BARACUS framework, which focus is to ease the pain of Android component development.
Current features:
Bean Container with Dependency Injection (type based on Interfaces or Implementations)
pure Java Configuration
Bean lifecycle management
Tiny OR-Mapper solution to have basic ORM w. lazy loading and automatic Row Mapping
Declarative form validation
Database hot backup and recovery
Automated database version management + automated migration
The library is available through maven central repository (including a maven archetype).
Also, a set of tutorials is available on blogstpot
The library is Apache2 licensed, open source (on github) and free usable in any projects (commercial+non-commercial).
I have completed developing an Android Framework for everyone to be able to use easily and quickly. I already developed several applications with that and it is called appFramework and as you can see, you will be using almost every feature and latest libraries in seconds with just extending or implementing the classes i have already created in the library. Setup process is already included, rest of using roadmap is up to you!
Already Created Classes of Features:
Google Map
Recycler View
Retrofit
Firebase Auth
RunTime Permission
CircleImageView
BottomBar
Tag Styled Picker
Right or Left Swipe Actioned Layout (FlingCard)
Material SearchView
AppCompatActivity
Drawer
Tag Activites of Fragments
ConfirmationDialog
Have a nice coding!

Categories