w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
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 can I know google sync is activated on an android device programmatically?
You should use AccountManager, filtering its results by account type (com.google), but above all by sync state, using a ContentResolver. Check out the code attached: AccountManager am = AccountManager.get(this); Account[] accounts = am.getAccountsByType("com.google"); boolean syncEnabled = ContentResolver.getSyncAutomatically(accounts[0], ContactsContract.AUTHORITY);

Categories : Android

chrome.storage.sync.remove array doesn't work
When you pass in a string to sync.remove, Chrome will attempt to remove the one single item whose key matches the input string. If you need to remove multiple items, use an array of key values. Also, you should move your remove call to inside your get callback. function clearNotes(symbol) { // CHANGE: array, not a string var toRemove = []; chrome.storage.sync.get( function(Items) { $.each(Items, function(index, value) { // CHANGE: add key to array toRemove.push(index); }); alert(toRemove); // CHANGE: now inside callback chrome.storage.sync.remove(toRemove, function(Items) { alert("removed"); chrome.storage.sync.get( function(Items) { $.each(Items, function(index, value) { alert(in

Categories : Javascript

Flash Firefox OS on "unsupported" device
It's not recommended if you cannot solve hardware related (gonk porting) issues. Every device has its own hardware combination and they need different configuration (what B2G configure.sh command does) to make everything works. Here's the supported device list https://github.com/mozilla-b2g/B2G/blob/master/config.sh

Categories : Android

RestKit: how to remove core data entries to keep the content in sync with the server?
You want to look at the section "Fetch Request Blocks and Deleting Orphaned Objects" on this page. It requires you to be using an RKObjectManager (which you say you are) and describes the way that you tell RestKit how to find content in the data store that should be deleted (and it checks and doesn't delete things that it just received from the server).

Categories : IOS

Remove filter property of a div in css using firefox
Probably this helps:(fiddle) style body.blur { filter:url(#blur-effect); } #haut{ background-color: dodgerblue; margin-bottom:10px; } #bas{ background-color: darkred; } #bas2{ background-color: red; } html <div id="haut" onmouseover="flou();" onmouseout="flou();"> test </div> <div id="bas"> test </div> <svg> <filter id="blur-effect"> <feGaussianBlur stdDeviation="5" /> </filter> </svg> <div id="bas2"> test </div> JS function flou() { b = document.body; c = b.className; if (c.indexOf('blur') > 0) {//when blur is active b.className = "" //remove blur } else { b.className += ' blur'; //apply blur }

Categories : Javascript

Is there any way to remove the application warning in firefox?
you realy can't bypass firefox warning . Only if the firefox user uncheck the option " Tell me when a website asks to store data for offline use " in network tab in the Advanced setting . good luck

Categories : HTML

Active Sync Client Sync Message, status code 4 - ParseSyncKey - AirSyncPermanentException
From http://msdn.microsoft.com/en-us/library/gg675447(v=exchg.80).aspx : A Status element (section 2.2.3.162.16) value of 4 is returned if the GetChanges element is present and empty or set to 1 (TRUE) when the SyncKey element value is 0 (zero). No error is returned if the GetChanges element is absent or set to 0 (FALSE) when the SyncKey value is 0 (zero). You have present and empty in your xml. You only may set GetChanges to 1 or live it empty (which is by default = 1) in any consequential sync request, not in initial sync request.

Categories : Misc

Use Interlocked.CompareExchange sync with a sync object in a Timer HandleElapsed handler
This is atomical, so threadsafe int sync = Interlocked.CompareExchange(ref syncPoint, 1, 0); if (sync == 0) It means: if the syncPoint is 0, put it at 1, give me the old value (so 0) and put it in sync (a local variable). Then check if the exchange was done (so if the old value was 0) What I would make different is instead of syncPoint = 0; I would use Interlocked.Exchange(ref syncPoint, 0); just to be sure that other threads can immediately see that the "lock" is free, otherwise the current thread could delay "writing" that syncPoint = 0 and no other threads could enter the "lock". BUT in the example given this is not a problem: HandleElapsed is called in response to a event (the Timer probably uses OS timers)... I can't even imagine that after the event has been handled ther

Categories : C#

remove default select box arrow in firefox
Update: this was fixed in Firefox v35. See the full gist for details. Just figured out how to remove the select arrow from Firefox. The trick is to use a mix of -prefix-appearance, text-indent and text-overflow. It is pure CSS and requires no extra markup. select { -moz-appearance: none; text-indent: 0.01px; text-overflow: ''; } Tested on Windows 8, Ubuntu and Mac, latest versions of Firefox. Live example: http://jsfiddle.net/joaocunha/RUEbp/1/ More on the subject: https://gist.github.com/joaocunha/6273016

Categories : Firefox

chrome.storage.sync does not sync across browsers and devices
Is your extension uploaded to your Chrome Web Store account and published (or at least published to your testers)? Cross-computer sync doesn't work on non-Web Store extensions last I checked, so you have to put it on the Chrome Web Store to test. You also have to make sure Extensions is checked under chrome://settings/syncSetup.

Categories : Google Chrome

chrome.storage.sync doesn't sync between machines
So I finally figured this out. When not using Chrome Web Store your manifest file should include a key (https://developer.chrome.com/extensions/manifest.html#key) ... "key":"myawesomeextension" ... Without this every time you install the extension on a different device (through chrome://extensions/ --> Load unpacked extension) it gets a new id and therefore the data being synced doesn't get matched to the correct extension - same extension with different ids = two different extensions in the eyes of Chrome. There is no need for a key once the extension is in Chrome Web Store. Hope this helps somebody keep some hair at some point.

Categories : Javascript

IE & Firefox - custom drop down could not remove native arrows
Use this it will work but with IE10+ and for FF : Your css should look like this: select.desktopDropDown::-ms-expand { display: none; } More about ::ms-expand. Then for the rest : select.desktopDropDown { outline : none; overflow : hidden; text-indent : 0.01px; text-overflow : ''; background : url("../img/assets/arrow.png") no-repeat right #666; -webkit-appearance: none; -moz-appearance: none; -ms-appearance: none; -o-appearance: none; appearance: none; } Note: I hardcoded path "../img/assets/arrow.png" as background. This should work good for you in IE, Firefox and Opera .

Categories : CSS

How to remove dotted outline from iframe in Firefox when tabbed
Add the following iframe { border:0px; } jsFiddle works in all browsers. The fiddle will be blank, as there is no src in the iframe.

Categories : HTML

Remove dotted outline from range input element in Firefox
Dotted outline is not an issue, it's browser's way to show the input element is selected. What you can do is set tabIndex to -1 which will prevent your input element from taking focus on tab and, consequently, from having the outline: <input class="size" type="range" tabIndex="-1" name="size" min="1" max="6" value="6"></input> But after doing this you will lose some keyboard accessibility. It is better to have input element keyboard accessible. Here is the fiddle: http://jsfiddle.net/pF37g/14/

Categories : CSS

Add Own SYNC MENU in ACCOUNT & SYNC option
Problem Solved Here I have created my own Sync Notes mechanism as per my requirement for this i have to create following things. 1)Create own provider for handling synchronization which extend Content Provider. 2)Create own Service for data operation. 3)Create Sync Adapter in res/XML. 4)Register Provider in your manifest file. 5)Register your Service in manifest file. 1)Create own provider for handling synchronization which extend Content Provider. public class Provider extends ContentProvider { private static final int CONSTANTS = 1; private static final int CONSTANT_ID = 2; private static final UriMatcher MATCHER; private static final String TABLE = "constants"; public static final class Constants implements BaseColumns { public static final Uri CONTENT_URI = Uri .parse("

Categories : Android

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

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

Firefox Addon: how to remove preferences when addon is being uninstalled?
AddonManager.addAddonListener({ onUninstalling: function(addon){ // alert("uninstalling!"); Services.prefs.setBoolPref("extensions.CustomButton.firstrun", true); } });

Categories : Javascript

unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055) Windows 7 / Firefox 22
Can you update your 'watir-webdriver' gem to 0.6.4 and check it once. My PC configuration is Windows 7 Professional 64-bit Firefox 22.0 Ruby 1.9.3p392 Ruby 1.9.2p290 (2011-07-09) [i386-mingw32] selenium-webdriver (2.33.0, 2.32.1, 2.32.0) watir-webdriver (0.6.4, 0.6.3)

Categories : Selenium

Checkbox in Jquery UI Dialog doesn't appear in Firefox 22.0 and Opera, but it does in Firefox 20.0
there is problem with position i check in fiddle jquery var popUpConf = $('#addFormular').dialog({ resizable: false, draggable: false, dialogClass: 'no-close', modal: true, position: { my: "left top", at: "right bottom", of: window }, width: 'auto', closeOnEscape: false, open: function(event, ui) { $(".ui-dialog-titlebar-close", ui.dialog || ui).hide(); }, buttons: [ { text: "Annuler", click: function() { $(this).dialog("close"); } }, { text: "Valider", click: function() { $(this).dialog("close"); } }] }); add jquery ui and jquery library.

Categories : Javascript

Font looks really worse in Firefox: why and how I can write a hack for Firefox?
When I test 13px Arial, it looks slighty lighter in Chrome than in Firefox, rather than the other way around as in your case. Stay tuned to variation across browser versions, platforms, and settings, as regards to font rendering. Usual browser detection techniques could be used in JavaScript to check whether the browser claims to be Firefox and modify CSS code accordingly. But this would be a shot in the dark, partly due to the variation mentioned, partly because there is really nothing you can do to fix the assumed problem. Bolding tends to change the overall appearance of text, not just slighly thicken strokes, and bolding often reduces readability. Ways to avoid creating problems like this: Do not set font size to something as small as 13px. Especially for small font sizes, use black

Categories : CSS

Code works on Firefox Desktop v 22 but not on Firefox Android v 22
Ok. After regression testing, it boils down to the nicescroll plugin - areaaperta.com/nicescroll removed the init code for this plugin and things have started working.

Categories : Android

Why is JavaScript slower in a FireFox add-on than in a webpage loaded in FireFox?
There are two preferences (accessible from the about:config page) that control the javascript optimizations: javascript.options.methodjit.chrome for privileged code (extensions) and javascript.options.methodjit.content for untrusted code (web pages). Some versions of Firefox ship with the former disabled by default. Check javascript.options.methodjit.chrome to see if it's set to true.

Categories : Javascript

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

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

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

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

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

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#

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

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

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

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 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 can i Write data from Android device on c2540c device?
Might this solve your problem?

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

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

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



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