Is it possible to develop Google TV apps using a Mac and an actual Google TV device? - emulation

I don't want to use Linux to use the emulator. Is it possible to use an actual device instead?
If possible, please, show me the references you used to answer.

Yes, you can. But instead of using the traditional USB method, you must debug over IP (this means that both your computer and the Google TV must be on the same network)
To start with, we will assume you have a Google TV and a Workstation [your Mac]
On your Google TV, open Settings, and go to Applications -> Development.
Turn Remote debugging on
Click Debugger IP address and enter the IP of your Workstation (if you have DHCP enabled on your router, you will need to look this up)
Find the IP address of your Google TV [it's available in Settings -> Network -> Status]
On your Workstation, run:
adb connect <Google TV IP Address>
If you got everything right, you will now be able to debug on Google TV just like any other device...
Caveats...
If you for some reason want to disconnect later, run: adb disconnect <Google TV IP Address>
If the IP of your Workstation ever changes, you will need to update this on the Google TV [step 3 above]
Source: Google TV developer guide here

http://mobile.tutsplus.com/tutorials/android/android-futures-creating-android-apps-for-google-tv/
Yes it is very much possible to use a device instead, please read the aforementioned link more specifically the section on testing:
Testing Your Application
As there is no emulator yet available with a true Google TV Android
image, we can only test the effects of the higher screen resolution
and using the application with a touch screen.
The easiest way to do this is to create a new AVD using Android 3.1,
API Level 12, use a resolution of 1920×1080 (or 1280×720), and use a
touch screen setting of false. The performance of the emulators may
make this difficult, but at least you can get an idea of what the
screen will look like and how the navigation or your application will
function without touch.

The only option now is having a Goole TV device and setting it up for debugging mode,
Also there is currently a topic in the Google TV issues asking for the Mac OS emulator.
You can star the issue to receive updates about it and also help to request this feature.

Related

Why does Samsung camera app not work without Bluetooth permission?

Since the latest update (I think some time in December 2022), the built-in camera app on my Samsung Galaxy S21 asks for "Nearby devices" permission, and refuses to run if I don't grant it. By "Nearby devices" it means "Bluetooth". I don't know why it calls the permission
"Nearby devices": all other references to Bluetooth call it "Bluetooth",
and you can also access a nearby device using Wi-Fi or even NFC if the device
is close enough.
It doesn't actually need Bluetooth to take photographs, or even to record movies,
but you might have a Bluetooth microphone (I don't) and you might want to use
it to get better sound quality when recording a movie.
Of course the Android best practice advice at
https://developer.android.com/guide/topics/permissions/overview
is not to ask for runtime permissions unless and until you need them,
but Samsung aren't doing that.
I don't want the camera app to announce my presence by probing the Bluetooth headset of
anyone who happens to be near me, and they might regard such an action as intrusive.
So I don't want to give the camera app its nearby devices permission, but it won't
run at all without it.
So how do I get the camera app to run without accessing Bluetooth?
I found some workarounds for this. If your device supports it, you can download Expert Raw from the Galaxy Store. This will take still photos without requiring "Nearby devices" permission. However it doesn't seem to be able to do selfies because there seems to be no way to switch cameras, and it can't do movies or many of the extra tricks that the full camera app can do.
Another option is to run the camera app with Bluetooth disabled. Then it can have its "Nearby devices" permission, but it can't use it. The problem with this is that if you use Bluetooth at other times you have to remember to disable it and enable it.
So I wrote a tiny app which disables Bluetooth, runs the camera app, and restores the previous enabled or disabled state of Bluetooth when the camera app exits. I put this on my home screen instead of the camera app: it has the same icon. You have to remember to exit properly from the camera app using the Back button: the Home or Recents buttons leave my app and the camera app sitting on the task's back stack, so my app doesn't get to run and restore the Bluetooth state.
The app is available on github here in case anyone else wants to use this solution.

Wi-Fi Debug (ADB) - There was an error pairing the device

When I first update to new version of studio I tried to use this new WiFi debug feature and it was working at first time (using QR code or manually typing the code) but now it's stuck with "Connecting to device. This takes up to 2 minutes." message for some time and then I get "There was an error pairing the device" message. Before it would take a couple of seconds to connect. My device is Samsung S10 (12 Android)
EDIT 2: Take a look at the below answers, the actual reason seems to be that the device is assigned a random IP or a MAC via DHCP, if you can disable that via system settings for your specific custom ROM, then it's even better
EDIT: If you see regular disconnections, click on `Pair Device with Pairing Code`, and then pair your device with the following command
adb pair <ip-addr>:<port> <pairing_code>
I was facing the same issue, what I did was switching to the command line way of connecting with the device. You can do so in the following way
Make sure USB Debugging is enabled on the device you intend to connect with
In your device, go to Developer Settings>Wireless Debugging and you will see something like so
Now carefully look at the IP ADDRESS AND PORT section and type the following in the terminal
adb connect <ip-addr>:<port>
And your computer will show under paired devices like the above screenshot
I was able to resolve the issue from within Wi-Fi settings by disabling the Randomized MAC Address feature under Privacy. Using my device's actual MAC address fixes the issue.
I had the same problem but I managed to find the solution.
You have to follow the following steps:
In your smartphone (Go to Settings->Developer options-> Wireless Debugging->Pair device with pairing code).
Copy the ipaddress & port.
For example: 192.168.1.2:42123
and wifi pairing code: 234321.
Open your terminal and go to the following path:
cd %LOCALAPPDATA%/Android/sdk/platform-tools
Paste the following command following this order:
adb pair (ipaddress & port that you saw when you clicked on "Pair device with pairing code")
abd pair 192.168.1.2:42123
Paste the access code to the wifi connection.
Enter pairing code: 41107.
Finally, on the same screen go to the option that says IP address and port and you
will see the same address but with another port (You can find it in this part of your screen), copy it and write the following
command:
adb connect 192.168.1.2:41107
If you see a message like this "connected to 192.168.1.2:41107", you did it you will be able to connect your phone with android studio without any problem.
I fixed it by manually assigning IP addresses for my smartphone and PC at settings of the router. Basically avoiding DHCP.
Restarted the router.
Cleared old pairing.
Started pairing again and now it works fine all the time, and no need to repeat pairing process, just enabling "Wireless debugging" from notification panel and in couple of seconds the device will be available in Android Studio
So next time just enable "Wireless debugging" and it's ready
I don't know why there the issue with dynamic IPs
This worked for me:
Tools --> Troubleshoot Device Connections
Press Next --> Next
Click 'Restart ADB server'
Freshly turn ON Wireless Debugging on device and wait for few seconds.
Note that for me pairing wouldn't work while I was on my VPN. After I paired while off the VPN, I could adb connect ipaddress:port and it worked.

How to get into and add features into a cheap Bluetooth smartwatch that I bought?

I bought a cheap bluetooth smartwatch that costed like $20.
When I plug it into my computer, I cannot see the device listed. I cannot think of any other way to access the source code.
The reason I am trying to get at the source code is to add a few of my own watch faces and try to create my own features.
Any help?
I guess under "plug in" you meant you've plugged it in the USB charging port. Most probably communications are disabled there by a default and the port is in charging only mode.
Try to pair it with your laptop via Bluetooth first, then try to access your watches as a bluetooth device (there is an option for the file transfer, for example, for windows see here: https://support.microsoft.com/en-us/help/4026874/windows-10-share-files-over-bluetooth).

Windows 8.1 Bluetooth searching issue

I have a windows 8.1 based lap top which supports Bluetooth.
I wrote a java based bluetooth server which gets connections from Android.
The issue is, the device sometimes get invisible(or to say not shown) on android devices.
I've tried with other laptops or Android phones, but sometimes it just doesn't get searched.
I think it's not about my java server program. Even if there's a problem with my program, it should at least be shown on the bluetooth search list of other devices.
I found a very crude solution about this issue.
Always running the 'change pc settings(not the exact name)' app of windows 8.1, and going to 'PC, devices' -> Bluetooth makes it always searchable. If I turn this off(I mean the 'change pc settings' app, not turning off bluetooth), the bluetooth cannot be found by other devices.
Why is this happening? My purpose is, bluetooth server must be turned on automatically after boot, but the reliability of the bluetooth device is failing my intention. However, since my crude solution above is temporarily solving my issue, I do not think it's a hardware issue.
So, my question is :
1) Why is this happening? And how can I mend this?
2) How can I run windows metro app through windows shell? If I can't find any other solution about this, I will have to write a batch script to always run the solution thing above.
Going to Change PC Settings>PC and devices>Bluetooth is initiating a Bluetooth device search. As a side effect, the Bluetooth is also made Discoverable (pairing mode). However, this Discoverable setting is temporary, only while the PC is searching for remote Bluetooth devices.
If you wish to keep Bluetooth Discoverable at all times, you need to check the "Allow Bluetooth devices to find this PC" button box, found in Bluetooth Settings. I found Bluetooth settings by right clicking the Bluetooth system icon. Can also be found in Devices and Printers, by right clicking the Bluetooth adapter icon.

iOS BLE - How to keep app active in the background?

I am trying to find a clever way to keep a BLE app active in the background on iOS 6, without breaking any of Apple's rules. I plan to use the phone as a peripheral device and another BLE circuit as the central. My app will automatically be opened when a user arrives to a building using geofencing. After that the iPhone will connect to the first BLE central device it sees (the device will be in its white list). The user will then be able to move throughout the building switching to different BLE "nodes".
My question is: What do I need to do in the background when a user is stationary at their desk so that the app does not get suspended due to memory resources?
My idea is based on this solution for a separate problem: There could potentially (not regularly) be 10-50 users in an area with only a few BLE "nodes" and I read at bluetooth.org that I could setup a dynamic connection system, basically rotating connections through all the users.
My idea is to setup a similar dynamic system where the central device (not the iPhone) disconnects the device on regular intervals (30-40 minutes) and then the iPhone will reconnect.
Is this something that some feasible? Is this against the iOS development guidelines? I was unable to find anything explicit about this. I have also asked on the iOS developer forum, but unfortunately it is not as popular as this site.
Thanks in advance!
Xcode -> Project target -> Capabilities -> Enable background mode
Check Uses Bluetooth LE Accessories
Capabilities
Also enable the following key in .plist file
Required background modes
App communicates using CoreBluetooth
Plist

Resources