WP7 tombstoning Memory Save - windows-phone-7.1

So for my windows phone 7 app, I am trying to save the user input after they 'tombstone' my app when I first debugged the app I got a KeyNotFoundException, but after I entered some data into my textbox and tombstoned my app the I didn't get a KeyNotFoundException. Can someone please help me with this problem?

KeyNotFoundException means that you are trying to get some data from data collection by key, and that key/value pair does not exist:
http://msdn.microsoft.com/en-us/library/system.collections.generic.keynotfoundexception.aspx
Before trying to access the date using key, first check if that key even exists using ContainsKey method:
http://msdn.microsoft.com/en-us/library/kw5aaea4

Related

Code by Zapier - Input data field losing information when trying to execute code

I am using code by zapier, javascript.
I've used before and never had problems.
But today, as I am trying to create a new zap, I am reading data from trello and then trying to process the data with code by zapier.
I am filling data coming from trello in the field "Input Data", and then, trying to read the input data in my code using:
var cards = inputData['cards'].split(",");
The problem is that when I test the code, I receive an error:
TypeError: Cannot read property 'split' of undefined
When I go to check the Input Data field, it is losing the information.
Even if I type again, the Input Data information is not storing what I am asking there.
Any ideas?
Thank you
Amanda
Thank you everyone. I haven’t changed a thing.
I’ve tried in the next day with the same zap and that initial code that I posted.
Zapier was cleaning out the field with the data input from Trello (wasn’t detaining the value to pass to the next step).
Now it’s working. As I tried with different browsers on the same day and it was equally not working, I believe it was a bug that was fixed.

Not all NSUserDefaults are restored on app relaunch

I am converting 2 custom lists into a json string and storing it the NSUserDefaults. Something like so:-
NSUserDefaults.StandardUserDefaults.SetString(JsonConvert.SerializeObject(stationList.Take(50)), "StationList1");
NSUserDefaults.StandardUserDefaults.SetString(JsonConvert.SerializeObject(stationList.Skip(50).Take(50)), "StationList2");
If I try and retrieve them immediately after saving them like below I get the saved values:-
savedStationList1 = NSUserDefaults.StandardUserDefaults.StringForKey("StationList1");
savedStationList2 = NSUserDefaults.StandardUserDefaults.StringForKey("StationList2");
But the issue is if I restart the app, and try to get the above values in another part of the code, I only get the value for:-
savedStationList2 = NSUserDefaults.StandardUserDefaults.StringForKey("StationList2");
and the value for below is always null :-
savedStationList1 = NSUserDefaults.StandardUserDefaults.StringForKey("StationList1");
I do not override these values anywhere within the app. Is there a way I can solve this?
Any help is appreciated
Although natively the iOS system does store data added through 'userdefaults' it may not do this instantly. I would suggest adding the following line:
NSUserDefaults.StandardUserDefaults.Synchronise();
After you store data to standard user defaults run the synchronise and test that you can extract the data, you should find that this will now work correctly for you.

How to search Crashlytics custom keys

Using their handy guide, I'm able to set custom keys in crash data that appears in the Crashlytics dashboard for a particular crash. The docs (and placeholder text in the web site's TextBox) say you can search by key to find a crash like you can using other data like method name, line number etc. I can't get the search to ever find a crash by a key value. I've tried searching on both the custom key's name and value and it never finds it. I hard coded a simple key to the value "hello" just to make sure it wasn't a search case sensitivity type issue but no luck. Anyone ever able to successfully search by custom key?
In the text field that says Search issue title, subtitle or key, you need to put the search query in this format:
key:<key> value:<value>
eg
key:id value: b329e5d2-dd2a-4bfb-95e3-1e5ffc9153dc
Where in the code I've created a custom key named id
Apparently, you just have to wait. 15 minutes or so after the crash had appeared on the dashboard site, the search by key value worked fine. Must be their search index service had to cache/process the new data?

SQL Server report's saved URL as bookmark not working

I have report deployed on a SQL Server Reporting server. It has one multivalue parameter called 'Names' as a input for stored procedure which fetch data to display the result. In URL, I am adding all values selected for multivalue parameter are concatenating with '&' character.
I need to store this URL for further uses as a bookmark in my browser which is also working fine. Problem occurs when over a time one of the values for that parameter gets missing from the database then report comes blank.
Some points I would like to clear here:
Stored procedure is working fine even if some values are missing.
I could figure out that this might be because of that value is not present in the dropdown of 'Names' so it is unable to assign it before running the stored procedure. As a solution to this problem I tried to hide this parameter from report by clearing prompt box for 'Names', but I now get
The ''Names'' parameter is missing a value
When you upload the report (.rdl) into reporting server, make sure "Name" parameter has a default value, this way the stored procedure is able to get the default value even if the link is missing the "Name" parameter

iOS WebApp - Remember Device for saves

I've got a webapp running in fullscreen that interacts with a database via ajax.
Is there a way i can get a "signature" or "id" of a device to store for each device???
Basically I've got a "saved items" option, and they will be saved to a unique id. I cant use IP Address coz of multiple devices or if you use the 3G service. Any other ideas? (dont want user authentication).
Could I save an array in the manifest file and access that?
Thanks
I solved this issue by using html5's local storage.
i used
var salt=Math.floor(Math.random()*10000); //makes random salt
var randomId=Math.floor(Math.random()*20000); //makes another random number
randomId = salt+(salt*randomId); //makes the id even more random to avoid dupes
localStorange.setItem('deviceId',randomId); //sets a local variable that can be accessed by localStorage.getItem('deviceId'); and cross-refrenced with a $.get from a database to load the saves.
$.post("saveDeviceId.php?id="+randomId); //saves the new id to the database
this is how i resolved it anyway, unless anybody has a more efficient way?

Resources