Dropbox sync using PhoneGap - javascript

I'm having quite an annoying issue. I'd like to begin developing an iOS app, but I'd rather not learn Object-C due to time. I'm looking at PhoneGap, but have one issue.
If possible, I'd also like to sync the data across multiple devices. I'd rather not use a remote database, as I have no idea what the expected amount of users will be, and therefore no idea how much bandwidth I will need for a MySQL database. Is it possible to save data to txt files, then upload them to Dropbox using JavaScript (and all on PhoneGap)?

Really i think learning the language is a relatively simpler challenge. It's learning the API itself that will take time, and you will have that issue regardless of where you go. If you prefer the javascript syntax, i know there is Titanium Appcelerator. But given the features you want, I think learning objective-c is the way to go, because there are so many resources for using the API. I know of a few apps that use Dropbox as storage. Byword is one of them.
Depending on the app you are building, dropbox with flat files might suit your needs. If you need something more customizable, then you may need to build a remote db server. Though understand that sync is hard.

Related

Is it possible to retrieve data from parse.com using objective-c and show it in website?

I have an iOS app in which I use parse.com as backend service. Now, I hired someone to do a website interface using HTML and CSS. I want to share the same data between iOS app and website, I know parse.com offers me a few ways to do this, including creating a javaScriptapplication. The problem is, my programmer doesn't have any experience in JavaScript, nor do I.
My question is: Is it possible to use what I have (objective-c, xcode) as far as retrieving data from parse.com and showing on website? Even if I need to code something new, is it possible to use objective-c together with HTML and CSS?
Thanks.
Parse has several APIs, one of which is REST. Your web developer should use the REST API to get data from Parse
https://www.parse.com/docs/rest
If there is will there is way, but you'll be making something really specific to your use and will be non standard and will be immediately hard to maintain, I recommend that you hire another developer and do things properly using the technologies given to you by parse !. if the cost will be high now I can promise you it'll be much higher if you went the path you're going to now.
So my answer is:
Yes, everything is possible and no, don't do it ! :)
Edit: Added an example to a possible way to do it to actually answer OP's question.
Example case:
1-Create a simple Mac Application in Xcode that fetches data exactly like you do it on iOS, and store the needed data into a database of your choice on your server
2-You now have access to the data you needed from parse, but on a local mirror. you will need some tool to fetch that data though, I recommend a simple PHP script.
Note that this will require an OSX server to always be running to fetch that data, you'll also need of find a way to fetch data on demand when a user needs it Vs. polling at specified intervals, this will hardly scale and will be costly as I said.

Connect server hosted webapp to local websocket

Has anyone an idea for the following scenario?
I have a RIA-Webapplication (realized in ExtJs). What I want to implement is the possibility to use local ressources like card readers or fingerprint readers or other serial devices and filesystem access.
I thought about implementing this with a local websocket service which has to be installed by our customer before using our RIA the first time. When the webapp is loading it should scan the local machine if a websocket service is available and connect to it.
After that, local events (like new card is beeing read or recognized new finger) should be passed to the browser via websocket connection.
Any ideas how to get started with such a solution?
I have made something like that. Besides the obvious things such as read/write/poll data from the card-readers and so on, you would have to either implement everything yourself or, use a library for technology you are going to employ for your web-server. So, if you use a LAMP solution, i think there are some web-socket libraries for PHP that you can use. However, if you do everything by yourself then you have to implement everything from hand-shaking, to creating data packets. I have done everything from scratch by using .NET and it provides a number of useful libraries such as hashing. Java also would be a good option and have those kind of libraries as well. In general if you doing everything by yourself i would say the trickiest thing would be to split the data you want to transmit among various data packet. It is not that hard to do things from scratch. The RFC (https://www.rfc-editor.org/rfc/rfc6455) helped me a lot. Hopefully, this helps.

Connecting to postgres database from a phonegap app?

I'm trying to build a phonegap app for ios and android. It's been going well so far but now I hit a major obstacle and I need some help.
I need to connect to a remote Postgres database. I haven't done anything like that before.
Does anyone have any experience/tips for this, or know of any resources which contain relevant information?
From client-side javascript, you can't. Unless phonegap has done something very odd with permissions or provided a PostgreSQL interface (which presumably you'd know about if they had).
What you'll want to do is provide a small server-side wrapper to PostgreSQL that will take requests, convert them to queries and return (presumably) json-formatted results. Oh - and you'll need to think about security too - who can connect, what can they do, does it all need to be encrypted?
If your requirements are simple, this can be easy enough to do in Perl/Python/Ruby etc. or even javascript if you have node.js to hand. With Perl you'd wrap DBIx::Class in a Dancer app - similar modules exist for all the above scripting languages.
Do consider whether you want to run the whole thing over https (let apache handle this for you) - it will avoid issues with passwords/private data being sniffed over wireless connections.
For example, your app would issue an ajax request to: http://myserver/projects/123/messages?limit=20&sort=date
That would be translated into a query into the project-messages table for the last 20 messages sorted by date and wrap the results up as an array of JSON objects (presumably).
You would need to create an API for your data. Then access that API using promises from your js app.
To let the security issues where they belong to (in existing experienced and tested parts of server / client software) and to have a minimum effort of development, I suggest to use some existing lightweight middle ware:
http://restsql.org/doc/Overview.html
It comes with a docker, where any service you require is packed in, thus making it easy to try it out quickly.

Dilemma... Which Program & Language to develop my Android and iOS App

I'm developing an app for both the android and ios platform. I'd like to take a route that allows me to only have to code once for both platforms. There are 2 options I've come across:
Develop in Flash builder 4.5 with flex (actionscript, or I've heard javascript also?)
Develop using Phonegap (javascript)
The app is very simple - it will use the google api and the phone's geolocation function, then also display more information about the business listings from google map's api. Downloaders of the app will also have to register to become free members. All of this information will have to be put into a mysql database on my server.
So my question is, which is the best route to take with what I am hoping to accomplish? If using Flash builder, is it best to learn actionscript or javascript? What's the best way to connect with the mysql server if I'm writing in javascript, ajax?
If you are serious about it and want to create other apps as well in the future, you should learn the native frameworks/languages for each of the platforms. If not, and you just want to make one quick app I would choose Phonegap rather than Flex/Flash.
Firstly, get familiar with HTML and Javascript to understand what they are even capable of. There's no point in trying to complete a project with tools that you don't understand. As for the options you named, I'd definitely go with the Phonegap method as it is much simpler.
However, you also need a backend for your solution if you're trying to use a MySQL or other database to store any data. For this you'd need some server-side language like PHP, JSP (or you could use NodeJS, if you want Javscript on the server too) etc, that retrieves information from the database according to the requests received from your app.
In conclusion, I'd suggest you to read more about PHP/MySQL, Javascript and making webpages, since this is what you are actually trying to do if you use Phonegap, even though you might look it as an app. Do some tutorials, get to know the languages before you try to take on something that surpasses your skill level just yet.
For a nice small db-interface I'd rather suggest using ruby (with sinatra as mvc-framework and activerecord on top of mysql, or just use rails) than using php!
http://guides.rubyonrails.org
http://www.sinatrarb.com/

options for building a realtime website

I'm going to build an webbased application which is controlling and monitoring tons of realtime data. think about few thousand valves pipes pumps and sensors.
Please list a technology stack you would use to build a realtime website with an educated guess about performance. The environment is 'ideal' all openstandards are available. so no IE6 etc backward compatibility is needed. Current and future proof technologies please.
server side:
database web-server - which one / combination makes it easy to support real-time pushing of data?
client side:
what kind of client environment (javascript Libraries) support showing and updating tons of realtime data?
You can have a look at Goliath
I recommend you have a look into Socket.IO which works best with Node.JS and might be the best fit for handling many long lasting concurrent real time connections. I would say that the choice of the database depends more on where your real time data is coming from and how it is supposed to get in the database.
Me too. So I'm writing a frame work that can do that. It's based on lighttpd front end, and multiple fcgi backend servers. The original Android was also tested with another framework that is based on it. It's open source so you might want to use it as a starting point.
I haven't been able to write a realtime app, but I've dabbled a bit with http://socket.io/ and node.js, and it's a joy to get started with.
App engine has a js channel api which seems nice. You should take a look to see if hosting on app engine is a option.
If you're dealing with "real time" stuff server-side, I recommend clojure for managing concurrent state.

Categories

Resources