.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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -