Can app get approximate location even if current location is off? - xamarin

I'm brainstorming the functionality of a mobile app when "Current Location" is off.
Is it possible to have an idea of where a user is located even if "Current Location" is off?
I'm developing a mobile app whose only purpose is to display the closest Joe's Florida Tacos locations to user's current location. It will have the usual list (closest first) and a map with the markers. The app doesn't have any use outside of Florida.
With "Location Services" ON, the app will opens it will display a list of locations, sorted by distance.
If "Location Services" is OFF, then I would like to find an approximate location. Is this possible? This "approximate location" is a starting point that I can use to display data.

Related

Disabling Windows 10 Game Bar for specific application

In some conditions the Windows 10's game bar opens up with my application (made with Delphi, VCL). Thats not a game and i don't directly use DirectX or OpenGL, but it opens up.
To be specific, when i reduce to tray my app and a popup is opened the Game Bar appears.
I found a numbers of sites with tutorial for totally disable the Windows 10 game bar (like this) but i want to disable for my application only, i don't think users will be happy to have a windows feature silently disabled by my app
Is this possible? I cannot find any documentation about it
You can disable it following this solution :
Press Win+G, click the Gear icon (Settings) and uncheck "Remember this is a game" (https://superuser.com/questions/1086248/windows-10-xbox-dvr-app-thinks-chrome-is-a-game).
Note that if the name of the application is Main.exe, this checkbox is not visible.
If the name of the app is main.exe or anything else, it is visible.
It seems it is stored in the registry : HKEY_CURRENT_USER\System\GameConfigStore\ in the Children and Parents directories.
You can try to find your app using the ExeParentDirectory key.
https://www.reddit.com/r/ffxiv/comments/3fbu0x/win_10_game_bardvr_anyone_having_issues/
I don't know if it applies to an executable where Windows decides it is a game (like Main.exe)

How to tell Transmission app to not show its window every time the system is restarted?

I have set autolaunch for Transmission app.
Every time, the system is restarted, Transmission shows it's window.
Is it possible, to keep it hidden after restart ?
Go to System Preferences from the Apple Menu in the top left part of your screen.
Click on the Account tab (under the System section), click on your account, then Login Items.
This should show you a list of applications under something that says These items will open automatically when you log in:
In the list of applications, there is a hide column on the left with checkboxes next to every application. If you check one of the boxes, the application will be hidden after it starts up every time you log in.
That should do it.

Windows API: Is it possible to know if an icon in system tray is hidden by the user?

I need to know if the user has hidden an icon added by my program to the system tray area.
Is it technically feasible?
UPDATE
My program - yowindow displays the current temperature in the system-tray icon.
I want to spare the server load by not auto-updating the weather for the users who don't see the tray-icon.
No.
And what would you do with this information, even if you had it?
(caveat - I guess you could do a screen-grab, work out where the taskbar is, figure out where the system tray is, "parse" out each icon, then bitmap compare each against your own icon. But really...)
It might be worth your while looking at this related question
Based on first Edit to question
I can see your point. But look at it from the windows API designer's POV. They provided a facility for icons to be created in an "always visible" manner. And every man+dog went ahead and put an icon in there, on the presumption that the user would always want to know about their product (please note, I'm not claiming that you're in this group here).
They've noticed this runaway behavior, and whilst they can't now take away the ability to create these icons, they want to give the user control.
Now we come to the problem. Imagine, for a second, that you're a less than enlightened developer. And if you detect that your icon has been hidden, you pop up a message prompting the user to un-hide your icon. Maybe you do this once per login. Maybe you do it every half an hour. It's just a general level of user annoyance, similar to having 40 icons appear in the tray, when the user doesn't care about most of them
The question is - if you were designing an API to allow developers to discover whether their icon is, in fact, hidden. How do you allow your benign usage, whilst preventing the behavior in the previous paragraph? Spend a few minutes trying to pretend to be a windows API designer, and try to write the necessary function(s) (for the sake of argument, assume the annoying developers aren't willing to implement the IAmEvil interface, or whatever, or would be willing to implement the IOnlyDoGood interface...)
Hopefully, your icon is useful, and users will either a) show your icon, or b) remove your application (if it's not doing what they want/need)
There is no API function for that as far as I know, and there's no good solution to the problem. You could directly after the installation show a message from the tray telling the user that the icon may be hidden. Not that it will help, but it's all you can do. I've seen programs that bug the user by periodically showing that message but this is really NOT a good thing to do.

OS X: Setting at runtime the Application name as it appears in Dock and Menu Bar

I have an app that may get launched with current user's or with root permissions.
In fact, there's the possibility that the app runs twice at the same time - once under the current user and once as root.
I like to inform the user when the app is running under root. Currently, I show this in its window title, but I'd prefer to change the app's name so that it reads "Appname (Root)" where appropriate. That way, the name would appear both in the menu bar and in the Dock with this "root" info, and it would allow the user to tell which of the two app instances in the Dock is the root version.
Does someone know if the app name can be changed by code, i.e. by the app itself, or by its launcher?
If not, my only option appears to be adding a badge to the Dock icon that says "root", but that's my last resort, as it won't work for the menu bar nor for other tools that display the app names (i.e. other app launchers such as DragThing).
…there are at least five application names floating around, at least in concept: (1) the file name the Finder sees, which in the case of an application package is the package (bundle) name; (2) the name of the executable inside the package, (3) the long name used in many places for display purposes only; (4) the short name used as the application menu title and in a few other places where a long name won’t fit for display purposes; and (5) the process name of a running application. They aren’t always the same, especially in Microsoft and Adobe products.
—Bill Cheeseman
From what I can tell, the name in the dock is the name of the application bundle (sans ".app") on the filesystem.
The value under the CFBundleName key in info.plist is what shows up in the menubar.
As far as I know, changing either these at runtime isn't going to work… but what you can do is have two versions of your app, a root and non-root version, inside your user-facing .app bundle. When the user-facing app is launched, it checks if it's running as root or not, and launches the appropriate copy of the real app, which has theCFBundleName and file-name you want.
I wish I knew of a more elegant solution.
That label comes out of your Info.plist and I don't believe it's ever consulted again after it's been launched. If you want to have a parent application that does nothing but launch the real application (possibly from inside its own bundle) after munging its Info.plist, then that might give you the effect you're hoping for. You will get two icons bouncing at launch time, though.
OS X apps do not normally run with multiple instances. Look at any app developed by Apple for example. It would be more common to allow for multiple documents/windows, in this case each window could be either a root or non-root window.
The most common way to allow for root authentication however is to have a padlock icon that can be clicked to switch to root mode with a password prompt, this can be seen in many of the System Preferences panels.

How can I determine why the machine came out of suspend?

I'd like to be able to determine, programmatically, why a Vista system came out of standby (S3). Any language is fine, though a .NET one would be best. I'm looking to put this code into an application that I'm working on.
I'm looking for reasons like "Media center wanted to record a program," "user input woke the machine," "windows update is scheduled to run," things like that. I searched on Google, Bing and MSDN, but I could only find things relevant to Windows Mobile.
Can anyone point me to a function or object that can provide this information?
A top level window gets a WM_POWERBROADCAST message when waking up, but you can only tell if it was automatic (Media center, windows update etc) or the user (Pressing power button etc)

Resources