Using LED with ngcordova barcode scanner - barcode-scanner

When trying to use barcode scanner in bad lighting conditions, it would be very beneficial if possible to light the LED/Flash that comes with the phone/tablet

I have found out that the ZXing library that is used by the ngCordova BarcodeScanner automatically supports this feature (although it is not yet documented). The source code states that if you click the volume up button then the LED/Flash if present will be lit up. Clicking the volume down button will turn off the LED/Flash.
Although I can not be 100% certain, but given the life of ZXing library for CaptureActivity I think that any barcodescanner using it will be able to use this functionality assuming a flash is present.
Hope this helps someone.

Related

Developing a TV application

I have been trying to build a TV application, using an SD.
I have got features like image gallery, video player running,
However, I also wanted to add a virtual on-screen keyboard that works with up-down left-right arrow keys. Can somebody help me with how to get started?
When I wanted to do this with my Vestel (Polaroid Branded) smart TV, which uses "Opera for TV devices" as it's HbbTV browser, I found that I didn't need to.
I simply just used HTML text fields and input types where needed, and as soon as I clicked into them, the browser/OS kernel popped up an onscreen keyboard that was built in for me.
However, I did do some research to see if I needed it, and on some devices you do, whilst I never actually implemented it (My app was just for my own use) the "BBC Television Application Layer" (TAL for short) : https://github.com/bbc/tal had pretty good keyboard support.
Another one that might be worth looking at is "Mautilus SDK" : https://github.com/mautilus/sdk
Be aware though, both are horribly convoluted and use quite complex code where it's really not needed.

Interactive ePub3 issue: Need advice

I have a technical doubt on an ePub3 job and thought of checking with you all and get your understanding and advise on it.
For one of my German client, I have created a ePub 3.0 re-flow with interactivity, we have used all the interactivities to work on pop-ups (Non-linear content) and it works well on iPad iBooks 3.2, as the initial request from client is to work only for iPad.
I understand that a latest Apple spec (iBooksAssetGuide 5.1 Rev 2) now says that “Develop scripts that perform well on both Mac OS and iOS devices: Interactivity on desktop computers requires input from a mouse while interactivity on iOS devices require touch input”. I’m not sure whether there would be any problem while this job goes into the Apple iBooksstore, due to the latest spec.
It would be of great help, if you all please share your idea’s / view to this problem.
Regards,
John.A
Great question. With the latest version of OSX (Mavericks) running iBooks as well, there are a few things that need to be considered when using touch interactivity in ePub3 books. The most important (and relevant here) of these is making sure you are firing mouse events as well as touch events: because they behave differently.
The most robust solution that I have found to date is using JQuery or Quo's "tap" event: as it will fire with both touch and mouse events! However, if your code digs deeper (IE if you you use events like "touchstart", "touchmove", etc.) you will need to use the corresponding mouse events to insure functionality on the desktop.
Tap.js is a great little library for stuff like this: http://alxgbsn.co.uk/2012/03/12/tap-js-a-lightweight-tap-event-javascript-plugin/.
You should also be aware that iBooks for OSX behaves differently for many features (especially when it comes to external media content and dynamic loading of content), so you should never rely on OSX only when testing...
Good luck!

Entering text in Windows 8 in C#/MonoGame app

I'm writing a WinRT game for Windows 8, in C#, using the excellent MonoGame. I've reached the part where the user has achieved a high score and needs to enter their name. This is causing me more pain than I'd anticipated so I thought I'd ask for help.
First of all, is there a simple "enter some text" function that I can call, similar to Guide.BeginShowKeyboardInput in Windows Phone 7, or the ancient InputBox command in VB? I'm using Windows.UI.Popups.MessageDialog for displaying simple dialog messages, but can't find any similar thing for requesting text from the user.
Failing that, is there a way I can easily use a little piece of XAML to present a textbox for the user to use?
If neither of these are possible, I guess I'll have to wire this all up myself... I then would plan to intercept keystrokes and display the required text on screen myself. As I don't have a physical tablet (just the simulator) I'm struggling to start with this. How can I:
Detect whether the device has a physical keyboard, so I know whether or not to display the on screen keyboard?
If there is no physical keyboard, how can I show and hide the on screen keyboard?
Some of these sound like they should be easy to answer, but I've yet to track down answers to any of them.
Many thanks!
Adam.
Hey there is such a way to do this in monogame. There is a new template that allows you to create a XAML + Game game which allows you to use the game class you a used to with the xaml bits as well. These links should get you started. The monogame team rocks.
There are the three game types listed there. You want XAML + Game there is a template for it now if you get the proper version of monogame.
https://github.com/mono/MonoGame/wiki/Windows-8-Project-Types
let me know if you need more help
This is not a cross platform solution but you could use a FlyOut and place the controls for data entry on the window. FlyOut guidelines are here and UI Controls for text input guidelines are here. I have also used MessageDialog in a MonoGame for asking the user simple questions (up to 3 options) or to get a Yes|No response. You can get details of that class here.

Cocos2d - SimpleAudioEngine - Sound is not playing on iPhone

Recently I have a problem with playing my soundeffects using CocosDenshion. The sound is playing on the iPhone Simulator, but not on my own device. I am not sure what I am doing wrong. Off course I checked if my speakers are still working, but they do while using other apps or the iPod Library.
I just use this simple code:
[[SimpleAudioEngine sharedEngine] playEffect:#"button.wav"];
I double checked the name of the file and it indeed is button.wav.
I hope someone can help me out.
I had the same problem recently and I've figured it out.
I' m using Xcode 4.3.2 and there seems to be a bug.
Not all resources you add (drag) to the project are by default added to the target.
When you add a resource, make sure that (apart from checking the copy items into destination checkbox) you also check the add to target checkbox.
You can check if the resources has been added to the bundle by clicking on the target icon. In the Build Phases tab, check if the sound files are included in the Copy Bundle Resources.
If not, add them manually (+add target)
You might try preloading the sound effects, at some earlier point in the program, as otherwise it has to load the sound effect before it can play it. You could create a splashScreen scene that is the first scene and loads all your assets and then transitions to the first "actual" scene.
SimpleAudioEngine *engine = [SimpleAudioEngine sharedEngine];
[engine preloadEffect:#"Example-Sound.caf"];
Not sure whether it is the case here, but you should keep in mind that if your file name is "Button.wav" and you are asking to playEffect:#"button.wav" it will play on simulator, but will not on the device. This effect takes place because filesystem on your desktop is case-insensative, and on iOS devices it is not.
I have the same problem and find here. But I fix it by myself.
If you reinstall ios for ipad. the default switch(upon the volume) is default as "mute volume" method. Maybe I change it to "rotation" method when it is mute. It lead to all cocos2d can't play sound any more. So I turn the method back and set mute off. And then SimpleAudioEngine works well. It is ios system's bug.
Make sure to check your audio file itself. A Mono 16 Bit, Uncompressed wave with a sample rate of 441000 should 'just work'. I recommend grabbing a sample .wav from an online Cocos2D example, like the Cowbell.wav and try to play that file.

Virtual keyboard in Symbian S60 5th edition: Which API to use?

How (i.e. using which API) is the virtual keyboard opened on Symbian S60 5th edition? The documentation seems to lack information about this.
You are right, this should obviously be a published API and it should be highlighted in the documentation. No such luck.
If you are using one of the platform native controls, the virtual keyboard will automatically popup when the user accesses a text-editing control.
If you are making a custom control, you need to deal with its selection by adding your own version of the virtual keyboard: make a new text-editing, window-owning virtual keyboard look-alike custom control with the right buttons. Reuse it accross all your applications. One day, Nokia will realize they have made an obvious mistake and make the API publicly available.
If you are using direct screen access, well, you wouldn't exactly expect the very s60-looking virtual keyboard to popup out of nowwhere. Again, draw a nice image on the screen to let the user know where the virtual keys are and react to pointer events. This is going to be less reusable unless you build a good amount of customization (background, button edges...) into it.
EDIT: Nokia may be relying on Qt to fix this issue. I would expect the control to be part of the current 4.7 version of Qt.
Tinkering with focus on a QLineEdit inside custom coded kinetic scroll area, I've had a simmilar problem (how to open virtual keyboard manually). Then, I found it, this obviously works in Qt 4.6.3 on a C7 Symbian^3 phone:
// lineEdit is an instance of QLineEdit
QApplication::postEvent(lineEdit, new QEvent(QEvent::RequestSoftwareInputPanel));
Before that, I also had to post a QEvent::FocusIn event to that same lineedit, otherwise the QLineEdit did not update the content from virtual keyboard.
Hope this is helpful. I lost hours.
Thank you tihi, very useful tip! There's also the "close virtual keyboard" event that can be triggered:
QApplication::postEvent(lineEdit, new QEvent(QEvent::CloseSoftwareInputPanel));

Resources