detect

Android fingerprint detect new finger added

佐手、 提交于 2019-11-27 04:33:15
问题 How to detect if the user add new fingerprint to Android settings after he/she authenticate finger inside my application ? i.e. iOS have something called (evaluatedPolicyDomainState) to detect changes in fingerprint catalog what is the alternative in Android ? This require for security reasons to prompt password in this case 回答1: From the documentation for setUserAuthenticationRequired: The key will become irreversibly invalidated once the secure lock screen is disabled (reconfigured to None,

Java: File Renaming Detection

佐手、 提交于 2019-11-27 04:06:58
问题 Is there a way to detect file renaming using Java? (NIO's WatchService API or any other) From what I've seen when renaming a file two separate events occur - ENTRY_DELETE and then ENTRY_CREATE. 回答1: Take a look at jpathwatch. In addition to the standard watch event kinds specified in Java 7 ( ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY ) it also has additional events called ENTRY_RENAME_FROM and ENTRY_RENAME_TO which will fire when a file is renamed. Note that this depends on whether the

Detect mobile browser [duplicate]

烈酒焚心 提交于 2019-11-27 02:58:28
Possible Duplicate: Simplest way to detect a mobile device I have a site and I want to detect which browser is used and redirect them. I have a php index and the code must be in php. I've found many sites but they don't work or they don't detect many mobile browsers. Do you know of any good code or tutorials that can detect many mobile browsers? Have my user agent code: <?php /* USER-AGENTS ================================================== */ function check_user_agent ( $type = NULL ) { $user_agent = strtolower ( $_SERVER['HTTP_USER_AGENT'] ); if ( $type == 'bot' ) { // matches popular bots

any way to detect volume key presses or volume changes with android service?

可紊 提交于 2019-11-27 02:27:04
问题 Some Android apps generate a notification when the device's volume changes and some lock the volume. For the life of me, I cannot find out how that's done. Please, can someone help me by providing an example? 回答1: There is no Broadcast Action to detect volume changes, but you could maybe every second or two check what the volume is with getStreamVolume and if you need to lock it at a specific volume, every second or two use: setStreamVolume Check http://developer.android.com/reference/android

Detect headset button click on iPhone SDK

ぃ、小莉子 提交于 2019-11-27 01:46:32
问题 Is there a way to detect the headset's play/pause button click? I managed to detect the volume buttons clicks using: AudioSessionAddPropertyListener( kAudioSessionProperty_CurrentHardwareOutputVolume , audioVolumeChangeListenerCallback, self ); But I can't find an AudioSessionProperty for the center button. What's the way to do that? 回答1: Everything that's done from outside your app is considered a "Remote Event". If you double-tap the Home button and press Play/Pause there, it's the

How to determine artificial bold style ,artificial italic style and artificial outline style of a text using PDFBOX

房东的猫 提交于 2019-11-26 23:08:07
I am using PDFBox for validating a pdf document . There are certain requirement to check following types of text present in a PDF Artificial Bold style text Artificial italic style text. Artificial outline style text I did search in PDFBOX api list but was unable to find such kind of api. Can anyone please help me out and tell how to determine different types of artificial font/text styles to be present in a PDF using PDFBOX. The general procedure and a PDFBox issue In theory one should start this by deriving a class from PDFTextStripper and overriding its method: /** * Write a Java string to

How to check the object type on runtime in TypeScript?

懵懂的女人 提交于 2019-11-26 20:55:46
I'm trying to find a way to pass an object to function in and check it type in a runtime. This is a pseudo code: func(obj:any){ if(typeof obj === "A"){ // do something } else if(typeof obj === "B"{ //do something else } } a:A; b:B; func(a); But typeof is always return "object" and I could not find a way to get the real type of "a" or "b". The instanceof did not work either and return the same. Any idea how to do it in a TypeScript? Thank you for your help!!! Edit : I want to point out to people coming here from searches that this question is specifically dealing with non-class types, ie object

Detect if program is running with full administrator rights

房东的猫 提交于 2019-11-26 20:49:28
I need to determine if my program is running with full administrator rights. By that I mean if uac is turned on (for win vista/7) that I need to determine if the program actually has admin rights (like if the user right clicked and selected "run as administator") and not limited by uac. How do I do this in C++? Win9x: Everyone is "admin" NT4: OpenThreadToken/OpenProcessToken + GetTokenInformation(...,TokenGroups,...) on DOMAIN_ALIAS_RID_ADMINS SID in a loop 2000+: OpenThreadToken/OpenProcessToken + CheckTokenMembership on DOMAIN_ALIAS_RID_ADMINS SID Other alternatives are: IsUserAnAdmin or

Detect a screenshot Android

故事扮演 提交于 2019-11-26 20:39:43
问题 I program in recent years to Android and I wonder something : How to detect when user take a screenshot ? I want that when the user takes a screenshot , we move to the next activity . I tried the method of intercepting an event but there is a problem : when the device goes into sleep , for example, an event is intercepted . Do you have a solution for intercepts only the event of screenshot or ignore other event? Thank you for your help ! 回答1: There is no direct Broadcast Intent to tell you

Detect if a user has typed an emoji character in UITextView

五迷三道 提交于 2019-11-26 20:17:56
问题 I have a UITextView and I need to detect if a user enters an emoji character. I would think that just checking the unicode value of the newest character would suffice but with the new emoji 2s, some characters are scattered all throughout the unicode index (i.e. Apple's newly designed copyright and register logos). Perhaps something to do with checking the language of the character with NSLocale or LocalizedString values? Does anyone know a good solution? Thanks! 回答1: Over the years these