MongoDB in Android Application [duplicate] - android

I am working on a RSS reader application. And I need to find a backend database. I want the database be embedded because I don't want the users to install a database server.
I know SQLite is a good choice, but I am wondering if there are any other nosql choices?

(I don't yet have 50 rep points to comment on, and build upon, the accepted answer; otherwise I would, sorry!)
You can embed MongoDB in your OEM solution but there are two things to consider:
It is written in C++, so if you are coding in a different language you might need to write a wrapper that launchers the database process separately.
MongoDB is licensed under Gnu AGPL-3.0 which is a copy left server license. The accepted answer, and the Google group quote, both correctly state that this would normally force you to also be AGPL licensed. However, they MongoDb states that the intention of the license is to allow refinements to their code to be submitted back, and that your product will remain separate. This makes me think that the normal copy left rules don't apply.
The goal of the server license is to require that enhancements to MongoDB be released to the community. Traditional GPL often does not achieve this anymore as a huge amount of software runs in the cloud. For example, Google has no obligation to release their improvements to the MySQL kernel – if they do they are being nice.
To make the above practical, we promise that your client application which uses the database is a separate work. To facilitate this, the mongodb.org supported drivers (the part you link with your application) are released under Apache license, which is copyleft free. Note: if you would like a signed letter asserting the above promise please request via email.
Source: http://www.mongodb.org/display/DOCS/Licensing

According to the Google Group, yes it can, but it doesn't cover how exactly.
Yes, but it isn't pretty and will
force your app to be AGPL licensed. If
you are interested take a look at how
the tools handle the --dbpath option.
Source: http://groups.google.com/group/mongodb-user/browse_thread/thread/463956a93d3fb734?pli=1
If you're using .NET, one option might be RavenDB, which is a document database, and can be embedded.

Please checkout https://github.com/Softmotions/ejdb
This project being developed to resolve this issue.

How about Couchbase Lite? It's an open source, embeddable document database. While it can function as a standalone document database, its real value is in its ability to synchronize with remote document databases. It may be aimed at iOS / Android, but it can run on anything with a JVM.
https://github.com/couchbase/couchbase-lite-java

There is no straight forwarding way to use MongoDB as an embedded library in terms of a well-reusable library. Eliot - head of 10gen - spoke of "it would be nice to have one" - but there is nothing available that could be reused in a sane way.

Looks like a lot of OEMs are trying to get Mongo on to their hardware and devices for real-time processing. A link from MongoDBs website

I usually use Buildroot to create a cross-compiled Embedded Linux root file-system along with all the user space packages.
I noticed that MongoDB is one of the packages that's already integrated as one of the Buildroot builtin packages.
You may check out MongoDB make file for some hints regarding how to built it for Embedded Linux.

Related

Custom, self hosted Android Marketplace

I did some research and i can't find a proper custom marketplace solution for Android, i would like to know if someone knows any, with the possibility of being hosted and maintained by us, and fully customizable.
I read about F-Droid but it doesn't seems to be very customizable, as far as i know.
Thank you all.
Well you have a few options. We built our own app store at the last contract I was in. From a file storage it was pretty straight forward. For Android we just supported unknown devices at first, but later switched to integrated MDM(Mobile Device Management) system. I can't remember exactly which one we landed on in the end.
However, for the iOS side we had to build SSL pointers that are nested in a manifest file that points to the IPA. For Android, we just had to sign and place the APK. For Web packages, we hosted an internal NPM server.
For the packages we used Apache Archiva, but that is not the same thing, so just tossing that out there if it matters at all to you.
Lastly, we built an Angular based web interface to handle Authentication and displaying of available apps/versions. Lastly we built an app to put on the app store that others would install that would keep up with our services to know what was installed, needed upgraded, or uninstalled.
However, this took a team of engineers over a year to get done.
So let's talk free options. Just google Android Market Place self hosted alternatives. Last year at the CES I met with Aptoid and they were deploying many self hosted, self managed options that would fit your need very nicely. I don't remember the exact pricing though.
So bottom line is, depends on how fancy you want to get and if you have time to build your own, or if you want to buy/subscribe to one out of the box.
Hope that helps.

Android app fetching Joomla website with DB

My client has Joomla website with plugins (Mosets tree and JSE events) that basically lists business an events. He wants an android app developed to fetch these info. Immidiately what came to mind, is I create php scripts that query the Database and I call those scripts from my app. In my app, I display the information collected.
Another idea that occurred to me, is to enable RSS feed and then I read this RSS feed.
Is my approach above the right approach? Is there a different way or standard way when developing apps that fetch information from the Joomla website backend?
Please note the website is already mobile friendly but the requirement is to create an app for part of the website. Any pointers are helpful
Building one or more PHP scripts that query the db and returns the data is definitely the faster and simpler solution.
If you want to build a more robust / compatible solution, you may extend your set of PHP scripts into a full blown REST API application. In that case take a look frameworks like SLIM or SILEX which are very good at this.
There are more complete and elegant solutions but they are probably overkill for your needs.
Edit: why query directly the database
In theory, it seems to be better to NOT access directly the database, and interact with the Mosets Tree component instead; because in that way you will not have to duplicate any logic.
But in my experience, with a very few exceptions, Joomla components are coded so that it's very hard to interact with them programmatically.
I answered a similar question regarding Joomla RESTful APIs here:
REST API for Joomla 3.0
Basically, I ended up developing a solution which meshes the Slim PHP micro-framework with the Joomla Framework / CMS (requires Joomla 3.4.3+).
Why?
Well, the main reason is that while using the Slim framework would be OK as a one-off solution, I realized that one would still need to develop all the accompanying ACL and access security, not to mention the actual CMS that might store and manage all the important data in the first place.
Basically, I did the work so you don't have to. Yes, it's a commercial component (must pay to download) but I think it's WELL worth it for what you end up getting out of it.
It's brand new, so the service routes in the cAPI ("Constant API") Core package are still limited, but those are being built-out over time (all included in the core package of course). The component/plugin/library package is architected to allow for easy integration of add-on plugins which will introduce new service routes to add functionality like RESTful JSON APIs for MySQL, MSSQL, MongoDB, LDAP, etc. I already use an alpha version of the LDAP add-on in a an enterprise environment, so I expect that to be available for purchase/download soon.
The point of all this is that you can use an existing Joomla site to drive mobile apps (with some development for Mosets), while taking advantage of built-in user management and ACL, along with token auth (via cAPI).
Let me know if you have any questions.

Backend for an Android and iOS app

I am developing a system including an iOS and Android app. I have two approach:
1 - I thought about use MySQL as the backend.
And then use REST in java using jersey to transfer my resources to the apps.
2 - Currently I heard about Parse which is consider as a easy way to add a backend to the mobile applications. It lets the mobile developers write server code without servers.
Which one is your suggestion? please support your answer with proper reasons and your personal experience.
If you want to be trendy, use node.js and MongoDB. (Although MongoDB is not trendy anymore, but it allows binary files of arbitrary length and works beautifully.) PHP with MongoDB works fine too.
My reasons: they are widespread technologies and with a very low barrier of entry. Avoid Java unless you want to nurse your JVM.
Assuming your typical backend for a mobile app which involves one or more REST apis and provides server-side functionality such as user authentication, communication (e.g. chat, messaging), or persistence (e.g. a leaderboard for a game, or retrieving geo-location related data). You basically have the two options you mentioned, build yourself or use a backend-as-a-service platform.
Build yourself (pros):
You retain all of the IP
You have the best level of customization
Build yourself (cons):
Very high learning curve if you lack server-side coding experience
Longer to implement, and harder to iterate quickly if you need to change something or add a feature
Higher risk of critical issues if you lack experience (e.g. security vulnerabilities, reliability etc)
You need to monitor and maintain the system once it's deployed. This can become a full time job if the app gets big enough
Backend-as-a-service platform (pros):
Much faster to get something up and running. This is a big one if you're launching something new and want to validate the market
Benefit from the years of experience of server-side developers who built the platform
Often, platforms will provide ready-made components that already do what you need
Running and operating the backend is included as part of the service, you don't need to worry about it.
It's actually cheaper than implementing it yourself if you consider the time investment, or if you hire a backend developer to build it for you
It allows you to focus your energy and time on the client side app, which is where you'll most likely differentiate yourself anyway
Backend-as-a-service platform (cons):
You have less flexibility, depending on the platform (some are better than others)
There's usually a recurring cost (although you'll also incur some of this if you build it yourself, to run the servers and databases)
There's always a risk that the provider will shut down (like Parse) and you're left scrambling to find an alternative or rebuild it yourself
There are now many backend-as-a-service platforms available to chose from. Unfortunately, Parse is no longer one of them, having been acquired by Facebook and subsequently shut down https://www.computerworld.com/article/3027537/application-development/facebook-is-closing-down-its-parse-developer-platform.html
I feel that a backend-as-a-service platform is a good option if you don't have much experience on the server side, or if you have limited time and want to focus your attention on the client side app. One of the greatest benefits is fast iteration. You can try something out and change it quickly with relatively little investment if you realize that your feature didn't hit the mark. Some examples of backend service providers can be found here https://en.wikipedia.org/wiki/Mobile_backend_as_a_service.
Some of the platforms actually allow you to build a full custom app without actually writing any code, and some of them provide ready-made components (like chat, leaderboards etc) but are less flexible.
Here's a list of Backend-as-a-service providers:
http://pipegears.com (No coding required)
https://www.appcelerator.com/
https://cloudboost.io/
http://api.shephertz.com/
https://backendless.com/
https://quickblox.com/
I participated in the development of an iOS/Android app. We used a server coded in java working as a web service running on Tomcat 7, with a mongoDB database, and JSON parsing for communication. Certainly not the best solution ever, but it was working.

Is CouchDB on Android needed for Users of App?

Im Trying to use CouchDb as a NoSQL database and my main purpose is to create an application on android which use couchDB instead of sqlite! And I want to use this database locally , so with no server connection!
I have seen that you need to buy this on android market to use it! I'm wondering if I'm going to use this should all the users of my application by couchDB first in android market to be able to use my application?
or somehow it will be included? How does this thing work? Is there anyway that I can skip buying it and include this technology in my own application?
And please let me know if there is some other NoSQL that I can use on android!
Thanks for your help in advance.
I don't think you need to purchse it to use it, as it is an open source library covered by the Apache license.
Speaking of NoSQL I've successfully used both NeoDatis and db4o in the Android environment. Both of these libraries are object databases and are surprisingly fast and easy to use. In fact, the claim is that they are faster than ORM/Relation Databases. I think they are a great fit for a low-user (1 user) low bandwidth environment.
Here's an example of db4o in Android:
http://java.dzone.com/articles/using-db4o-android-application
By the way, db4o is open source, but GPL, which makes it a difficult license to integrate into non-GPL products. They also have a pay-license version.
You probably want to look at https://github.com/couchbaselabs/TouchDB-Android
This is an embeddable Java library that wraps SQLite, so it is fast, native, and lightweight.
It syncs with Apache CouchDB so it has the offline mode you want. It also has a REST/JSON api very similar to CouchDB.
Enjoy!

Can I use android for this? (app for corporative use)

(Sorry for my english)
I'm new using Android (in fact, I'm just testing android) and I have a lot of questions...
Well, let me explain you the situation. In this moment, in my job, I am writing my code with C# and run it on Windows Mobile 6, the apps are used to make sales, send bills, reserves, etc. The devices (iPAQ 216) are given to the salesmen, and they must use the apps and update them via internet.
Each salesman have a unique client list, unique data and (in some cases) an unique set of apps, which means that I need to prepare a different package for each salesman. Using a Microsoft tool (cabwiz) I can prepare automaticaly a different package for each one of the 150 salesmen. They download their specific package using a tool wirtten by me, and install it and everyone is very happy (maybe)...
Is that possible in Android? How? and if it is not possible, do you know an idea how to accomplish somewhat like that...?
It's not going to be as easy as cabwiz, I can tell you that. But it would be possible, theoretically, to write a script that modifies/generates the unique portions of the source and then compiles a new copy for each user.
If the only difference between the apps is the data on them, then there is no need to generate a different package for each user: have the app download the data from your server and save it after the app is installed. You could also make some modules (I can only guess what kind of functionality you're talking about with regards to different apps per user) only accessible to particular users.
Yes, it's possible however:
You may want to look into writing in java rather than C# as that's more officially supported on android
There are some limitations of the android APIs, in particular there are basic behaviors of the device that can't be altered - without rooting there's no equivalent to the "hook" functionality of windows.
Make sure you get devices with the menu option to enable installation of applications from 'unknown sources'; otherwise deployment will be a lot more difficult. At that moment, this amounts to avoiding AT&T, as their devices presently confine you to the android market or physical connection to a machine running the developer tools as distribution channels. (As a work around you can upload your apps to the market and not publish them, though that won't fully keep them private unless you also include something to require authorization when they run. You could also install the minimal set of dev tools on the salesmens' laptops)
You will probably want to learn about the command-line application build tools and scripting in order to generate a custom apk for each salesman. Once the devices are set to allow unknown sources, you should be able to email the salesman the apk (or a link to it) as an attachment. You should also be able to make the custom apk refuse to run except on a device matching some fingerprint data you've previously collected. While you can develop for android under windows, you may want to look into switching to linux in order to make some of this scripting a little more natively elegant.

Categories

Resources