.net - How to identify Processor Architecture in Xamarin.Android? -


lets android processors of type arm testing, emulators of type x86. native library runs on arm , want put dummy code x86 in order create unit tests. know simple try/catch suffice, problem wan create interface dummy code unit tests.

i have tried,

        system.reflection.portableexecutablekinds pekind;         system.reflection.imagefilemachine machine;         typeof(object).module.getpekind(out pekind, out machine); 

and various answers found .net, while in android, x86 always, though running app on device, not give me correct answer.

  type(object).assembly.getname().processorarchitecture  

always returns x86.

you can use android.os.build class confirm if device arm or intel x86 (intel) armeabi-v7a or x86 etc.

ilist<string> abis = android.os.build.supportedabis; 

alternatively

you can use java.lang.javasystem.getproperty method os architecture, armv71 , i686 etc.

string osarchitecture = java.lang.javasystem.getproperty("os.arch"); 

Comments