Flashlight implementation within Android SDK - quickblox

By default the flashlight is not employed while video-calling.
Need the flashlight to be turning on automatically once the video call starts till the end.

The flashlight is turned on using the following method:
・cameraManager.setTorchMode(cameraId, true);
・This was done using the steps described in the URL:
https://medium.com/#ssaurel/create-a-torch-flashlight-application-for-android-c0b6951855c
For reference, here is the URL which explains the method described above:
https://developer.android.com/reference/android/hardware/camera/CameraManager#setTorchMode(java.lang.String,boolean)

Related

Minecraft Modding Using Forge: GradleStart is in default package?

My project runs, and I see my mod populating within Minecraft, but for some reason my code doesn't do anything. I followed a basic tutorial that should be adding an item with a texture. I also set some basic method as such within Main to test whether this is working or not:
public void onPlayerTick(TickEvent.PlayerTickEvent tick)
{
System.out.println("testing 123");
}
Upon loading of the world, this doesn't output anything.
Any help?
I think it's working now. I made the dev environment again, this time with a different tutorial from the beginning. The main difference was this tutorial used intellij like me, unlike the other tutorial which used eclipse. Seems to be working because something in the init method printed out something in the format that is expected in the console (meaning it is compiling and using the code properly). So it appears to be working... It seems. I used these tutorials, they were very in depth, would recommend regardless. This is the playlist: https://www.youtube.com/playlist?list=PLxZiPYkNuhkQKH-QlM0C_3-LvjbQA8ZAu

Menu Items are not getting displayed

I implemented WL.OptionsMenu in android environment as specified in Worklight APIs(android/js/mainApp.js). If menu option is clicked, I've given a callback function . Its working fine if the callback resides in the same file. But the implementation of that callback is resided in android/native/common/js/mainApp.js file. Hence, its not showing the menuOptions in android mobile. How to solve this problem?
Edit your question with the contents of mainApp.js
There is no such path, in Worklight, as android/native/common/js/mainApp.js.
Perhaps you mean android/native/assets/www/default/common/js/mainApp.js, but then again, it is exactly the same as android/js/mainApp.js.
The only difference is that android/native/assets/www/default/common/js/mainApp.js is created after you build your application.
There is no reason why it should not work.
Again, edit your question with the contents of mainApp.js and the steps you have taken from creating the project, to running it in your device/emulator.

How to perform apprequest using native dialogs

We are living confusing times were documentation from the past merges with documentation from the present.
I am trying to make an app request, I have FB SDK 3.1 and iOS6.
I am checking code from the address:
https://developers.facebook.com/docs/howtos/send-requests-using-ios-sdk/
I can not make it work, takes my attention the next paragraph:
In your app delegate import the Facebook.h header file and replace the Facebook framework
"FacebookSDK/FacebookSDK.h" import declaration: #import "Facebook.h"
I don't have Facebook class anymore in my libraries.
Facebook class had to be initialized with app id, delegate, etc... I don't know how it is supposed to work now, specialy having FBSession in place.
My question is, how to make a modern apprequest? And... what is with the documentation?
You can only get the requests dialog with the previous API, it's not available for the current one.
Make sure you follow this step from the docs -
The headers can be found here ~Documents/FacebookSDK/FacebookSDK.framework/Versions/A/DeprecatedHeaders. Drag the whole DeprecatedHeaders folder and deselect the ''Copy items into destination group's folder (if needed)'' option to add the headers as a reference.
Add those headers to your project and you'll have access to the Facebook class.

chrome.extension.onMessage is undefined

I have a simple plugin that just does something like this:
chrome.extension.onMessage.addListener(function(msg, _, sendResponse) {
log("Got message from background page: " + msg);
});
unfortunately when my panel is loaded the following error is shown:
TypeError: Cannot call method 'addListener' of undefined
and according to my tests chrome.extension.onMessage is undefined
According to this page http://code.google.com/chrome/extensions/messaging.html I should be able to access this chrome API from my page so it has to be something small that I am missing here...
Please note methods chrome.extension.onRequest and chrome.extension.sendRequest, as originally suggested in this answer, are deprecated as of Chrome 33.
You should use
chrome.extension.onRequest
instead of
chrome.extension.onMessage
And in background page or any other extension scripts:
chrome.tabs.sendRequest
instead of
chrome.tabs.sendMessage
( the documentation is outdated... alert to google team ;) )
Just a side note: the Yandex browser (mostly oriented for Russians) which is also based on Chromium still (as of 11/10/2012, ver. 1.0) has the .*Request methods instead of .*Message. Many thanks to Ciprian Amariei for the tip, it saved me a lot of time!
PS: This should actually be a comment to Ciprian Amariei's answer but unfortunately I can't leave comments yet and I though this information could be very helpful to those who develop extensions for Yandex browser.
Make sure you're using the latest Google Chrome version. Older versions don't have the chrome.extension.onMessage API.

how begin with appcelerator for desktop (and use the API's)

I've a bit experience with qt+ and creating not so complex web pages, but I don't know how begin with titanium...when I run the default app this work...I can change the index.html like a web page...I can include javascript code and jquery too...very nice...but when I try run api functions I don't know how include these...all examples talk about iphone and a app.js file...I'm trying make a desktop app and don't appear any .js...I can create these but don't work
...in the docs I read things like these:
var win = Ti.UI.createWindow(); var view = Ti.UI.createView({backgroundColor:"red"}); win.add(view); win.open();
I don't know where I've put this code...I try put it inside a javascript inside the html (bad practice!) but it don't work...I put it inside a function onload but don't work neither.....there are any "convention" with the names for the files for this work?...I think this is like create a very dynamic web page but I don't know how work with the api....I see the example "kitchen something" but it wasn't so clear to mee...I see a examples like this:
http://mobile.tutsplus.com/tutorials/appcelerator/appcelerator-using-json-to-build-a-twitter-client/
but seems this work different when is an ipod to when it is a desktp app...I create an app.js (like the tuto) and put my code inside it but it never run...I look the source code and only need create a .js and inside my "home.html" link it..but it don't work...I create a index.js too but it don't work neither
please help..I'm very noob...thanks
Aaron:
This reply kindly brought something that could have been a solution but just made me lose more than 15 minutes of my time, as these first online courses have info about how to create a new project with a default html file, not about the original poster's issue.
The original poster's issue is that he has a new project with an index.html file, but no app.js file.
And he then doesn't understand where he could put the sampe code :
var win = Ti.UI.createWindow();
var view = Ti.UI.createView({backgroundColor:"red"});
win.add(view);
win.open();
... as whatever he puts in app.js is not executed.
The documentation in Titanium Dev Center fails to provide accurate information as it only mentions Titanium Mobile app.js and does not speak of index.html in the application structure.
After some starting experience on Titanium Mobile, I had to work on Titanium Desktop andactually just had the same problem as angel_ang, which brought me here.
So, here is the real answer :
Titanium Desktop applications do not need or start with an app.js file, but with index.html.
Deleting or removing this file never works as it will still be launched from the last build if need be.
Adding anything to app.js will never run as only index.html is run as a starting place.
Something that should have been a solution was found that to the following link:
http://www.youtube.com/watch?v=lgGVNB2nkKc&NR=1
This video is two online courses further from the link supplied by Aaron. At 0.19 seconds exactly, we see the starting code he has added to index.html.
You need to put a ... in your HEAD section, and add a function() there.
You may put the sample code inside this function.
Then you may even set the function to run when you click a button ().
Unfortunately, this doesn't work with me either.
I tried with the example code above but also with the other example (notification) mentioned in the online course.
It just seems that something is deprecated here and many documentations are outdated.
Anyone that could answer to this situation would be very helpful to us and many newcomers.
We just have an index.html that we can't use, instead of a running app.js file.