android

Android listen for messages from server socket

ε祈祈猫儿з 提交于 2021-02-17 20:08:23
问题 I am trying to create an android app that communicates with a local server through a socket. The communication passes simple commands and data in strings using JSON. The client should constantly listen to incoming messages from the server and update the user interface when new data is received. So i have created a network service which is a bound service running in the background. From my activity i bind to the service and receives an instance of the service object. The service object

Android listen for messages from server socket

拥有回忆 提交于 2021-02-17 20:06:46
问题 I am trying to create an android app that communicates with a local server through a socket. The communication passes simple commands and data in strings using JSON. The client should constantly listen to incoming messages from the server and update the user interface when new data is received. So i have created a network service which is a bound service running in the background. From my activity i bind to the service and receives an instance of the service object. The service object

Android listen for messages from server socket

被刻印的时光 ゝ 提交于 2021-02-17 20:06:25
问题 I am trying to create an android app that communicates with a local server through a socket. The communication passes simple commands and data in strings using JSON. The client should constantly listen to incoming messages from the server and update the user interface when new data is received. So i have created a network service which is a bound service running in the background. From my activity i bind to the service and receives an instance of the service object. The service object

人脸识别(基于ArcFace)

自古美人都是妖i 提交于 2021-02-17 19:52:40
我们先来看看效果 上面是根据图片检测出其中的人脸、每个人脸的年龄还有性别,非常强大 第一步: 登录 https://ai.arcsoft.com.cn/ ,注册开发者账号,身份认证,注册应用,得到APPID和SDKKEY 第二步: 阅读SDK接入文档 https://ai.arcsoft.com.cn/manual/arcface_android_guideV2.html 其中重要的是下面 Step1:调用FaceEngine的active方法激活设备,一个设备安装后仅需激活一次,卸载重新安装后需要重新激活。 Step2:调用FaceEngine的init方法初始化SDK,初始化成功后才能进一步使用SDK的功能。 Step3:调用FaceEngine的detectFaces方法进行图像数据或预览数据的人脸检测,若检测成功,则可得到一个人脸列表。(初始化时combineMask需要ASF_FACE_DETECT) Step4:调用FaceEngine的extractFaceFeature方法可对图像中指定的人脸进行特征提取。(初始化时combineMask需要ASF_FACE_RECOGNITION) Step5:调用FaceEngine的compareFaceFeature方法可对传入的两个人脸特征进行比对,获取相似度。(初始化时combineMask需要ASF_FACE

Android:进程优先级

不问归期 提交于 2021-02-17 19:47:29
进程优先级 优先级 服务 说明 高优先级 前台进程 ①该进程包含正在与用户进行交互的界面组件,比如一个Activity。 ②进程服务被Activity调用,而且这个Activity正在与用户进行交互 ③进程服务正在执行生命周期中的回调函数,如onCreate(),onStart()或onDestroy() ④进程的BroadcastReciver正在执行onReceive()函数 中优先级 可见进程 ①程序界面部分可以给用户看见,但是不在前台与用户交互,不相应界面事件的进程 ②一个进程包含了Service服务,且这个服务正在被用户可见的Activity调用 服务进程 包含已经启动的Service服务的进程。其特点,无用户界面,但是可以在回台长期执行 底优先级 后台进程 没有任何用户可见的Activity,且不包含任何已经启动的Service服务进程 空进程 不包含任何活跃组件的进程,这些组件包括Activity、Service、BroadcastReceive等 【附】资源紧张时,首先清除,但不关闭,保存在进程中 来源: oschina 链接: https://my.oschina.net/u/4267631/blog/3680903

How to deal with apps that force screen orientation in android-x86 on VirtualBox?

最后都变了- 提交于 2021-02-17 19:41:19
问题 If you've used an Android device, you're aware that there are some apps that force the display to portrait and ignore the device's orientation sensor. On a real device, this is not a problem, as you can physically rotate the device in your hands to use the app. However, I am trying to use such an app on android-x86 in Oracle's VirtualBox on a Linux Mint PC, and cannot physically rotate my monitor. I have tried the f9-f12 keys that send a rotation event to the app, but since the orientation is

SDK Location not found

拈花ヽ惹草 提交于 2021-02-17 19:20:08
问题 I created recently a new local repo and pulled some code to it, from our remote repository. When i open the project, I receive a message in console: Gradle sync failed: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable. Consult IDE log for more details I followed the instructions here to set the environment variable (Im in a Mac) and checked my local.properties: sdk.dir=/Users/admin/Library/Android/sdk So, both

How to synchronize data amongst devices in Wi-Fi

Deadly 提交于 2021-02-17 19:19:31
问题 I am developing an app for iOS and Android. The basic functionality is to keep a certain set of data synchronized across all devices in a Wi-Fi network without a central server. Every device can modify that set of data. The current approach is to discover the other devices via Bonjour/Zeroconf and then send the "change messages" to all devices via ZeroMQ. As both Frameworks cause quite a lot of problems to implement I am asking if this is the correct way to accomplish this. I had most of the

Using Kotlin Coroutines to replace LocalBroadcastManager for Firebase messaging

£可爱£侵袭症+ 提交于 2021-02-17 19:12:53
问题 When using Firebase Cloud Messaging on Android, it is often desirable to notify the current Activity of an incoming push notification. One of the recommended ways to do this has been to use LocalBroadcastManager to send an Intent from the FirebaseMessagingService implementation to the Activity (StackOverflow example answer). However, as of version 1.1.0-alpha01 (2018-12-17), LocalBroadcastManager is deprecated: LocalBroadcastManager is an application-wide event bus and embraces layer

Google GPDR Consent. AdMob Error: IAB TCF v2.0 errors detected We've detected an issue on your IAB TC string on one or more of your sites or apps

只愿长相守 提交于 2021-02-17 19:11:20
问题 After implementing google UMP SDK to get consent for EU users I faced following error on AdMob (iOS and Android apps): IAB TCF v2.0 errors detected We've detected an issue on your IAB TC string on one or more of your sites or apps. These errors may affect your ability to serve ads to European users. A detailed report is available for you on the EU user consent page. In downloadable .csv file I see the following: In official documentation troubleshooting guide looks following: But there is no