I'm developing an app for android and ios with Xamarin.Forms where I have to store data, which the user enters.
The data may never be deleted, except the user deletes them within the app or by deinstalling the app. But the data must be persisted when the user installs an update via the app store.
Also the data (which is a json string) contains no token or other temporary data. Every day the data could be increase by 200-300 string characters.
At the moment I use Application.Current.Properties, but I'm not sure if it fits both of my requirements...
Which framework/approach is the best for it?
Just write your json string into a file. You'll get it back after an update.
Related
I am currently working on a task where I need to synchronize the data, example:
Client makes a request to get data to the API (API has access to the database), client received the data and saves it to the list. That list is used for some time etc..... Then in the meanwhile another client accesses the same API and database and makes some changes... to the same table... After a while the first client want's to update his current data, since the table is quite big let's say 10 thousand records, grabbing the entire table again is inefficient. I would like to grab only the records that have been modified,deleted, or newly created. And then update the current list the client 1 has. if the client has no records, he classifies all of them as newly created (at start up) and just grabs them all. I would like to do as much checking on the client's side.
How would I go about this ? I do have fields such as Modified, LastSync, IsDeleted. So I can find the records I need but main issue is how to do it efficiently with minimal repetition.
At the moment I tried to get all the rows at first, then after I want to update (Synchronize) I get the minimal required info LastSync Modified IsDeleted Key, from the API, which I compare with what I have on the client and then send only keys of the rows that don't match to the server to get the entire values that match the keys. But I am not sure about efficiency of this also... not sure how to update the current list with those values efficiently the only way I can think of is using loop in loop to compare keys and update the list, but I know it's not a good approach.
This will never work as long as you do not do the checks on the server side. There is always a chance that someone post between your api get call to server and you post call to server. Whatever test you can do at the client side, you can do it on the server side.
Depending on your DB and other setup, you could accomplish this by adding triggers on the tables/fields that you want to track in the database and setting up a cache (could use Redis, Memcached, Aerospike, etc.) and a cache refresh service . If something in the DB is added/updated/deleted, you can set up your trigger to write to a separate archive table in the DB. You can then set up a job from, e.g., Jenkins (or have a Kafka connector -- there are many ways to accomplish this) to poll the archive tables and the original table for changes based on an ID or date or whatever criteria you need. Anything that has changed will be refreshed and then written back to the cache. Then your API wouldn't be accessing the DB at all. It would just call the cache for the most recent data whenever a client requests it. Your separate service wold be responsible for synchronization of data, database access, and keeping the cache up to date.
I'm using authbot (AuthBot) to login users on my bot, but, I'm using a large amount of data, and since than, it starts gives me an error that I'm overload (Stackoverflow)
So, I do as suggested, I create an Azure Table Storage, since than, my bot does not recognize the authentication. It seems Authbot cannot get \ set the data from table storage. Do you know something about it?
The current AuthBot uses the default state client. I've submitted a PR to fix this: https://github.com/MicrosoftDX/AuthBot/pull/37/files
In the interim, you can download the AuthBot source and include the changes to OAuthCallbackController in your project.
Edit:
This repo will eventually replace AuthBot: https://github.com/richdizz/BotAuth It is already using the correct state client interfaces.
I have a web page where the user provides the input and press the Submit button. On button click I'm downloading the click once application to process the input on client machine. Currently passing the input as query string parameter to the click once application.
i.e. myapp.application?
But there is a limitation in the Query string, that I cannot send the data more than ~2000 characters, Is there any way that I can attach the data along with the download of click Once application?
ClickOnce uses manifest file to define, what files should be downloaded. I hope, you are using signed manifest for application deployment. Signed manifest contains package files hashes as well as hash of the manifest itself. You can put the data into the file, which is defined in the manifest. However, you will have to generate manifest file dynamically every time a user requests application installation along with new portion of data. This can work fine, if the user removes the application right after data processing has been finished. But it can easily out of control eventually.
I would try another approach: store the data on server side and put id value into query parameter string. The application can request the data from the server by provided id. Just make sure that the data is protection is consistent with its sensitivity. For example, if it is some kind of private user information or data protected by law, you need to make sure that only authorized user can get it from the server and the data is stored in secure manner.
Is it possible for an XNA game/app to obtain it's own store link url through code or would I have to submit an app, wait for it's store link to become available and release an update including the store link?
Basically I want the player to be able to post his or her score to any social networks set up along with a link to the store page.
-Short question I know but my Google-Fu failed me this time.
To get a store URL, you will need to get hold of the app id. This is done by calling GetManifestAttributeValue. Note that the actual app id (Product ID) is generated when the app is published, and is different than the temporary one that is in WMAppManifest.xml. This causes a chicken and egg scenario when it comes to testing this.
See this for detailed instructions:
http://code.msdn.microsoft.com/Generating-a-Windows-Phone-9d19f939/
If all you need is to link to store from within your app, then use MarketplaceDetailTask to launch to the store. Leave ContentIdentifier as null and it will attempt to bring up the detail page of the current app. If you need to bring up the detail page of a different app, then you will need to know the app id, which you can only get after that app has been published.
http://msdn.microsoft.com/en-us/library/hh394017%28v=vs.92%29.aspx
I have a Metro app where I need to save some data about the current "session" so that the next time the user launches my application, this session data may be restored. Some of the data is not meant for the user, but to aid in which data should be displayed right away, and which should be displayed at a later time if requested by the user.
I have been using LocalSettings for other things but have just noticed that these settings only appear to last for the lifetime of the application.
How should we be storing settings that need to be saved to the App's data folder?
You can achieve it by binding the data in to certain format , saving it in a file , retrieve it when the app launches.
Create a ApplicationDataContainer.
Initialize a StorageFile with the name you wish.
Serialize your "theme/settings" object using
DataContractSerializer.
Write the content to the StorageFile instance created.
On Application launch:
Deserialize the data.
Populate in the way you want.
You can rather use XML as mentioned by #Lütfullah Kus
you can store log to xml file like "lastform:frmSomething;lastwindow:somewindow..." and you can reload it when app start again.