w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Bonjour service discovery not complete with Android's APIs. Am I missing something, or should I just use JmDNS?
This is probably dependent on the service implementation that MacBook Pro offers. "I have a Bonjour service running on my MacBook Pro on my local network" - If you are using NSD with WI-FI direct I believe it will not try look for services running in your local network rather it will look for services running in nearby devices via WI-FI direct and no connection. "However, using Wi-Fi Direct Service Discovery allows you to discover the services of nearby devices directly, without being connected to a network". I think this means a separate implementation might be required by your MacBook Pro to help WI-FI direct communication, so that it can respond to discovery requests not in the local network. Sorry I cannot say more than this at the moment.

Categories : Android

Android Device device shows Unknown (?????) in eclipse
You need to add vendor ID to android.rules file. Please follow this link to know about particular vendor id & how to do this. http://developer.android.com/tools/device.html

Categories : Android

How to track the device location (iOS and Android) device using Phonegap
The first thing to say is that creating a Phonegap app that receives location updates while running in the background is entirely possible, but not trivial. I've done it myself and released apps on both the Android and iOS platforms. If you need accurate and regular position updates, I'd suggest using the GPS receiver on the target devices. In Phonegap, you can do this setting the "highAccuracy" flag when requesting position updates. The watchPosition() function will deliver new position information as and when the device receives updates from the GPS receiver, so you use it something like this: navigator.geolocation.watchPosition(successCallback, errorCallback, { enableHighAccuracy: true, timeout: 10000, maximumAge: 0 }); See the Phonegap geolocation API documentation for more d

Categories : Android

How can i Write data from Android device on c2540c device?
Might this solve your problem?

Categories : Android

How can i create new virtual mouse device on my android device?
From what i see you should create your own virtual device with your own driver , Fortunately there is an easy way to do so using uinput There is an easy guide for getting started here , and this question can be a good guide to write your own virtual driver. I thought this can only be done if you have access to kernel , and create your own ( i dont think modifying user rom is a good solution ) , but after reading this , it is clear that Uinput can run in user mode. Note : I agree with recommendition to use touch events ; as this solution is more common and makes sense , check second suggestion is this answer

Categories : Android

How to connect Android device to an iOS device over BLE (Bluetooth Low Energy)
I've written a simple working example, well relatively simple, and included it open-source on Github: https://github.com/GitGarage. So far it has only been tested with an Android Nexus 9 and an iPhone 5s, but I presume it would also work with a Nexus 6 and various iPhone types. So far it is set up explicitly to communicate between one Android and one iPhone, but I presume it is tweakable to do much more.

Categories : Android

What is difference between android device id and device token?
Both are completely different. Secure.ANDROID_ID A 64-bit number (as a hex string) that is randomly generated on the device's first boot and should remain constant for the lifetime of the device. (The value may change if a factory reset is performed on the device.) And GCMRegistrar.register(this.context, CommonUtilities.SENDER_ID); Gives you the registartion id of device from GCM. By which, GCM uniquely identifies the device. Another difference is Secure.ANDROID_ID may change when factory reset is performed on the device. And Registration id gets changes periodically. And if you are asking about CommonUtilities.SENDER_ID then This is your project number, and it will be used later on as the GCM sender ID

Categories : Android

android device does not show up under Android Device Chooser
Make sure you are using the correct android API and SDK version compatible with your device's version in the code. (In the android SDK for eclipse this is in Android Manifest.xml) If the two don't match up, then they won't show up when you try to test it on the device.

Categories : Android

Access one android device to another android device
It is not mandatory. You can also implement this as a server client solution, where the data transfer between the clients takes through the server. If you didn't try it yet, that will be a tedious task for the particular solution. Both side should keep services to monitor and transfer data. But if you intent a real time solution, I'll prefer Bluetooth for faster response.

Categories : Misc

use adb to get the device name of android device
You can get shell access to your Android device via the following command. adb shell The application data is stored in the directory "/data/data/package_of_your_app". // Assume the gesture file exists on your Android device adb pull /sdcard/gestures ~/test // Now copy it back adb push ~/test/gesture /sdcard/gestures2 It will work for you.

Categories : Android

Not showing my mobile device in eclipse but show in Window 8 (portable device part)
Download usb driver for samsung from here : http://developer.samsung.com/android/tools-sdks/Samsung-Andorid-USB-Driver-for-Windows

Categories : Android

iOS Project runs on simulator, physical device, but can't build or archive anymore for "iOS Device"
After this happening a few times, I figured out the issue. When my iPhone is hooked up to my Mac and tethering is on, this problem occurs. When I turn tethering off, or disconnect the phone, I can archive again. Not sure why this, but I hope it helps someone at some point.

Categories : Iphone

how to use the same image of 160ppi and 1280X800 ressolution device in 800X1280 and 214ppi device
1280 x 800 160ppi is MDPI devices 800 x 1280 214PPi us TVDPI devices //you need to supply different density Images like MDPI and HDPI images TVDPI devices will pick from HDPI image and auto scale them //you can also supply different drawable for large and xlarge drawables.

Categories : Android

The method "device.press" or "device.touch" of MonkeyRunner doesn't take effect
You could try to replace 'DOWN_AND_UP' with MonkeyDevice.DOWN_AND_UP. And you could also add some MonkeyRunner.sleep(time_in_seconds) to pause the script between the interactions. To test if the device object was properly created you could use device.wake() which lights up the device's display. If this works, the touch and press methods should work also.

Categories : Android

Trying to retrieve previously paired bluetooth device in IOS app will not respond with failure if device is off
Two points you need to know about retrievePeripherals: and connectPeripheral: 1.) retrievePeripherals: attempts to retrieve the CBPeripheral object associated with the uuid you supply. Even if the ble device is off (or on the other side of the country) retrievePeripherals: will still return an instance of CBPeripheral that you can call connectPeripheral: on. This is done intentionally so that you can issue a call to a peripheral that is not even around and still automatically connect to it when it comes back into range. It basically creates a marker inside the system bluetooth so that when the device is actually seen, it will know it should connect to it. 2.)connectPeripheral: will not time out unless the communication channel is broken with the actual device. If the iOS device has not s

Categories : IOS

why doesn't MPMoviePlayerController play in simulator but not in device if the format is valid for the device?
Solved! I am forcing it playing even if the mute is on, moviePlayer.useApplicationAudioSession = NO; [self presentMoviePlayerViewControllerAnimated:moviePlayer]; that's what itunes store does if the mute is on for the preview songs when you tap it

Categories : Iphone

Sending image (.jpg) byte data to an iOS device from a .NET web service, then on the iOS device, encoding it to its respective file type (.jpg)
Been there, but on the iOS end. What we did to solve this problem was to have the .NET server send the image as a base64 encoded string, just as you said. In the iOS end, the dev must then use a base64 decoding class (there are plenty on the internet, this one for example: http://www.imthi.com/wp-content/uploads/2010/08/base64.zip), transform that into NSData and then create the image with that data. Should look something like this: NSString *b64string = @"string to decode"; NSData *imgData = [DecoderClass decodeBase64FromString:b64String]; UIImage *image = [UIImage imageWithData:imgData]; If the data is correct, it should work. UIImage is a high-level class and should handle image types (jpg, png, etc) automatically, as long as the data is consistent.

Categories : C#

Using the accelerometer in a Windows Phone 8 device to determine if device is not moving
From my point of view, it really depends where do you want to use your app. If it is an outdoor application then as Igrali mentioned using GPS would be a better option. However, if you are still sure that you want to use accelerometer one way that I tried before was save last few results of the accelerometer every time then check them with previous results. if the result was same it means the system is stopped otherwise it is moving. That may not be a good way but it works.

Categories : Windows Phone 8

how to record the voice from bluetooth device mic and play in device speaker
yes above concept is correct and very helpful for me(but there is little bit addition or modification done) but routing to speaker(device-speaker)required new session to create for taking input from Bluetooth we have create session like //// create and set up the audio session AVAudioSession* audioSession = [AVAudioSession sharedInstance]; [audioSession setDelegate:self]; [audioSession setCategory: AVAudioSessionCategoryRecord error: nil]; [audioSession setActive: YES error: nil]; // set up for bluetooth microphone input UInt32 allowBluetoothInput = 1; AudioSessionSetProperty (kAudioSessionProperty_OverrideCategoryEnableBluetoothInput,sizeof (allowBluetoothInput),&allowBluetoothInput); and when ever u want to paly the sound not in bluetoothdevice speaker at that time override

Categories : Iphone

Changing device orientation settings by Device in Rubymotion
You won't be able to do that in your Rakefile, as far as I know. You need to specify that you provide both orientations and then programmatically tell iOS whether an orientation is supported or not. Your UIViewControllers and/or UINavigationController(s) should look like this: def ipad? NSBundle.mainBundle.infoDictionary["UIDeviceFamily"].include?("2") end def shouldAutorotate false # I think? end def supportedInterfaceOrientations if ipad? UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight else UIInterfaceOrientationMaskPortrait end end def preferredInterfaceOrientationForPresentation ipad? ? UIInterfaceOrientationMaskLandscapeLeft : UIInterfaceOrientationMaskPortrait end Haven't tested this code, but I've used similar in th

Categories : IOS

C# detect usb device ClassCode (usb device type)
You can download USB View Source as a starting point. This loops through all USB devices on a PC (C#) and pulls information about each. To get the Class code, Subclass code, and Protocol type fields, you'll need to modify it slightly. Change the below and run it and you'll get the information on each USB device by clicking on the item in the tree view (information will appear in the right panel). Modifications to USB.cs: // Add the following properties to the USBDevice class // Leave everything else as is public byte DeviceClass { get { return DeviceDescriptor.bDeviceClass; } } public byte DeviceSubClass { get { return DeviceDescriptor.bDeviceSubClass; } } public byte DeviceProtocol { get { return DeviceDescriptor.bDeviceProtocol; } } Modifications to fmMain.cs // Add th

Categories : C#

WP7 app, MethodAccessException on WP7 device but works fine on WP8 device
Try this private Uri GetFacebookLoginUrl(string appId, string extendedPermissions) { var fb = FacebookClient(); var parameters = new Dictionary<string, object>(); parameters["client_id"] = appId; parameters["redirect_uri"] = "https://www.facebook.com/connect/login_success.html"; parameters["response_type"] = "token"; parameters["display"] = "touch"; // add the 'scope' only if we have extendedPermissions. if (!string.IsNullOrEmpty(extendedPermissions)) { // A comma-delimited list of permissions parameters["scope"] = extendedPermissions; } return _fb.GetLoginUrl(parameters); } You Need to Give App ExtendedPermissions private const string ExtendedPermission

Categories : C#

What will registering an apple device a developer device do to it?
Yes you can still use it as a regular device. All registering does is enable the Developer section in Settings, allow you to install iOS beta releases, debug builds directly from Xcode, and ad hoc app builds. Also to elaborate on the Developer section in the Settings app, as of iOS 6 and above, that gives you access to the network link conditioner so you can simulate for instance 3G or EDGE speeds when on Wifi. Very useful.

Categories : IOS

Device not Recognize AVD Device on Usb Debugging
I also faced the same problem for a Samsung device.I installed the required Samsung Kies and USB drivers but still it doesn't show in the AVD chooser screen. So I downloaded a driver installer software.After installing that, it showed that a updated version of Samsung Kies is available then I updated it and everything worked fine.You can download that software from here

Categories : Android

How to update the view of an app on ios device b from device a
when the application is open, is there a way for when the admin application to be notified straight away as soon as a sale has been made There are ways. One way is to open a connection to the server and keep it open, so that the server can write to it whenever it has new information to share. Another way is to implement a tiny web server in your app, tell your data server about it, and let the data server connect to it as necessary. If the server and the admin device are expected to be on the same network, you might be able to use Bonjour to make it easy for the server to discover and connect to the admin device. The nice thing about APNS is that it lets you avoid constant use of the network. Whether you keep an open connection to a server or have your app listen for connections

Categories : Objective C

Using GCM for device to device app data sync
you dont necessarily need to use GCM or any messaging service, all gcm is meant to do is notify a device that something has changed on your server and that you need to go get all the new stuff. that being said all you need to do is just have a sync button that the user can manually sync the list from the server to the device and vice versa which would get rid of the need for GCM. if you wanted automatic syncing then GCM or any other messaging service would be what you want

Categories : Android

How to create an event# device for a virtual input device (/dev/input/js3) in linux kernel module?
Here is an example, you can use 1. class_create to create the class specified for the device, 2. device_create to create the device node 3. cdev_init to initialize and 4. cdev_add to add the device to the /dev list For example you can refer the below link :Create a device node in kernel module

Categories : Linux

navigator.connection.type not working even if device is ready *or* device is never ready
You should also wait until all your scripts are loaded. Wrap everything in a onBodyLoad like so: function onBodyLoad() { // these are useful later in the app, might as well set early window.isRipple = (window.tinyHippos != null); window.isPhoneGap = /^file:/{3}[^/]/i.test(window.location.href); window.isIOS = !window.isRipple && navigator.userAgent.match(/(ios|iphone|ipod|ipad)/gi) != null; window.isAndroid = !window.isRipple && navigator.userAgent.match(/(android)/gi) != null; // stuff I use for debugging in chrome if (window.isPhoneGap) { document.addEventListener("deviceready", onDeviceReady, false); } else { onDeviceReady(); } } And add to your body tag: <body onload="onBodyLoad()"> And the rest of my co

Categories : Networking

Why am I getting a runtime error / key error "no device found for" empty device address?
It looks like your BladeRF is only accessible by the root user. To fix this make a udev rule file (I know the write up you followed earlier had you do something similar but bare with me). This will allow your regular user account to access it. You can start in the shell by typing: $ sudo nano /etc/udev/rules.d/15-bladerf This should make a new file and open the nano editor. Here you will place the following: SUBSYSTEM=="usb", SYSFS{idVendor}=="1d50", SYSFS{idProduct}=="6066", MODE="0666" Afterwards, reset the udev rules service by executing: $ sudo /etc/init.d/udev restart NOTE: This commands should work on any Debian-based OS (Debian, Ubuntu, Linux Mint,...) CREDIT: The udev rules were found here http://pastebin.com/Mgb90L1x

Categories : Linux

does the target SDK option in android SDK have to be the same as the test device Android version? (Android SDK basic)
You should set the minimum SDK required to whatever API is required for all code to work correctly. Some API methods are not available until later versions and some have been deprecated in current versions (though the deprecated methods should still work as expected). No devices that I know of require API 1-3. Most devices all have 8 or higher. The target SDK is the code you are targeting when you program so say if new APIs have become available and you are using them in your code then you won't get a compile time error saying the method/class doesn't exist. You should also be aware that if you target a higher API then will be running on the device, you may have run time errors of methods/classes not existing.

Categories : Android

How to get IP address with jmdns lib on Android
Do you find Hostname and Port? If it is,then try to resolve the Hostname to an IP address with InetAddress. If InetAddress.getByName(hostName) don't work, then try with InetAddress.getAllByName(hostName).

Categories : Android

Android - Jmdns getPort()
http://home.heeere.com/tech-androidjmdns.html I think this is the link he/she meant. Also, you will find you can't really use any port under 1024 without superuser permissions (you won't have these unless you've rooted your device). The API probably recognizes any port below 1024, while not a superuser, as 0 and therefore assigning a new port for you. Ports under 1024 are considered "Privileged Ports." Reference: Why are ports below 1024 privileged?

Categories : Android

jmdns.jar not working on android 4.0 or later
My simple guess would be that it's trying to download data on the main thread. This is not possible from Ice Cream Sandwich and forward. Try to look at logcat while it runs on the phone, it should clearly show a warning/error message about it if it's the case.

Categories : Android

Is there a way to see how much ram a android device has?
Is there a way to see how much ram the device has so i can use both resultion and memory to determin what size bitmap to use? The device RAM does not matter. The available memory for your process matters. To find out the memory class of your app, call getMemoryClass() on ActivityManager -- that basically returns the amount of available RAM for your process in MB.

Categories : Android

android application directly login using saved account credential in android device
This is an in-depth look into how you can authenticate based on the users Android credentials, has an example of how things work and how the UI should be try this use some refrence api also available link You can get help from android developer blog link

Categories : Android

Phonegap android project works on emulator and in some devices but not in a 2.2 android device
Thanks to @Raoul George i discovered what was the problem. When you make: var visitedList = JSON.parse(window.localStorage.getItem("visited")); in an android 4 nothing happens, but if you work with an android 2.2 you need to be sure that window.localStorage.getItem("visited") has a value.

Categories : Android

Android JUnit testing while executing OpenCV functionality on PC instead of android device
To separate this two tasks, you need to realize (for example) REST client on android and server on the desktop. Client should connect to server Server pings client and client sends him screenshots. Perhaps, you will need to create separate thread in test. Client should do the following: When you need to take screenshot: Object res = null; res = new File(takeScreenShot(solo)); Then public static String takeScreenShot(Solo _solo) { solo = _solo; String dir = "/sdcard/Robotium-Screenshots/"; String fileName = "screenshot"; java.io.File file = new java.io.File(dir, fileName); if (file.exists()) { file.delete(); } solo.takeScreenshot(fileName); solo.sleep(2000); return "/sdcard/Robotium-Screenshots/" + fileName + ".jpg"; } You need

Categories : Java

Sum a sequence of device-labeled, data using most recent data for device
I am building on my answer to your previous question, where you presented a simpler case. Read there for an explanation of the window functions aspect of the solution: Sum across partitions with window functions This question presents a "counter-cross-tabulated" data-set. To get to where you want to be, you could run a cross tabulation first, reducing the case to its simpler, previous form. PostgreSQL has the additional module tablefunc providing very fast functions for that. Run this command once per database to install: CREATE EXTENSION tablefunc; Then all you need is this (including redundant columns in the result for debugging): SELECT ts, active_power, device_id, should_be , COALESCE(max(a) OVER (PARTITION BY grp_a), 0) + COALESCE(max(b) OVER (PARTITION BY grp_b), 0

Categories : SQL

Wrong build being deployed on Android device using Visual Studio 2012 Xamarin.Android
I have no idea why it does this, I had this issue before. I also noticed that the device log was somewhat behind (ie, at 3.30pm, the last record on the device log was 11.00am). Uninstalling the app from the device and re-deploying it seems to correct it. Note: I had this issue in VS, didn't check with XS. I would look at the difference in your deployment settings in VS and XS (I think it may have something to do with the Fast Deployment option).

Categories : Visual Studio 2012

Android Logcat is empty when debug with device in android studio
As of 0.4.0 I have noticed that the logcat tab does not work in the debugger window - only in the Android DDMS window (hit Alt+6 to bring up the working logcat while debugging). Awkward I know :)

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.