How to add progress-indicator in status bar - objective-c

I have developed an application for OS X. I am now building a status bar application. This application is related to wireless communication, hence I have to connect to a particular device. It is like the wifi status bar. I would like to have the message : "looking for networks" and then when the network is found it should then display the available networks. How do I obtain this?
I am relatively new to X-code and OS X so please try to be elaborate.
Thank you

Related

React Native Bluetooth background scan

I'm trying to scan devices on IOS when the app is in background mode. I've learned that I have to tell explicitly what service ID I'm looking for. I was trying with 180F which is the battery service but it didn't find anything. Is it possible at all on IOS? It works well on Android.
I'm using the react-native-ble-manager package.
Can you tell me maybe a common service UUID what every phone advertises?
My aim is to track every contact with phones which are nearby me and it should work when the app is in background mode.

How to simulate the status bar in Codename one?

I am currently trying to get a local notification to work on an example app. I was following the simple guide here and just copied its code to see it working:
https://github.com/codenameone/codenameone-demos/blob/master/LocalNotificationTest/src/com/codename1/tests/localnotifications/LocalNotificationTest.java
However, in the simulation, I cannot see any changes in the status bar. Is the status bar even simulated or just a static image? Do I have to build the app and send it to an actual device every time I want to test it? That would not only be tedious but also crunch on the available monthly builds.
Is there a setting in the simulator to activate this that I missed?
Thanks and best regards
Local notifications happen in the background which isn't supported by the simulator so this is something you will only see on the device. You can simulate the minimizing of the app (pause/resume) but the Codename One simulator is not a full mobile OS simulator.

How do I detect that the Windows Mobile transitioned to continuum mode?

Is there a way to detect that Windows Mobile 10 transitioned into continuum mode?
The message-box on Windows Phone does not look anything like the one on Desktop and our designers want parity. I want to write our own version, but I only want it to work on Phone - I want the default one on desktop or when the app transitions to continuum on phone.
Any ideas?
I could not find anything on the web nor find any API that allows me to detect it.
I may be wrong but I don't think there is an API for Continuum. The idea of Continuum for Phone is that you're going from a fixed display size to something that is variable. The best way to detect this would be using the Visual State Triggers or checking if the size of the window has changed.
By also checking that the device family, AnalyticsInfo.VersionInfo.DeviceFamily, is Windows.Mobile, you'll know that you're using a phone device which is currently in the Continuum mode.
To detect if app is running in Continuum mode you'll need to check two things: DeviceFamily and UserInteractionMode.
public static bool IsInContinuum()
{
if (DeviceFamily() == DeviceFamilyType.Mobile && UIViewSettings.GetForCurrentView().UserInteractionMode == UserInteractionMode.Mouse)
return true;
else
return false;
}
Quote from this post:
"With Continuum, “touch” will always be returned when your app is on the mobile device, and “mouse” will always be returned when your app is on the connected display."
So you'll need to check if app runs in Continuum in SizeChanged event.
Due to MSDN Documentation Below,
There's no spesific trigger for Windows 10 Mobile continuum feature detection.
Continuum for Universal Apps
In order to find a solution on Mobile Apps, you can benefit from adaptive UI, you can check the app via screen resolution change Window.Current.SizeChanged, then you can combine with Device family AnalyticsInfo.VersionInfo.DeviceFamily to check if device is in Continuum mode.

Liveview on Android/QX1 Sony Camera API 2.01 fails

Using the supplied Android demo from
https://developer.sony.com/downloads/all/sony-camera-remote-api-beta-sdk/
Connected up to the WIFI connection on a Sony QX1. The sample application finds the camera device and is able to connect to it.
The liveview is not displaying correctly. At most, one frame is shown and the code hits an exception in SimpleLiveViewSlicer.java
if (commonHeader[0] != (byte) 0xFF) {
throw new IOException("Unexpected data format. (Start byte)");
}
Shooting a photo does not seem to work. Zooming does work - lens is moving. Camera is working fine when using the PlayMemories app directly, so no hardware issue.
Hoping from advice from Sony on this one - standard hardware and demo application should work.
Can you provide some details of your setup?
What version of Android SDK are you compiling with?
What IDE and OS are you using?
Have you installed the latest firmware? (http://www.sony.co.uk/support/en/product/ILCE-QX1#SoftwareAndDownloads)
Edit:
We tested the sample code using a QX1 lens and the same setup as you and were able to run the sample code just fine.
One thing to check is whether the liveview is ready to transfer images. To confirm whether the camera is ready to transfer liveview images, the client can check “liveviewStatus” status of “getEvent” API (see API specification for details). Perhaps there is some timing issue due to connection speed that is causing the crash.

Deciding if external display is activated or not

I'd like to be able to decide if the display on the computer where my app is running is currently active or shutdown. I need this for a media center software so I know if I need to activate the display before starting the playback of movies.
So far I tried to use this code:
CGError err0 = CGDisplayNoErr;
CGError err1 = CGDisplayNoErr;
CGDisplayCount dspCount = 0;
err0 = CGGetActiveDisplayList(0, NULL, &dspCount);
CGDisplayCount onlineCount = 0;
err1 = CGGetOnlineDisplayList(0, NULL, &onlineCount);
// Error handling omitted for clarity ;)
NSLog(#"Found %d active and %d online displays", dspCount, onlineCount);
But this code out puts always the same. When I try it on my mac mini, with the display turned off I get the following output:
Found 1 active and 1 online displays
The display is not in a standby mode as I disconnect the power to it when it is not in use. I also tried this on my mac book, which has an internal and an external display. And there it returns:
Found 2 active and 2 online displays
Here it is the same, I deactivate the display and disconnect the power to it but is still returns as beeing active.
The display on the mac mini is a tv-set connected with a dvi to hdmi cable. The display on the mac book is connected with a dvi to vga connector.
I hope somebody has an idea how to solve this. Thanks in advance.
It sounds like you want to know whether any connected display is asleep or not?
Have you looked at the CGDisplayIsAsleep function?
http://developer.apple.com/library/mac/documentation/GraphicsImaging/Reference/Quartz_Services_Ref/Reference/reference.html#//apple_ref/c/func/CGDisplayIsAsleep
To close this open question. My final findings were that as soon as an external monitor is connected to the computer the given methods will return that it is there. And this also works when the monitor is powered of and not connected to the power source.
So as far as I can tell there is no way to find out what I would like to know :(
As I control the event which activates the monitor from my application (in my case its a TV which I control with a usb to ir box) I can get the state of the monitor in this way, but this only has the downside that when the application is crashing, I will lose the state. But thats the best solution I could find.