Android things DP6 Intent with android.provider.Settings.ACTION_SETTINGS does not work anymore - android-things

I was using the intent with android.provider.Settings.ACTION_SETTINGS to show the system settings screen from inside my app, to allow the user to configure certain details, like a bluetooth keyboard or adjust the timezone. This was working very well in the DP5.1.
But now in the DP6, the intent
startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);
Does not work anymore. No exception is logged in the console.
Any workaround on this?
THe option to install the apk after configuring the device with the IOT_LAUNCHER screen is not very practical for me. Because I want to deliver an image with a bundle, and my app will be started automatically, not allowing the user to see the IOT_LAUUNCHER screen.
Thanks.

In DP6 the Settings application is either deprecated or removed. APIs to modify the screen or time have been added.

Related

Camera and Photos permission - iOS [duplicate]

In my iOS app I am accessing the user's photo gallery. The first time the user does this, it asks them for permission. Some of my users have reported getting a crash this first time due to the permission request, but it works fine on subsequent tries.
To be able to test this on my own, I need to be able remove the permission from my iPad and have it prompt again. Is there a way to do this either through the iPad/iPhone itself or through code?
Run the Settings app. Go to General, then Reset. Tap on Reset Location & Privacy. This will reset all of your location and privacy settings, not just for your test app. But you are doing this on a development device so that should be OK. This works in the Simulator too.
In iOS 7+, you can go into Settings > Privacy > Photos and explicitly enable or disable access for individual apps.
This is much better than resetting your entire device privacy settings!
Another way is to temporary change Bundle Identifier (CFBundleIdentifier) in Info.plist.
System will treat such app as a new separate app and will display "would like to access your Photos" alert.
Don't forget to revert CFBundleIdentifier after you end testing.

where to write the code that does force on an iPhone user to update iOS application in his iPhone?

I need how Can I force on an iPhone user to update iOS application in his iPhone?
after searching I get the answer of this issue the fallowing link:
Can I force an iPhone user to update iOS application
But I do not have any idea where to write this code and I want to display the message that says the new version is ready at the first time the application runs before launch page.
can any help me this issue.
please help me.
I added a viewController which behave as a splash screen. In this viewController I get current application version and sent to server for validation and show alert to user if his application is not updated. If user click on update then redirect user to appStore.
For reference image is attached.
I suggest you to use This library where you can use in both Objective C and Swift. And you can use it by using CocoaPods and manually.
And it supports
A three number versioning system (e.g., 1.0.0)
Also supports two-number versioning (e.g., 1.0)
And also supports four-number versioning (e.g., 1.0.0.0)
Check the link for more features.

Is there a way to access and modify iOS settings with Swift?

Are there any classes or frameworks out there that allow my app to access and modify iPhone settings of the device used to visit my app? I know there's plenty of apps out there which (for example) can change the screen brightness of the device, so I was wondering if it's also possible to modify other settings you can manage in the Settings app on your device (i.e. automatic device lock, time and date, etc.).
No this can't be done... What you can do is to open the settings and that's it. Apple does not allow you to change anything outside your application.

Automatically check for iPad app when downloading specific file type from website?

I think I already know the answer to this ("can't be done"), but I figured I'd see what people think...
On my client's website they're posting files for download that specifically need to be viewed on iPads using the Cadwork Viewer app:
https://itunes.apple.com/us/app/cadwork-viewer/id505161598?mt=8
You can't open the file on an iPad unless you have that app, and I'm wondering if when clicking on the file to initiate download if there's a way to scan the device to see if Cadwork Viewer is already installed. If so, proceed with the download of the file. If not, pop up a notice "This file requires the Cadwork Viewer app, download it here from iTunes." Something like that.
Again, I think this is just not doable, but hey...there's all sorts of things I don't know!
Thoughts?
Check out this link: https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html
You can add a banner to the mobile site that lets you open the app from Safari.
Explanation from Apple:
If the app is already installed on a user's device, the banner
intelligently changes its action, and tapping the banner will simply
open the app. If the user doesn’t have your app on his device, tapping
on the banner will take him to the app’s entry in the App Store.
This should be a good starting place.

Disable deleting application by tap-and-hold

Usually on a long press of a third-party application icon, it will give you the option to delete the app. Is there any way to disable that option, the way it seems to be with the preloaded applications on iPhone?
It's not possible to do it from within the app.
You could, however, configure the parental settings on the device to disallow removing applications (Settings -> General -> Restrictions), but you would need to do it on each device you want the feature enabled, and the setting will apply for all third party apps, not only yours.
Nope, you can't disable it. If you're developing some enterprise application where the iPad is supposed to run only your app and nothing else, I suggest getting a case or something along those lines to block the "home" button on the iPad.

Resources