I'm currently developing an application with Appengine and GWT. I have to send a lot of data from an Android phone to the GWT client. My question is, is there a way or an API that I can store or cache this data on the local client?
The data which I'm talking about is just a lot of text from a database from Android. It would be awesome if I could store it somehow that the AppEngine server doesn't have to load the data and send it to the client every time the user connects to my application.
Use GWT's Storage API. The application will still need to go to the server if the local copy of your data is deleted or if the browser doesn't support HTML local storage.
Related
We are planning our final school project and I need to find out a way to send images from server to client (Flutter App). Due to a lack of experience in a professional environment, I'm struggling to do so.
I've always saved the image name or image path in the database in my smaller projects, got the data via an API, and then just called for the image, which was located on a web server, via HTTP or HTTPS. Pretty easy in Flutter with Image.Network.
However, that doesn't sound like the best option
We are planning on using:
Ubuntu or Microsoft Server (still to decide)
MariaDB alone or with MongoDB, or even MS SQL Server(still to decide)
ASP.NET Core for the API
Flutter App and Web-Interface for client-side
Any suggestions are appreciated!
You are doing correctly in your smaller projects. This is a best way to do. When frontend(mobile app or web app) uploads image using an API, backend(in your case ASP.NET Core) simply stores that in server(in your case case Ubuntu or Microsoft Server). But I would say stores all media files like audio, video, images, documents, etc on AWS S3 bucket because it would be difficult to you increase server disk space if its low where AWS-S3 can store any amount of data.
And after saving that media files on S3 or server store its file url in database. Send this url via API to client when it requests it and from client side you just need to use that url to show or download.
I have Amazon S3 as my file storage server and EC2 instances as my application logic server. Now my app needs to upload some files which need necessary processing. I can think of two ways to do this:
Upload the file directly from mobile devices and get the file name and location(url), then send the url to my backend. Backend get the file by URL and do its job.
Send the file to backend using a multipart form, backend accepts the file do its job and finally save the file to Amazon S3.
Which is the standard way? What are the reasons?
Sending the object direct to Amazon S3 will be more scalable, less error-prone and cheaper (since you need less web server capacity to handle the uploads). Send the corresponding information to a Simple Queueing Service (SQS) queue that the back-end service can monitor and process. That way, if your back-end is ever offline, the jobs will simply queue-up and will get processed when the server is running again. A good use of loose coupling.
A third option would be to send the file directly from your mobile to Amazon S3, using Metadata fields to identify originating user, and then configure the S3 bucket to trigger some code in AWS Lambda that can process the file. This could do all the processing, or could simply trigger a process on your web server. Again, this reduces load on the web server and would not require sending a message to trigger the processing.
I looking for ideas how to implement a local backup of Firebase data on an users device for Cordova/PhoneGap apps.
So if an app is shut down, updated etc. the data can be booted from there.
There is one approach using local storage:
https://github.com/yeldarby/offline-firebase
However I prefer not to override Firebase code,
and to save data more persistently. Either written to a file via the Cordova file api, or via the SQLite Database plugin for Cordova/PhoneGap.
What is the best way to listen to changes on the Firebase data via AngularFire?
So I could react on it an save it along with the Firebase object keys etc.
And, Is there even a way to physically save pending local events?
Related:
Firebase offline storage with Phonegap
I am developing an mobile application which can be run on mobile devices (with OS like Android, iOS, WP7...). This application will get data from online database then store them to local database in device and I can do CRUD with data. There are three ideas:
I'll create a webservice to handle with database on host and use some cross-platform framework to building an app then connect to webservice in order to get and put data to server. Issues:
Which technology should I use to create webservice? (RESTful/SOAP...?)
Which type of return data for easy to handle? (XML/JSON...?)
How to sync between local database and database on host?
I'll make an application for loading an external URL and build a website (with all of features that I need to work with database). Issues:
iOS, Android, WP7... accept for loading external URL in applications?
How to sync data like my first idea?
Should I use single page application technology?
I'll make an application using cross-platform framework and it will work with local database. I just handle syncing between local database and host database. Issue: which is the best database and best framework to do this?
Thank you
How to sync between local database and database on host?
For synchronization, you can take a look at the open source project, OpenMobster's Sync service. You can do all types of sync operations
two-way
one-way client
one-way device
bootup.
Besides that, all modifications are automatically tracked and synced with the Cloud. You can have your app offline when network connection is down. It will track any changes and automatically in the background synchronize it with the cloud when the connection returns. Also, when new data is created in the Cloud, it is automatically synchronized with the local database using Push notifications.
Currently only native development is supported on Android and iOS. However, the next release which is 2.2-M8 (end of March) will support end-to-end integration with PhoneGap on Android and 2.2-M9 (end of April) will add iOS.
Support for PhoneGap will give you the flexibility to build the app using web technologies like HTML5, and JavaScript along with Sync for your local data using OpenMobster.
If you want to go pure native, then you still can use the Sync service and synchronize your local database with your remote database.
Let me know if you have more questions about the framework
Here is a link to the open source project: http://openmobster.googlecode.com
Good Luck!!!
Some suggestions:
If you're planning that your mobile application exchanges data with a server, i strongly suggest you to use RESTful Services. The XML overload associated with SOAP services might get your phone and your network into trouble
The return data can be either JSON or XML. For example, in Blackberry applications i prefer XML because the support included in the SDK.
There are three kinds of mobile applications: Web applications (build with HTML/Javascript and accessed throw a Browser), Native applications (installed in the device and coded in Java/Objective-C or another language) and Hybrid applications (installed in the device but coded in HTML/Javascript and can access some features of the OS). Your URL-Loading type sounds like an Hybrid approach (not quite sure about that), so you can use PhoneGap to build that type of applications.
Hybrid and Web applications uses the capabilities of the phone browser to manage HTML/JavaScript. Now the devices come with very powefull WebKIt-based Browsers, so the single page pattern would work with no problem. Although, it's kind of a wear approach to mobile application design.
I don't see the need of a local database in your app, you can simply handle all the data in the server and access it through RESTful Services on the phone.
I am developing an mobile application which can be run on mobile
devices (with OS like Android, iOS, WP7...). This application will get
data from online database then store them to local database in device
and I can do CRUD with data
Nice!!!
Which technology should I use to create webservice? (RESTful/SOAP...?)
I Will go For REST services.
REST has advantages when:
You have a set of resources that you want to manipulate.
You want to support navigation between resources.
You need scalability.
SOAP has advantages when:
You want to publish a web service description (using WSDL).
WSDL 2 can describe RESTful web service as well. WADL is an alternative to WSDL for RESTful web services.
You want to use security etc. that relies on the use of SOAP headers or some similar mechanism in which data is added and removed from a request.
You want better tooling support.
You want tested platform interoperability.
Which type of return data for easy to handle? (XML/JSON...?)
I personally go for XML
Its not a criteria of which is easy to handle.Its about performance in Mobile applications.
JSON is generally smaller than a XML document and there for faster to work with.JSON can be parsed more efficiently because it can be parsed as JavaScript, which the built-in eval() function will do for you.
How to sync between local database and database on host?
Create a service which contains a timer and runs in background.Call the REST service at intervals to get the latest values. But Since this is a polling kind of thing,then it is not efficient and has less performance. Other Approach will be use of PUSH notifications.As soon as there is any change at the server side, send a push notification to the client(mobile) and hence perform the local database operations.
iOS, Android, WP7... accept for loading external URL in applications?
I didn't understand this point.What you want actually?
Should I use single page application technology?
Single page technology is very good.But it will depend on your business.If it is possible then use it.Else create different HTML pages.
I'll make an application using cross-platform framework and it will work with local database. I just handle syncing between local database and host database. Issue: which is the best database and best framework to do this?
Choosing of the database will depend upon choosing of the cross platform mobile framework.Phonegap is exactly what you need. And the database will be sqlite. Phonegap provide API's for storage,so you can easily access the database of the different mobile platform.
I am running unit testing in silverlight.
I have the test data and I need to export it to local disk without user interaction.
I have thinked to export a file but it seems that it requires user interaction.
I thought I could try a local process that listens for silverlight data on a connection, which saves the data automatically, but didnt find if it is possible and how.
Can anyone help me on how to automatically export data from silverlight to local disk?
Checkout the answer on this SO question. It shows how to access the local file system, however it does require user interaction.
I would just add a page to the web app that is hosting the silverlight plugin that allows you to store the data locally. You can the post your data and have your backend (asp.net I suppose) store the data locally. If you already use WCF to comunicate with your backend, you can use that instead.
I have solved with a local server, it provide http web server, policy server and a socket listener.
The server run and:
- listen as http server for silverlight page requests.
- listen on a local port for silverlight test results encoded as xml
- listen on another port as a policy server, because silverlight need it to connect on a socket
Next the server starts internet explorer pointing to his own web server, at unit test page,
When the tests are finished I get the test result data structure in silverlight, open the connection to the local server (validated by the policy server) and send to it the result encoded in a string.
The server have full access to local file system, so it can silently produce output.