My app needs to be connected to a mini printer in bluetooth way. When I work with html I only need hide elements and call some print function in the browser. How can I achieve this in nativescript?
Related
I have a phone and a simple site providing a list of numbers and names.
Is it possible to pair my phone with browsers via Bluetooth and pass an incoming number to the site in order to show the name of the caller? If the number isn't listed you have to fill it. So, I want to type using the Desktop browser and receive a call using a phone.
I'm using a web platform to store my client base. I tend to keep it on the web without coding Desktop API.
Typically, when you have something like a Bluetooth headset, the headset is a peripheral.
central -> peripheral
-----------------------
headset model | phone -> headset
desktop model (A) | phone -> browser
desktop model (B) | browser -> phone
(A) is currently impossible with Web Bluetooth because, as of now, Web Bluetooth only supports using the web browser as a central, not a peripheral.
(B) may be possible, but it really depends on the mobile OS. You would have to introduce special app to replace or augment the phone app on the mobile device so that it would act as a peripheral.
Experimenting with the Airconsole platform and I've created a simple placeholder screen and controller. The /screen.html and /controller.html files display fine on my browser at myIPAddress:3000.
I can also access them on a mobile device connected to the same network at myIPAddress:3000.
When I attempt to use the Airconsole Simulator, with myIP (ie http://www.airconsole.com/simulator/#http://myIP:3000/), the controllers connect and display my placeholder content. The screen continues to show the Loading... screen indefinitely.
Same thing happens using the local test - http://www.airconsole.com/?http=1#http://myIP:3000/. I open that URL in my browser, then open the Airconsole mobile app and enter the game code. It detects a connection and my phone displays the placeholder. The screen continues showing the Loading... icon.
Both pages have the airconsole.js file included.
Has anyone encountered this? If so, how were you able to resolve it? Any tips for debugging it for more info is also welcomed.
You have to instantiate the AirConsole object like:
var airconsole = new AirConsole();
This internally calls the parent frame, which then removes the loading frame etc. and the screen.html is displayed. Or in other words, AirConsole knows you want to start showing your game.
Note: also until then, no communication with the loading device works either.
I am developing a DayDream app and working with a Pixel XL and real DayDream Controller (on a MacBook Pro). I would really like to be able to test with the DayDream Controller when running the app from Unity Editor. Currently, I am forced to make a build for every little change and its killing me (slow).
I believe that I can do this by connecting my Pixel XL via USB cable to my Mac and then using adb to configure it. But, all attempts have failed so far.
I don't know about real Daydream Controller, but you can try using your phone as DayDream Controller Emulator.
As it said here, you should download emulator APK from here, install it and run on phone connected to WiFi.
In your Unity project find GvrControllerMain and change Emulator Connection Mode to Wi-Fi. Also find Assets/GoogleVR/Scripts/Controller/Internal/Emulator/EmulatorConfig.cs and change line to IP address displayed on daydream controller emulator app on phone.
// IP address of the phone, when connected to the PC via WiFi.
public static readonly string WIFI_SERVER_IP = "192.168.0.78";//"192.168.43.1";
Click "Play" in Unity, it should work.
In addition to diesersamat's answer, I would like to add two things:
You could run the controller emulator via USB by choosing "USB" from the Emulator Connection property of the GvrController script that is attached to the GvrControllerMain component. For the USB connection to be made, you have to make sure that %AndroidSDKHome%/platform-tools is added to your PATH variable.
You could use the real controller via Emulator: Open the Controller Emulator app --> open the Emulator's overflow menu --> select Switch to Real Controller. For this to work, the phone that runs the emulator has to be Daydream ready. I usually use the same phone that I use for Daydream VR as a controller emulator.
At Google I/O 2017, the Daydream team announced instant-preview which supports a "headless" controller-only mode.
The repo is on github: https://github.com/googlevr/gvr-instant-preview
The moment in the Daydream keynote where it is mentioned is here: https://youtu.be/tto90e-DfeM?t=26m45s
I had the same problem trying to get the emulator to work. The solution for me was to set up the player settings to android and click the VR supported tab with the daydream SDK selected in the VR SDKs dropdown BEFORE importing any daydream/google VR packages.
Took a lot of trial and error for me to figure that out. Hope that helps.
I want to create a wear application that has 2 mode : the connected mode and the disconnected mode. The first mode is used when the watch is connected to the bluetooth : you can control a media player and have the basic controls on what's being played on the phone.
The second mode is used when the mobile is not paired to the watch : you can listen to content on the watch with a bluetooth headset.
My question is the following : on the connected mode, I created my own interface with the basic controls (play/pause/next/previous) and I can synchronize the controls with the phone sending messages via the message api.
Is there a better way to do? Like using the Notifications?
If you want to have the basic media controls on your wear device (controlling then playback of your media app on your phone), then you can use the MediaSessionCompat to handle that for you; take a look at the UniversalMusicPlayer for example; basically if your media app is using the MediaSessionCompat (or MediaSession if you are not concerned with earlier versions of Android), then the basic controls should appear on your watch and if you implement MediSessionComapt.Callback in your media app, framework will send the control commands to your app from your watch.
i am attempting to print labels from our custom CMS for products using EPL2 label printer drivers but having no luck.
the printer spits out about 12 labels (4x1") but no text is visible.
i set up the printer manually and using the CUPS admin interface and get the same results each time.
zebra doesn't make a native driver, but i am finding on the web that this driver should work.
any advice would be much appreciated.
thanks.
What kind of data are you sending to the device? If you're just doing a File->Print of the web page it should work with the OS drivers, no need to go into the CUPS interface. If you're writing to the spool folder you should be sending raw EPL code - look for the EPL Programming Guide # Zebra.com
Make sure you setup the device correctly as well.
http://www.nrgsoft.com/blog/?p=11
what ended up working was doing a factory reset and using #page along with paper size settings to print in the correct dimensions.
the only printer i could get to actually work the way it was supposed to was Chrome.