Default System Dialog Does not Fit Circular Screen resulting in options not being shown - wear-os

I am writing an app for Galaxy Watch 4 (Android - Wear OS) to communicate with OSC cameras through wifi.
the app on the Galaxy Watch 4 is scanning available networks, then it makes a network request using WifiNetworkSpecifier.
At this point , the system asks user if they want to accept this request with a default dialog.
The dialog says "app wants to use a temporary Wi-Fi network to connect to your device" and has OK and Cancel options. But the OK option is not being shown because the dialog does not fit the circular screen.
WifiNetworkSpecifier specifier;
//specifier = new WifiNetworkSpecifier.Builder().setSsid(oscSSID).build();
specifier = new WifiNetworkSpecifier.Builder().setSsidPattern(new PatternMatcher("ONE", PatternMatcher.PATTERN_PREFIX)).build();
NetworkRequest request = new NetworkRequest.Builder()
.addTransportType(NetworkCapabilities.TRANSPORT_WIFI)
//.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
.removeCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
.setNetworkSpecifier(specifier)
.build();
connectivityManager.requestNetwork(request, networkCallback);
How can we alter it or solve the issue ?

Related

iCloud UI Testing displays alert Sign In to iCloud, although logged in and iCloud is enabled for the app

My app uses iCloud, and I want to UI test it using simulators.
Thus, I logged in the simulators into iCloud using the system settings.
Now I can run my app without problems.
The problem arises when I try to UI test what happens when iCloud usage is disabled in the system settings app.
To do so, I launch first my app using
app = XCUIApplication()
app.launch()
Then, I want to disable iCloud usage in the settings app. Thus, I open this app using
let settingsApp = XCUIApplication(bundleIdentifier: "com.apple.Preferences")
settingsApp.launch()
This does indeed open the settings app, but for some reason, it displays an alert
I don’t why this alert is shown, because it happen only during UI testing, not when I run the app, hit the home button, and launch then settings app.
Moreover, I was not able to catch this alert using
let signInAlert = app.alerts["Sign In to iCloud"]
let signInAlertShown = signInAlert.waitForExistence(timeout: 10)
signInAlertShown is set to false if I set a breakpoint after this statement in a UI test.
So my questions are:
1) Why is this alert shown?
2) How can I handle it?
I still don’t know why this alert is shown, but I know now how to handle it:
This alert is a system alert that appears asynchronously. Thus, it is not possible to access it with
app.alerts["Sign In to iCloud"].waitForExistence(timeout: 10)
Instead the app UI is interrupted. Thus the alert has to be catched by an alert monitor, and the test has to wait for it:
var alertMonitor: NSObjectProtocol!
var expectation: XCTestExpectation?
…
alertMonitor = addUIInterruptionMonitor(withDescription: "Alerts") { (alert) -> Bool in
alert.collectionViews.secureTextFields["Password"].typeText("iCloud Password")
expectation?.fulfill()
alert.buttons["OK"].tap()
}
…
expectation = expectation(description: "signInToICloudAlert shown")
wait(for: [expectation], timeout: 10.0)
Of course this is not the only asynchronous alert that can happen. Thus one has to check if the expected alert was shown. This has been omitted for clarity.

DIAL with Cobalt

Cobalt can default load the URL. We are investigating how to add the DIAL paring code to the URL. Maybe it needs a changeURL API for avoiding re-launching YouTube.
// Restrict navigation to a couple of whitelisted URLs by default.
const char kYouTubeTvLocationPolicy[] =
"h5vcc-location-src "
"https://www.youtube.com/tv "
"https://web-release-qa.youtube.com/tv "
[scenario]
launch YTTV with your remote controller
open YouTube app on your phone
try to pairing to TV
Cobalt currently doesn't implement DIAL smooth-pairing once launched, but it does support being launched with alternate query parameters via the --url= command-line parameter.
For example:
https://www.youtube.com/tv?...anything...
Will pass the navigation whitelist.
Full implementation of smooth-pairing support is planned for Q1 2017.

Opening the uri from background tasks in Universal windows apps

I know this sounds weird. Is there any way we can open a URI from background tasks in Windows 10 Apps?
I have 2 requirements,
Talk to cortana and it will show you results based on the speech recognition, when user clicks on it, we cannot open the links in browser directly. Instead I am passing the Launch Context to the Foreground app and then using LauchUri I am opening the url in default browser.
Send toast notifications from the App, when user clicks on it, I have requirement to open a url instead opening an app. So, did the same, by passing the launch context to foreground app and then opening the url.
Both scenarios, it just opening url in browser. Here user experience is very poor that user seeing the app open for each action and then opening browser. Please throw some ideas if any possibilities.
thanks in advance.
For your second requirement, you can make Toast Notifications launch a URL!
If you're using the Notifications library (the NuGet package that we suggest you use), just set the Launch property to be a URL, and change the ActivationType to Protocol. You can also do this with raw XML, but that's error-prone.
You can also make buttons on the toast launch a URL too, since they also support ActivationType of Protocol.
Show(new ToastContent()
{
Visual = new ToastVisual()
{
BindingGeneric = new ToastBindingGeneric()
{
Children =
{
new AdaptiveText() { Text = "See the news" },
new AdaptiveText() { Text = "Lots of great stories" }
}
}
},
Launch = "http://msn.com",
ActivationType = ToastActivationType.Protocol
});

Apple AirLocation demo App ranging not shows beacons

I have3 Estimote beacons that can be seen with the App store Estimate App.
Now I am trying to run the Apple demo app AirLocation AirLocate
I have changed the UUID in the APLDefaults.m file to the default Estimote UUID _supportedProximityUUIDs = #[[[NSUUID alloc] initWithUUIDString:#"B9407F30-F5F8-466E-AFF9-25556B57FE6D"]];
I have enabled the Region to start startMonitoringForRegion as this stackoverflow says.
But they are not showing up, have you seen this ? Or am I missing some Estimate specific.
Regards
The problem is that AirLocate was written for iOS7, and in iOS8, the permissions model for iBeacons and other location operations has changed. In order to get the program to work on iOS 8 when compiled from XCode 6, you need to add code that requests permission in your AppDelegate. Like this:
if([self.locationManager respondsToSelector:#selector(requestAlwaysAuthorization)]) {
[self.locationManager requestAlwaysAuthorization];
}
This will prompt the user to authorize location operations including beacons. You also need to edit the info.plist for the app, and add a new string key called NSLocationAlwaysUsageDescription with a value like "This app needs access to location services" so the OS can prompt the user for this permission.
After you run your app, you can check in settings to see if this permission has been granted properly.
Another problem I have noticed in iOS 9 is that the calibration sometimes does not work. Seems to be an NSNumber conversion issue. The following edit in APLCalibrationCalculator.m fixed it:-
//measuredPower = [[sample valueForKeyPath:#"#avg.rssi"] integerValue];
measuredPower = [[sample valueForKeyPath:#"#avg.rssi"] intValue];

How can I test the background scan and launch the application in background with iBeacon-Android?

I am using the pro library.
But I just found doc for free library
I cannot find any doc for pro version.
Also, I don't know how to implement the background mode even using the pro sample.
Here are the steps:
Build the pro sample project
start the iBeacon source(using iPad) and it can be detected
start the application and then press home button the make it in
background
Turn off the iBeacon source
Turn on the iBeacon source
However, more than 5 minutes, the application does not launch
So, can anyone verify the step I did?
How can I test the background mode more easily?
Also, for the BootstrapNotifier, is it just work only first time when the device reboot?
After that, even I put application in background, the application will not launch when it detect iBeacon?
Your testing method sounds fine. I think the issue is that the reference app for the pro library only auto launches the app on the first detection after boot. After that, it sends a notification instead, and tapping on that notification launches the app.
This is purely for demonstration purposes. You can change it to auto launch on every detection if you wish. Simply alter the haveDetectedIBeaconsSinceBoot logic in this code:
#Override
public void didEnterRegion(Region arg0) {
// In this example, this class sends a notification to the user whenever an iBeacon
// matching a Region (defined above) are first seen.
Log.d(TAG, "did enter region.");
if (!haveDetectedIBeaconsSinceBoot) {
Log.d(TAG, "auto launching MainActivity");
// The very first time since boot that we detect an iBeacon, we launch the
// MainActivity
Intent intent = new Intent(this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// Important: make sure to add android:launchMode="singleInstance" in the manifest
// to keep multiple copies of this activity from getting created if the user has
// already manually launched the app.
this.startActivity(intent);
haveDetectedIBeaconsSinceBoot = true;
} else {
// If we have already seen iBeacons and launched the MainActivity before, we simply
// send a notification to the user on subsequent detections.
Log.d(TAG, "Sending notification.");
sendNotification();
}
}
The javadoc link was missing from the main documentation page when you posted this question. That is fixed now.

Resources