device

Detecting rotation to landscape manually

。_饼干妹妹 提交于 2019-11-27 01:40:41
问题 I am working on an iPhone application based on UITabBarController and UIViewControllers for each page. The app needs to run in portrait mode only, so every view controller + app delegate goes with this line of code: - (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } There is one view controller where I would like to pop up a UIImageView when the iPhone is rotaed to landscapeleft. The

android BluetoothDevice.getName() return null

别来无恙 提交于 2019-11-27 01:37:57
On sometime, BluetoothDevice.getName() return null. How can i fix it? remoteDeviceName maybe null in following code. And i need distinguish my device and other devices by remoteDeviceName. BluetoothAdapter.getDefaultAdapter().startLeScan(new LeScanCallback() { @Override public void onLeScan(final BluetoothDevice device, final int rssi, byte[] scanRecord) { String remoteDeviceName = device.getName(); Log.d("Scanning", "scan device " + remoteDeviceName); }); Finally, i found out the solution: 1.For device connected: Read device name from gatt characteristic org.bluetooth.characteristic.gap

Simulate a faulty block device with read errors?

跟風遠走 提交于 2019-11-27 01:22:53
问题 I'm looking for an easier way to test my application against faulty block devices that generate i/o read errors when certain blocks are read. Trying to use a physical hard drive with known bad blocks is a pain and I would like to find a software solution if one exists. I did find the Linux Disk Failure Simulation Driver which allows creating an interface that can be configured to generate errors when certain ranges of blocks are read, but it is for the 2.4 Linux Kernel and hasn't been updated

C# driver development?

Deadly 提交于 2019-11-27 01:12:50
Before I jump headlong into C#... I've always felt that C, or maybe C++, was best for developing drivers on Windows. I'm not keen on the idea of developing a driver on a .NET machine. But .NET seems to be the way MS is heading for applications development, and so I'm now wondering: Are people are using C# to develop drivers? Do you have to do a lot of API hooks, or does C# have the facilities to interface with the kernel without a lot of hackery? Can anyone speak to the reliability and safety of running a C# program closer to Ring 0 than would normally be the case? I want my devices to be

Logging data on device and retrieving the log

可紊 提交于 2019-11-26 23:55:37
On a debug build in Xcode, regardless of whether I am using the simulator or an actual device, NSLog, printf, fprintf assert and NSAssert statements come out on the console If I now run a release build on the device (say I send a test flight build and big it up on my iPhone; this will be a release build), which of these (if any) are getting recorded? And how do I retrieve the log? Does NSLog actually output something on release build? What is the determining factor? Whether it is writing to stdout or stderr? is only stderr written to device log? Does this mean I have to use fprintf? Is

Android Device Chooser — device not showing up

我的未来我决定 提交于 2019-11-26 23:39:34
I'm using Eclipse + ADT, and my physical device (listed below) is unlisted on Android Device Chooser. I have updated Eclipse and all of the Android packages. My phone is running Android OS 1.6, which corresponds to the target version listed in the Eclipse Project. Also, the reason I decided to try testing on a real device is because the emulator doesn't seem to be working right anymore when I run my project. The emulator launches, but the program never does. Any ideas? (using windows 7/t-mobile mytouch 3g) First, make sure that the Android ADB can "talk to" your device. Open a Windows Command

Read barcodes from input-event (linux, c)

℡╲_俬逩灬. 提交于 2019-11-26 23:17:58
问题 I have a small program that read barcodes from /dev/input/event4. This is the code: #include <sys/file.h> #include <stdio.h> #include <string.h> #include <linux/input.h> int main (int argc, char *argv[]) { struct input_event ev; int fd, rd; //Open Device if ((fd = open ("/dev/input/event4", O_RDONLY|O_NONBLOCK)) == -1){ printf ("not a vaild device.\n"); return -1; } while (1){ memset((void*)&ev, 0, sizeof(ev)); rd = read (fd, (void*)&ev, sizeof(ev)); if (rd <= 0){ printf ("rd: %d\n", rd);

Serial Communication with Silverlight 5 (COM port)

北战南征 提交于 2019-11-26 23:12:51
问题 I'm working on an ASP.NET website in which I'll need to access an usb device from the client side. I've seen that Silverlight 5, through the use of P/Invoke, allows us to access dlls on the client machine. I plan to add a silverlight control in one of my page that will interact with my usb Device. This, way, each customer using this kind of device, will only need to connect on my website and start working with it. Nonetheless, being a beginner at that kind of interaction with an usb device,

Android Market - This application is available to over 0 devices?

末鹿安然 提交于 2019-11-26 22:57:59
问题 I have published apk to the Android Market, activated and setup for free for all countries. Android Market says, my application is not compatible with any of the devices. I can see an application when I access Android Market from the PC browser but I can not download it from any of the Android phone (the same device used to test application before release). How is that possible if I have just few requirements? I have tested the application on a few quite old devices before upload and it

How to change device Volume on iOS - not music volume

女生的网名这么多〃 提交于 2019-11-26 22:31:39
I want to change the device volume on iOS (iphone). I know that i can change the volume of music library with this lines below: //implement at first MediaPlayer framework MPMusicPlayerController *musicPlayer = [MPMusicPlayerController iPodMusicPlayer]; musicPlayer.volume = 1; But thats not my aim. I want to change the device volume or let me say the volume of ringer . How can i do that? just change the DEVICE volume? To answer brush51's question: How can i do that? just change the DEVICE volume? As 0x7fffffff suggested: You cannot change device volume programatically, however MPVolumeView