Fire doesn't see any Android devices

Hmm. I wonder if there’s a hook somewhere where we can detect when an Android device is inserted or removed? I notice that Android Device Monitor is able to automatically notify itself when I start the emulator, although I suppose it could just be polling. If there is some kind of notification service, though, you could just be registered for that whenever Fire is running, and when a new “emulator-XXXX” device pops up, the notification could telnet into it and find out the AVD name. This way, all you’d have to do would be to start the emulator, and let the ADB notification take care of the rest. That would be robust as well, because it’d let you handle cases where the user started the emulator manually while Fire was running.

Thats what I do. But thats not really the problem here — the emulator tells me actively when its booted up, it just seems it’s being a second to premature ;*(

Yeah I do handle that (via polling; I refresh adb devices every 30 seconds, and after the user opens the CrossBox menu). I detect and match up booted emulators with configured emulators now, via the socket API — both on Fire launch, and if they pop up later).

Gonna do a new build for you now. ETA ~1h, depending on download and upload speeds (need to grab a new compiler build, build Fire for you, and upload, and the network speed usually goes downhill here on the :desert_island: in the afternoon ;P.

Thats what I do. But thats not really the problem here — the emulator tells me actively when its booted up, it just seems it’s being a second to premature ;*(

It seems to me like the emulator launching and the device being attached are two separate events. It makes sense; presumably, the Android OS has some role in communicating with the computer that this is an Android phone and not just some random USB device, and emulator just starts the emulated hardware—you still need to boot the OS at that point.

Probably the best thing to do is just to poll adb devices until the device appears, since that’s the notification we’re actually waiting for.

Good idea. after I know the port, I can just keep checking adb devices until it shows. Will add that tomorrow, instead of the 1s delay. (fwiw, it does look booted, when i get the message).

Up now.

It doesn’t seem to be coming up for me yet—clicked both Your Downloads and Your Betas and don’t see it there for either (if I dig around a bit, I can find this link, but it appears to be broken). Does it take a while for this to go through the system?

you’ll want the Personal Downloads.

Thanks, armed with that tip I found the page via Google. Is it linked from anywhere on the main page, though? I spent a bunch of time poking around, and couldn’t find it. It’s odd, since I don’t remember having this problem last time, so maybe I’m just having a brainfart here (or the site design changed since last time).

EDIT: NM, now I see that there was a link to it in your post from December earlier in this thread. Sorry for the noise.

Anyway: it works! I did get the “device offline” message the first time, so apparently 1 second isn’t always long enough to wait, but that’s an issue that will probably go away once the polling solution is implemented.

1 Like

it’s the second link on Login | Portal | RemObjects Software, after Product Downloads :stuck_out_tongue_winking_eye:

Done, along with some other streamlining. I’m doing a new build now and will upload it to you in a bit.

—marc

Up, 2266B

it’s the second link on https://secure.remobjects.com/portal/2, after Product Downloads :stuck_out_tongue_winking_eye:

I don’t see either that or Product Downloads on that page, unless I’m missing something:

Hmm, curious. Looks like that link doesn’t show if you don’t own any products. My apologies, I was not aware of that (or had forgotten it since that page was created 10+ tears ago ;), and no-one else ever complained. Will fix!

—marc

New build seems to be working pretty well. I’ve basically just run a few Hello World apps through it, but it seems to launch the emulator and debug the app without issue, at least so far.

1 Like

Cool. the other workflows work fine too? detecting an already booted emulator on Fire (re)start, detecting one that gets quit, etc?

It seems to work, with a few caveats:

Sometimes Fire loses track of an emulator when its state changes. For example: The last time I used the project, the emulator was running, but now I launch it when the emulator is closed. It does not realize the “not running” emulator is the same as the “running” emulator, so I have to go set it again in the pop-up menu. Going from not running to running has caused this effect on occasion as well.

If the emulator is already running when I hit “Run”, it doesn’t get brought to the front. The app runs on the emulator behind the IDE window where it cannot be seen.

Not directly related, but kind of a big problem for me: The IDE’s text editor doesn’t seem to support NSTextInputClient, the result being that any custom text shortcuts that I’ve set up in the Cocoa text input system don’t work, and furthermore many of the standard built-in shortcuts are not functional (most noticeably the Emacs shortcuts: ⌃A to go to the beginning of a line, ⌃E to go to the end of a line, etc., which I rely on heavily).

Thanks. Not sure I’m completely understanding the exact steps (on first read, it sounds like Jose scenarios should be covered), but I will follow up tomorrow for more details.

As for bringing an already run big emulator to the front — not sure if there’s a feasible API for that, but I’ll do some exploring.

I’ll also have a look at NSTextInputClient, and see if I can add more ctrl- shortcuts (although there are other Mac-standard shortcuts for the ones you mentioned that Fire does support). Can you send me a more complete list of which ones you’d find useful/necessary?

Thanks. Not sure I’m completely understanding the exact steps (on first read, it sounds like Jose scenarios should be covered), but I will follow up tomorrow for more details.

  1. Open Fire.app project with emulator running

  2. Compile and run project

  3. Quit Fire

  4. Quit emulator

  5. Start Fire without emulator running

  6. Open your project

  7. Try to run—it doesn’t work, because the device is set to the running emulator, not the not-running one, and you have to switch it.

All that should be needed is to send the appropriate Apple Event to the emulator app. You should be able to do that with NSRunningApplication’s -activateWithOptions:. AppleScript should be able to do it as well.

I’ll also have a look at NSTextInputClient, and see if I can add more ctrl- shortcuts (although there are other Mac-standard shortcuts for the ones you mentioned that Fire does support). Can you send me a more complete list of which ones you’d find useful/necessary?

Supporting NSTextInputClient would be the most ideal thing, because the Cocoa text input system is wonderfully extensible (although hardly anyone seems to know about this), and you can customize it in a lot of ways. Anything that supports NSTextInputClient automatically gets all that goodness for free. I highly, highly recommend supporting NSTextInputClient.

However, if you can’t support NSTextInputClient for whatever reason, the default set of shortcuts (pre-user customization), as of the version of macOS you’re running, is stored at /System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict.

1 Like

curious. i don’t see how that can happen (but i’m it at the mac, to try now, will try and repro in the am). what value is in the .user file as device id? emulator-PORT, not emulator-NAME?

Not sure. I’ll try to see if I can get a video of it tonight—can’t do it right now, as I’m away from home at the moment.

1 Like