How to upload image in windows azure mobile service from android.? - android

I am new in android I am using windows azure mobile service and I am Inserting Text data successfully but now I want to Upload Image in windows azure mobile service. I know its is possible by Azure Storage I have seen this post http://chrisrisner.com/Storing-Images-from-Android-in-Windows-Azure-Mobile-Services but its confusing can anyone tell me simple step by step process to save image in windows azure mobile service.
I will be Very Grateful for you

The page you're looking at does not use the best recommended approach for storing image data with Azure Mobile Services. Instead, you should connect to Azure Blob Storage when you want to store a file. You can see a full tutorial of connecting to Blob Storage and saving files from an Android app here: http://chrisrisner.com/Android-and-Mobile-Services-and-Windows-Azure-Storage. Essentially the steps you follow are:
Create a table script / custom API in your mobile service that will save your data as well as generate a Secure Access Signature (SAS) URL from Blob Storage.
Call that endpoint from your mobile app.
Return the SAS URL from the endpoint.
When you get the URL back on your mobile app, use that URL to post your image file.
The way that older approach uses is to convert the image data into a format that can be stored using Azure Mobile Services SQL Database. This does work, however, it's very inefficient.

Related

How to save image in Microsoft SQL Database on Azure from Android app?

I'm trying to find an easiest way to store and image from Android app in SQL Database on Azure. I created Azure Mobile App and I have sample project with TodoList table on my database. The client (Android app) project can save new text item to this database. How can I save image?
Per my experience, to store image from Android App to SQL Azure is that encode an image using Base64 to a byte array as an entity attribute to save it as a blob column via the backend of Azure Mobile App using NodeJS/C# on SQL Azure.
However, to save images to SQL Azure or other RDBMS is not a good idea. The correct & best way is that using Azure Blob Storage to store images or other files. There is a good blog which introduces how to store image from Android on Azure Mobile, I think it's very helpful that you can refer to.

Best practice to upload file to cdn while developing mobile application?

I am making mobile application . I have used Azure mobile service as the backend services for to build mobile application . In mobile app i have to upload images to azure cloud storage . I can do by two method .
Uploading file from the client application
uploding by sending byte array or base64 string of file to server
and server will uplod that file to them
I think first method is good as it is directly going to upload file instead of going to server and pushing again to azure storage .
I don't know which approch is good . Any help is appriciated
As David mentioned, the question is a bit broad and not related to CDN, but within the scope of Azure Mobile Services, I would recommend option #1, as that offers a few benefits, including (but not limited to):
Minimized load on your Mobile Service, potentially avoiding the need to scale the service to keep up with file management
Ability to use the storage APIs designed to handle blob management from the client and avoid having to implement and maintain similar APIs as part of your service (including support to resume uploads/download and other nice features for mobile apps)
Ability to (more easily) use the different geographic locations offered by Azure Storage to have clients upload and download files using the nearest location.
And the list goes on...
The recommendation is still to expose an API from your service to allow clients to request a SAS token in order to provide authenticated access to storage. This approach is similar to what is used by the Mobile Apps File Management SDK.
I hope this helps!
You can use a third party service like Filestack that handles the uploading & storing files, and the CDN delivery.
You can upload files directly to Azure with the pick and store method:
filepicker.pickAndStore(
{
mimetype:"image/*",
multiple: true
},
{
location:"azure"
},
function(Blobs){
console.log(JSON.stringify(Blobs));
},
function(error){
// console.log(JSON.stringify(error)); - print errors to console
},
function(progress){
console.log(JSON.stringify(progress));
}
);
And then every file uploaded generates a CDN url that you can use to deliver the image in your application. Not sure if you've looked into what CDN you want to use yet, but Filestack partners with Fastly so you have all of their features, which is one of the best.
I use Cloudinary is a image back-end for web or mobile development, It's really easy upload images to a CDN.

Accessing external database from Android app

I have a sqlite database with about 15MB of data (too large to store on each device). I am building an app to interact with this data. How to go about accessing the database from wherever the app is being stored. I'm not asking someone to do it for me, but where do I go about researching how to do this. Is there an android module that does just this after being passed an ip address (or FTP Server IP?). Where do I start researching the best way to host my database and then link it to my app? What's the high level brief of how this is accomplished? Thanks!
Two ways
You can send a query to the web server and retrieve the result (you need the web server URL that received your query and send the result through HTTP).
You can download the database and put it in the app database directory and then you can query this database.

Accessing a file on an android device using asp.net webpage in chrome

I have an asp web page which needs to grab an xls file from the device storage area on my android tablet, convert it into bytes and store it in my SQL database.
I can do the converting and storing bit but I have no idea as to how to get the file using VB.
Can anyone tell me how I can get the file without the user having to search for it using an upload control?
I would also like to delete the file after processing..
Thank you..
Derek.
In order to think about this we need to have clear in our minds where the division between client and server exists: You've got a webserver running ASP and a client running a webbrowser on the android platform.
The file you are trying to upload exists on the client. As such any code which does the uploading will have to run on the client and, as the client is running on android, it's unlikely it'll be VB doing the uploading. You're likely to need to use a scripting language like Javascript and, if you care about cross-browser support, be careful how you do it.
The server cannot get the file directly from the client due to common security restrictions.
Once the client side script has got the file, it'd usually send the data to the server using a webservice or other endpoint, deletion of the file can then happen after that.

Intel XDK: Connecting your mobile app to a database

I am currently developing an application which if I don't have a database, the application after building will be heavy. How do I connect the application to a database, either local or remote?
Thanks in advance.
You can use one of the following methods for using database:
1- Using HTML5 client side databases. HTML5 provides four different types of Storage of data on a local client's machine. They are
Local Storage.
Web SQL Storage.
Session Storage
Indexed DB
It depends on your demands you can use one of them. If you need a persistent database for saving values less than 5 Mb, I recommend you LocalStorage as implementation of that is very easy. The data you saved in HTML5 localstorage will not be deleted even in case of phone shut down or reset. The data will be deleted only when you remove it by localStorage.removeItem(); Client side database is not recommended if you have huge amount of data or you need a central database which you should show to everybody who use this app in the world. in these cases its better, you use server side database
You can read a very nice article about how to use html5 local databases in XDK website:
https://software.intel.com/en-us/articles/html5-local-storage
2- You can use server database like MySQL or SQL server. however you need to connect your html codes to a PHP or asp.net script in a server by AJAX. You may use JSON for transfer data from PHP in server side to JS in the client side.
3- You can use cloud databases like Parse.com however Parse.com will be fully retired on January 28, 2017.
For local storage of a web or hybrid app you can use IndexedDB. There's a great tutorial on HTML5 rocks for a TODO list that you can follow: http://www.html5rocks.com/en/tutorials/indexeddb/todo/.
For remote databases, I like to use Parse.com to store data objects like for games I store user settings, high scores, etc. https://parse.com/docs/rest. Take a look at their Quickstart guide.
Hope that helps!
You could use LOCAL STORAGE the usage is pretty easy:
/* saving the data in Local Storage */
//yourData : this data could be an array, object or a plain string
window.localStorage.setItem('data', JSON.stringify(yourData));
/* retriving the data from local storage */
window.localStorage.getItem('data');
That's all, make sure your data doesn't exceed 5 MB.

Categories

Resources