w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
System.IO.IOException: A device attached to the system is not functioning C# .NET 4.0
I had many problems with SerialPort class in .NET 3.5 used on USB device and thus stopped using it (it sometimes crashed the whole APP through some different thread - uncatchable exception). From what I know, they have atleast fixed this problem in .NET 4.0, but: Try creating new SerialPort class + surround the Close() with try...catch. This is part of real code (notice the restarting attempts): (ComStream is my own middle class that can internally use three methods to access COM Ports: SerialPort, FileStreams or pure P/Invoke). protected void TxLoop() { #if DEBUG DBG.Line("COM{0} TxLoop started", port); #endif bool inacc = false; while(!IsDisposed) { try { if(com == null) { connected = TriState.No; PopAll(0);

Categories : C#

JCIFS jcifs.smb.SmbException: A device attached to the system is not functioning
Possibly found the solution: It looks as if you can only open 16384 files via new SmbFile() per session. You have to call the SmbFileInputStream.close() which calls the package private SmbFile.close() which seems to send a SmbComClose message to the server which closes the request and releases the resource.

Categories : Java

Attached images only available on iOS simulator but not when tested on device
It appears that you haven't moved the image into your project. You're only pointing to the image's location on your Mac. The device (iphone, ipad) will not have access to your local assets. Make sure that Copy items into destination group's folder is checked when you try to transfer/add files to your project.

Categories : Iphone

Continuous read of USB attached device using JavaScript?
I doubt you would be able to get information from hardware using a browser without using a java applet or something similar. You could write a web interface that communicates with a process running on the machine, but you would not be able to access the hardware directly through the browser. For more information regarding the protections surrounding browsers, look here: http://www.australianscience.com.au/research/google/35779.pdf My suggestion: If you have a windows application but you want to run the interface in the browser, do something like VLC (http://www.howtogeek.com/117261/how-to-activate-vlcs-web-interface-control-vlc-from-a-browser-use-any-smartphone-as-a-remote/)

Categories : Javascript

How do I get attached portable device like Iphone in java desktop application?
If you are using Netbeans Then See the Following Link. May be this will Help you Including Native Library in Netbeans

Categories : Java

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

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

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

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

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

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

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 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 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

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

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#

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#

insert images to the device's cache - iOS
Hi you need UIImageView+AFNetworking.h category download and use AFNetworking u are sorted use its - (void)setImageWithURL:(NSURL *)url method works like charm

Categories : Iphone

using iptables on non rooted android device using system signed app
I think it's impossible to do that on a non rooted device because iptables requires root permission. In rooted devices, you should use some apps like SuperUser to grant root permission if an app wants to run iptables.

Categories : Android

Power off Android device with system signed application
If you want the device to reboot (power off and on), then try PowerManager.reboot() PowerManager powerManager = (PowerManager)getSystemService(Context.POWER_SERVICE); powerManager.reboot(null); android.os.PowerManager: /** * Reboot the device. Will not return if the reboot is successful. * <p> * Requires the {@link android.Manifest.permission#REBOOT} permission. * </p> * * @param reason code to pass to the kernel (e.g., "recovery") to * request special boot modes, or null. */ public void reboot(String reason) { try { mService.reboot(false, reason, true); } catch (RemoteException e) { } } UPDATE If you want the device to completely turn off, use PowerManagerService.shutdown(): IPowerManager powerManager = IPowerManager.Stub.asIn

Categories : Android

ListView with footer attached, smoothScrollToPosition not functioning correctly
My solution: I changed the second line of my backToTop method: lv.smoothScrollToPosition(0); to: lv.setSelected(0); This seems to give the correct behaviour for all my buttons at any position that the user has placed their screen. Using setSelected does not seem to have the side-effect that I was expecting of automatically triggering the click-event. Hooray!

Categories : Android

How to Insert Event in Windows Phone 8 Device Calendar
There is a launcher task for that, it's called the SaveAppointmentTask You can find a small code snippet on the MSDN page here...

Categories : Windows Phone 8

Advice on how to catch "attempt to insert nil object" from a device needed
assume that you fetch data using JSON from server, some times a field in the JSON data is null,so you may get NSNull after coversion. so my advice is checking "null" situation in server, if it occurs, return the faild msg ,but not deliver the bad format data to APP. when APP receive such those data, APP won't know how to handle it. it's already abnormal. it's okay that you can catch the exception and ignore the abnormal data, but my way to do is to prevent it happens from the source.

Categories : IOS

How to remove iPhoto auto open when device connects with USB?
Open the iPhoto application go to the preference -- > General -- Connecting Camera Opens (combo box) change option iPhoto to No Application . Reconnect USB cable now the problem would be solved.

Categories : Osx

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

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

Why input_register_device() blocks whole system when called in .disconnect callback of other input device in the same module?
If you read the source code in drivers/input/input.c, you see that the disconnect callback is being invoked from input_unregister_device() and that the global input_mutex lock is taken before doing so. Similarly, input_register_device() also needs to acquire that same mutex before attaching handlers to the device. This means that if you try to invoke input_unregister_device() or input_register_device() from your callback function, you will end up trying to acquire the mutex while already holding it, and end up with deadlock. One solution, if you really need to call unijoy_inph_refresh() from the disconnect callback, could be to schedule it to run later, using a work_struct.

Categories : Linux

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

How to remove space between ul and wrapping element with border on a mobile device?
Remove the float and width from the .wrap and ul. The border will on .wrap will collapse, which you can either solve with a clearfix, or by adding overflow:auto. Here is my working CSS: body { text-align: center; background: #000; } .wrap { margin: 0px auto; border: 1px solid #fff; overflow:auto; } .wrap ul { list-style: none; margin: 0px; padding: 0px; } .wrap ul li { display: list-item; float: left; margin: 0px; padding: 0px; width: 25%; } .wrap ul li a { display: block; border: 1px solid #fff; } .wrap il li a span { width: 100%; height: 100%; float: left; display: block; } A working fiddle, at least on iOS: http://jsfiddle.net/designingsean/BaWC8/7/

Categories : CSS

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

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



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