Xamarin Forms Android - Scoped Storage Access (Android API 30) - c#

Currently I'm in the process of updating my application to work with Android API 30 to comply with Googles new Privacy Rules. Prior to this I was using the "Use legacy storage" flag so I could access Public storage with ease once Read/Write permissions were achieved, however that's no longer available in the latest API.
For a temporary workaround I am using ACTION_OPEN_DOCUMENT_TREE or Intent.ActionOpenDocumentTree (In Xamarin) in order to gain read / write access to the device bluetooth folder (It has to be this folder as that's where im looking for the specific files).
Whilst this method works, it's not ideal for a regular user as it requires them to actually search and find the folder instead of just getting a pop up asking for access.
What the process currently looks like #1
What the process currently looks like #2
What the process currently looks like #3
Ideally what I'm after is Image 3 to be the only interaction the user has to perform in order to give access to this particular folder. However Xamarin Documentation isn't particuarly clear (Especially on these new storage API's) and was hoping someone could help point me in the right direction!
Any help would be greatly appreciated thanks :)

Related

Embedding *.chm help file in application itself (C# Winform)

How can I include/embed .*chm help file in application itself (not as separate file in output)? Can it be placed in "Resources.resx" and read from there? I tried this method but it seems that it doesn't work...
Storing the chm in a resource is a bad idea and difficult to handle, deploy it as a plain file.
Changing and recompiling a CHM file is not an easy task without the associated project file (*.hhp). Therefore, the content is reasonably - but of course not completely - safe.
A user actually makes your software unusable by making changes to the installation path and help content. Updating the help topics must match the version of your app and is your responsibility.
If it meets your requirements you can think about a so-called web-based help. Upload your help to a server and add a web browser control to your application.
See also:
Best approach to implement Help feature in Windows Desktop Application - Restrict the App knowledge base to authorize access
Old stuff, but have a look at a sample for Uncompressed help here too.

Save Key or String securely in app - Xamarin Form

I’ve been following various articles and answers regarding saving
API keys / password / strings still havent gotten specifically that i have been searching.
The idea is to save KEY in a form of string in Xamarin.Form
where the KEY can be accessed while debugging
but should not be exposed if reversed engineered an APK or IPA file.
Stated by one of my colleague ‘Gradle’ used to do similar in android native
yet am unsure on it and where do i get it working in Xamarin.Forms with respect to iOS and Android
Any information related would be much helpful
Your best bet is to make use of SecureStorage this will use the platform specific secure stores to store the data you provide.
As pointed out in comments you should always operate under the assumption that someone will be able to gain access to your code and reverse engineer it. Using the secure stores per platform will require that anyone accessing the device will be able to unlock it via PIN or biometrics, depending on the device.

How to get a JSON file (or something similar) with lightning data from http://en.blitzortung.org?

I am currently working on my school project - Android app that informs you about strong lightning strikes near your house in real time.
There are some websites like blitzortung.org or lightningmaps.org (or other), any ideas how can I get nice output file from one of these sites, so that I can obtain geographical data, determine whether it is near your house or not, and send a push notification for user? Displaying the strikes on the map are not needed.
I am using an Android Studio, Visual Studio 2015 as well as MS SQL database.
Thanks
You can get complete source code for this from following URL
https://github.com/wuan/bo-android
It's using data from lightningmaps.org
You can give a try to Open Weather or check this answer.
For Push you can use FCM. Just google "How to implement GCM in android?" you will whole lot of help.
According to blitzortung forum:
Please remember that Blitzortung data may not be used for commercial
purposes. General operator data access info: login to your main
Blitzortung Org account, and click the 'compendium' link under
'project area'. If you haven't already, you might also see
http://www.lightningmaps.org/doc/intro

Disable "azure-jobs-host-output" / "azure-webjobs-hosts/output-logs" messages

My goal is not to clutter blobs.
• I am using latest webjobs sdk at the time of writing (ver 1.1.1). Using Queues, running WebJobs, creating files, deleting files and writing database entries.
• I tried searching but it seems that "azure-jobs-host-output" and "azure-webjobs-hosts/output-logs" are automatically created and filled with lots of stuff.
• My effort so far after searching through web is just this one line of code I have written in order to stop some logging:
config.Tracing.ConsoleLevel = TraceLevel.Error;
This is supposed to restrict logs to error level. Which is good I understand but I am not sure which one of the above will it restrict.
• Can I disable the other one completely?
• Or more precisely, can I stop/disable all logging/logs and bring it to bare minimum, to only the ones which are absolutely necessary to run webjobs sdk?
Thanks for reading, any help is highly appreciated.
Setting config.Tracing.ConsoleLevel only controls output written to the Console. It sounds like you want to turn off Dashboard logging (if you don't want to use the WebJobs Dashboard). Those additional blob containers that you mentioned are the storage for all the Dashboard analytics logs. To disable that, you can set config.DashboardConnectionString to null. That will completely disable all Dashboard logging.
At that point, you'll be running with the bare minimum :)

Mail Storage Quota Checker in C#

We have a requirement to build a tool for users in an Intranet scenario.
The tool should check how much percentage of the Mailbox Quota (set in Active Directory) is being used.
Currently, they can check their Folder size using Outlook 2003 but this does not show the Quota Limit set for them or the percentage being used.
This blog has all the exact information I need including vbscript samples.
If you have any similar C# code, please post it.
That will give me a good lead on writing a small system tray application which will poll the Active Directory and show the percentage in real time.
PS: I am not being lazy. Already started writing code for this. Just checking if any of you went through a similar exercise and have code to share.
Querying ActiveDirectory is pretty simple. You can find some good examples I've used before here.

Categories