On demand assets loading for WebView rendering - webview

I have a scenario that, when a user connects to the server from the mobile app the scripts used for the Web View needs to be downloaded from the server. Then store it locally and uses this scripts for further Web View rendering.
Only when we upgrade the server the client should update the scripts from the server.
Is this possible to achieve this in Xamarin.Forms? If yes, can you share me your ideas?

There are a number of ways that you could achieve this. One possible way is this:
Create an endpoint on your server that can respond to requests for the latest version number of your scripts.
Query this endpoint from the app using httpclient.
If the version number on the server is greater than the version number on the app, then query the server again to retrieve the scripts required, and store them on the device.

Related

How can background tasks be executed from a library in an ASP.NET MVC 5 app

In my job we are building Web Apps that rely on a common Enterprise class. This class has a method that sends a request to our server every time the app_start or app_end event triggers so we can monitor the status remotely. But we are now requiring that at least once a day the web app reports its status, a bit like telemetry. I don't know how to accomplish this, so far I have found some options, but some have limitations:
Use hangfire. I don't like this since it requires to setup a Database or add more tables and install a new Nuget package on each project, but could be my last option.
Use a Windows Service that reads databases. This could be less work but it can't access the Web App web.config code
Use a Javascript tasks that sends an AJAX request. This requires to have an open web browser and is a big risk.
I'm looking for a server side approach that could allow to set to trigger an event or function at 1am.
I would got with Hangifire.
It is dead easy to setup and very reliable.
You don't need to setup the database, you might want to check memory storage:
https://github.com/perrich/Hangfire.MemoryStorage
Also check:
What is the equivalent to CRON jobs in ASP.NET? - C#
You can use FluentScheduler instead of Hangfire (it is more lightweight).
Instead of a Javascript task that sends an AJAX request you can use a WebJob or an Azure Function.

iOS app database and cloud storage

If I want to setup a database for an iOS app, and kind of make the app work in a sort of MVC style, is this possible through iOS alone, or do I need to create a web application to handle database interaction etc?
I would really like to be able to set up cloud storage/databasing directly from an iOS app. Is this possible? Does Apple have a platform for this, or do I need my own server?
In iOS the work with a web based services is very easy but on the other hand: need a "connection file".
it works like this:
the iphone has the info > sends it to a php/asp/asp.net/server side page, this page is taking (by "get" or "post") the info sent and than inserts it into the database, saves the file on the server and etc..
For reciving content from a web based service you also need a server side file to handle your trafic to the database, but now the output you get is in JSON.
you get back to the app an array (the file sends the array back) and than you use the array for handeling the conent you just got.
It may sound very hard but it is not as much as it seems. For your questions: there is not a way to connect directly through the app to a Cloud DataBase.
Now, when talking about owning a server and so: there are not so many companies which provide a cloud databse alone. but even if you get a cloud data base you can always host a domain somewhere cheap and the pages are only a few KB in weight any way...
And those files will be for connecting to the DataBase (The middle-men for the app).
That is a short explanation about connecting to web based services in iOS Developing.

the reason not to access directly from xcode to mssql?

I am planning to build an iOS app with using DB(Ms-Sql).
However, people recommends not to access DB from Xcode.
They recommend me to use php or asp for accessing db through a webpage.
I want to know the reason.
Also I am going to use DB only for (view) select line (not insert, update nor delete).
so is it possible to access directly to db for viewing purpose only?
thank you
It's generally bad for an application (mobile, web, any client) to directly have access to any database for security issues. Clients really should not be accessing the database, which is often holding very private/secure data. It opens up vulnerabilities (i.e., sql injection attack).
A set of web services written in php or java or some back-end technology is a more secure, scalable system. These web services can connect to the database and retrieve data. Your iOS application can call the web services and receive the data..for example in the form of XML or JSON.

Meteor, How to 'Post' data from an external source?

After the recent Railscast on Meteor, my interest was piqued, particularly as I'm looking to implement a live events feed for my Rails app.
It seems to me that Meteor is the perfect solution for my requirements but I'm kinda stuck at the first hurdle.
My requirement is to be able to post data to a Meteor server from my main site (Rails app) and embed the resulting meteor client web page into my main app.
so how would I go about sending the data to the Meteor server and have the Meteor client automatically pick up the data?
Any ideas as to the best approach for this appreciated.
I guess I'm looking for a Meteor api that will accept data from an external data source
UPDATE
Perhaps I need to write a DDP client to work with Rails?
A Meteor application's underlying a data collections are Mongodb collections. So, from that perspective you could.
Write a DDP Client for Rails.
Insert directly into the MongoDB from Rails. If your Meteor app is subscribed on the client side the data will be published automagically in the browser view. This can be shown by subscribing to data on the client and inserting from the browser console, the os console (via mongo directly or meteor mongo on cmd prompt and using db.collection.insert). You can connect to your own Mongo server, you don't have to use the Mongo inside of a Meteor app.
CRUD for Meteor collections will allow you to expose a RESTy type of interface. Albeit Meteor frees you from this old paradigm.
https://github.com/crazytoad/meteor-collectionapi
Start porting your app over to Meteor section by section including the data collection, processing and inserts. You could use iFrames, etc... there is a thread on Google meteor-talk about this.
I hope that gave you some options. I would probably do #2 and start moving toward #4.
S

Setting up a file server for integration with iOS apps

I need to set up a server so that files can be uploaded from an iOS app. I don't know how best to proceed. I thought about FTP but not sure if there is a better option.
any ideas appreciated
GC
Also I must add that I will be building the iOS app so can use server APIs in my code.
It's not ideal to set up a blind File/FTP server and hardcode the details into your app because all it takes is one person to intercept the login details and they have access to your server where they can upload (and potentially execute) bad things.
A possible idea could be to set up an API frontend on your server in a language of your choice (PHP, Ruby, Python or similar) where you can 'POST' images to the server. With the API frontend, you can also do validation to ensure that only valid images are being uploaded and all nefarious stuff is thrown away. Then, in your iOS app, you can set up code to interact with your API frontend and send the actual images which will then be stored on your server.
This is a fairly conceptual idea rather than an absolute implementation idea. It does require some thinking/reading and more setup/coding on the server side.
Edit: Just to add, if you only want a central location to store/get your images without controlling it on a per user basis then you may want to look into Amazon S3 as a File Server.

Resources