JSON FX results not working for Xcode - json

I have an application that has extensively used server calls and i used jsonfx to parse the results and when i build the project from unity and run it on my mac it says
(Filename: currently not available on il2cpp Line: -1)
and application does not processed which is expected because my application depends extensively on responses from the api it hits.
Everything works swiftly on android.

i found out that Jsonfx is not compatible on ios platform an alternative for that is Newtonsoft.Json
simply put use this :
<T>Newtonsoft.Json.JsonConvert.DeserializeObject<T>(jsonString)
instead of JsonFx.Json.Reader
JsonFx.Json.JsonReader reader = new JsonFx.Json.JsonReader ();
<T>reader.Read<T> (jsonString);
offcourse you will nedd to add the following files to your code
NewtonsoftJson

Related

How to activate IWiFiDirectDevice in Win32 Console APP using WRL?

I want to use WinRT API for WiFi Direct from Windows 10 SDK in Win32 Console Application. I know about C++/CX (and even made some progress going that way), but still want to make it work without this extension.
My problem is that I can't activate IWifiDirectDevice interface (from ABI::Windows::Devices::WiFiDirect) to access IWifiDirectDeviceStatics that provides an GetDeviceSelector method.
HStringReference strDevice(RuntimeClass_Windows_Devices_WiFiDirect_WiFiDirectDevice);
ComPtr<IInspectable> insp;
hr = RoActivateInstance(strDevice.Get(), insp.GetAddressOf());
This code ends up with E_NOTIMPL as a result. In Microsoft's example they used factories for activation, but ABI::Windows::Devices::WiFiDirect namespace has no factories.
Worth mentioning that IWifiDirectAdvertisementPublisher works just fine when activated the way I wrote before.
So how to activate IWifiDirectDevice from WRL?
Windows.Devices.WiFiDirect.WiFiDirectDevice is not an activatable class. You can see that by looking at windows.devices.wifidirect.idl.
You will need to use the static methods, e.g.:
HStringReference strDevice(RuntimeClass_Windows_Devices_WiFiDirect_WiFiDirectDevice);
ComPtr<IWiFiDirectDeviceStatics> wiFiDirectDeviceStatics;
hr = Windows::Foundation::GetActivationFactory(
strDevice.Get(),
&wiFiDirectDeviceStatics);
ComPtr<IWiFiDirectDevice> wiFiDirectDevice;
ComPtr<IAsyncOperation<WiFiDirectDevice*>> asyncOperation;
hr = wiFiDirectDeviceStatics->FromIdAsync(deviceId.Get(), &asyncOperation);
Consider taking a look at the Wi-Fi Direct sample.

For Flex remote object calls (BlazeDS), is there a size limitation on objects returned?

I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build. The same call works fine when running on the device (iPhone) using debug build. When running with a release build, the result handler is never called (nor is the fault handler called). Viewing the BlazeDS logs in debug mode, the call is received and send back with data. I've narrowed it down to what seems to be a data size issue.
I have targeted one specific data call that returns in the String value a string length of 44kb, which fails (release build). When I do not populate the String value (in server side Java code) on the object (just set it empty string), the result handler is called, and the object is returned, again, using the release build. This works in a debug build.
The custom object being returned in the call is a very a simple object, with getters/setters for simple types boolean, int, String, and one org.23c.dom.Document type. This same object type is used on other other RemoteObject calls (different data) and works fine (release and debug builds). I originally was returning as a Document, but, just to make sure this wasn't the problem, changed the value to be returned to a String, just to rule out XML/Dom issues in serialization.
I don't understand 1) why the release build vs. debug build behavior is different for a RemoteObject call, 2) why the calls work in debug build when sending over a somewhat large (but, not unreasonable) amount of data in a String object, but not in release build.
I have't tried to find out exactly where the failure point in size is, but, not sure that's even relevant, since 44kb isn't an unreasonable size to expect.
By turning on the Debug mode in BlazeDS, I can see the object and it's attributes being serialized and everything looks good there. The calls are received and processed appropriately in BlazeDS for both debug and release build testing.
Anyone have an idea on other things to try to debug/resolve this?
Platform testing is BlazeDS 4, Flashbuilder 4.7, Websphere 8 server, iPhone (iOS 7.1.2). Tried using multiple Flex SDK's 4.12 to the latest 4.13, with no change in behavior.
Thanks!
After a week's worth of debugging, I found the issue.
The Java type returned from the call was defined as ArrayList. Changing it to List resolved the problem.
I'm not sure why ArrayList isn't a valid return type, I've been looking at the Adobe docs, and still can't see why this isn't valid. And, why it works in Debug mode and not in Release build is even stranger. Maybe someone can shed some light on the logic here to me.

JsonLocalisation and WPF cannot find my translation files

My app runs in WPF and Android (Windows Phone later) with mvvmcross as framework. I implemented localization with JsonLocalisation like the Babel (N21) example and it is working fine in Android. But whatever I try in WPF I get this message;
mvx:Warning: 0,22 Language file could not be loaded for Danish.SettingsViewModel -
FileNotFoundException: Unable to find resource file MyAppResources/Text/Danish/SettingsViewModel.json
at Cirrious.MvvmCross.Plugins.JsonLocalisation.MvxContentJsonDictionaryTextProvider.
LoadJsonFromResource(String namespaceKey, String typeKey, String resourcePath) at >Cirrious.MvvmCross.Plugins.JsonLocalisation.MvxTextProviderBuilder.LoadResources(String >whichLocalisationFolder)"
Stuart says in his video tutorial that the json translation files must be included as "Content" and not copied to the output folder - like;
But looking at the compiled executable with "dotPeek" doesn't reveal the files.
Am I missing something obvious? Any hints would be highly appreciated. Even confirmation from somebody who has JsonLocalisation working in WPF would be nice.
EDIT:
Well, I tried this code in my WPF mainWindow. I understand this call is used internally in MvxWPFResourceLoader.
public MainWindow()
{
....
//This return null without exceptions.
var t = Application.GetResourceStream(new Uri("MyAppResources/Text/Danish/SettingsViewModel.json", UriKind.Relative));
//This throwns an IOException; Cannot locate resource 'thisdoesnotexist/text/danish/settingsviewmodel.json'.
var y = Application.GetResourceStream(new Uri("ThisDoesNotExist/Text/Danish/SettingsViewModel.json", UriKind.Relative));
}
It seems when the path if wrong an exception is thrown. When it is correct it just returns null!!?! I am a bit puzzled, any ideas?
Best regards
Thank you for such fast answer (and for mvvmcross!).
The link you provided is to a Babel solution with a WPF sample - exactly what I needed. I mistakenly used the one from N21 without WPF sample :-)
Anyway, when looking at the sample I noticed that the json files must be included as 'Resource' and not 'Content'. That made all the difference - hurray!
Best regards

getWindowHandle function doesn't exist for driver in Selenium

I need to implement switch from one window to another in IE. However, element driver doesn't support getWindowHandle function.
I assume it might be just configuration problem or settings, though I don't know how to fix it.
Please, any suggestions.
I'm working with c# - Visual Studio
You haven't said which language bindings you're using, but based on a comment you posted, it looks like you're using C#. The method names are slightly different for each language binding. From this answer:
The object, method, and property names in the .NET language bindings
do not exactly correspond to those in the Java bindings. One of the
principles of the project is that each language binding should "feel
natural" to those comfortable coding in that language.
So you have to do a little translation if you're trying to copy-paste Java code. In this case, you want the combination of the WindowHandles property (to look for the new window handle) and the CurrentWindowHandle property of the driver. You can find full API documentation for the .NET bindings at the project's Google code site.
I am going to make wild guess:
Try to initialize your driver like this:
WebDriver driver = new FirefoxDriver(); //assume you use firefox
The interface WebDriver supports that method. Do not forget to store the handle somewhere ;)
String myWindow = driver.getWindowHandle();
BTW that method should return you actual window If you need all windows you probably should use getWindowHandles() method
If this does not work, please provide more info:
what error exactly are you getting?
How do you initialize WebDriver?
What version of selenium are you using?|
What type of driver are you using?

Protobuf-net on Windows Phone 8

I try use Google protobuf in my WP8 application. I use protobuf-net for my purpoces. When I generate my proto.cs file from qwerty.proto I see next string (below)
...
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=#"Query") ]
...
But WP8 SDK has not Serializable in System namespace.
May be I made a mistake when I generated proto.cs via protogen.exe? May be it has any additional parameters?
If you use protogen -p:help it will show you the options available not just for the tool, but: for the template you are using (csharp by default). The one of particular interest here is lightFramework. So add -p:lightFramework and you should be set.
Also: for the best performance on phone 8, you may also want to look at precompile, which allows it to use static IL rather than reflection. This is discussed more here.
Note that with protobuf-net it is not required that you start from a .proto file, but that usage is supported; it also works fine "code-first".