Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to get apk folder full path programatically (Xamarin.Android) ?

$
0
0

In the apk folder of my application I have a database. I want to connect to that database. Cpodo.Cpodo is the name of the apk folder. Doing the following:

string databasesPath = Android.OS.Environment.ExternalStorageDirectory.ToString() + "/Android/data/Cpodo.Cpodo";
var connection = new SQLiteConnection(System.IO.Path.Combine(databasesPath, databaseName))

I am able to connect to the db but is there a single command to get the apk folder full path so I don't have to type all that:

Android.OS.Environment.ExternalStorageDirectory.ToString() + "/Android/data/Cpodo.Cpodo"

Because it is working for my phone but may be in another phones the apk is located in different place and in that case this line of code won't work.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>