Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hi guys,
I've been developing android apps on Xamarin for 3months now, but I am facing a problem to update the application when a new release is available.
The application is not published to any app store(as we use it internally), i know Play store can do automatic updating, but i need to look for an update on our server, I would prefer if all this can be done silently(in the background).
here is my current code, this copy's the app to the device(in the background):

C#
intent.SetData(Android.Net.Uri.Parse(@"http://xxxxx/downloads/app.test-signed.apk"));
            StartActivity(intent);

this installs the app onto the device,

C#
intent.SetDataAndType(Android.Net.Uri.FromFile(new Java.IO.File(Android.OS.Environment.ExternalStorageDirectory.Path + "/app.test-signed.apk")), "application/vnd.android.package-archive");
            StartActivity(intent);


but this way it asks to install(and don't think this is the correct way), and doesn't start my app automatically after it was installed. And i am not sure how to wait until the app finished downloading before it tries to install.

Thanks
Posted
Updated 22-Apr-13 3:02am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900