database - Add project references in Xamarin's Shared Project -



database - Add project references in Xamarin's Shared Project -

i using xamarin develop ios , android application.i have creates 1 shared project mutual both platforms. using database mutual , set in shared project.i need encrypt database, need add together native sqlite library reference in shared project can modify code.

my question : have not found way add together reference of other project/library in shared project.

is bug or expected behavior?

any explanations appreciated.

thanks.

there no 'references' usual sense of adding project reference shared project.

there scope shared project opened farther is, not, , design, currently, although limiting in ways.

in short, shared projects have no generated outputs. other projects reference shared project(s) compilable outputs generated - based on conditional compilation symbols may have specified.

in order add together sqlite library references need utilize nuget in order add together packages solution.

these nuget packages install , create platform specific library references appropriate each platform targeting.

if take on platform specific projects, see references treeview node expand when add together nuget bundle , install projects library outputs appropriate package.

you can code in shared project against these nuget packages referenced in projects.

update 1:-

if you've added bundle nuget, things should line-up in general unless there platform specific stuff included.

if there functionality specific particular platform; or library only added straight platform-specific project, can utilize conditional #if statements in shared project access these platform-specific differences.

update 2:-

example:-

1) have shared project , android, ios , windowsphone platform-specific projects reference shared project.

2) create new windowsphone class library project.

3) add together next class it:-

public class mywindowsphoneclass1 { public string sayhello() { homecoming "hello"; } }

4) in windowsphone platform specific project, add together reference (in case solution reference part of same solution) new windowsphone class library project created in step 2.

5) come in next code function in shared project:-

phoneclasslibrary1.mywindowsphoneclass1 o; o = new phoneclasslibrary1.mywindowsphoneclass1(); string strresponse = o.sayhello();

and compile.

you notice compilation errors ios , android, phoneclasslibrary1 not found.

however....

if alter code to:-

#if windows_phone phoneclasslibrary1.mywindowsphoneclass1 o; o = new phoneclasslibrary1.mywindowsphoneclass1(); string strresponse = o.sayhello(); #endif

you see project compiles on all 3 platforms due utilize of conditional #if statements.

database sqlite xamarin

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -