android

App hang on install in Android Studio

六月ゝ 毕业季﹏ 提交于 2021-02-18 13:58:20
问题 Usually I build an app in Android Studio to test an app on Phone. But this occurs when I just click the Run app Waiting for device. Target device: motorola-nexus_6-ZX1G227B86 Uploading file local path: F:\HeadFirstAndroid\MateClient\app\build\outputs\apk\app-debug.apk remote path: /data/local/tmp/com.diyu.org.mateclient Installing com.diyu.org.mateclient DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.diyu.org.mateclient" It seems that the process is stuck on the pm install and no

Saving Data from ListView using SharedPreferences

点点圈 提交于 2021-02-18 13:51:37
问题 i tried searching for an answer but could not find what i was looking for: this was my first try at saving data/using SharedPreferences so i wasnt quite sure of what i was doing. The main point was so that after a user inputs something in the EditText, it populates the ListView. But i also want it so that when this is carried out, the app also saves the string so that I can use LoadPreferences to have it when a user re-enters the app. This does not happen though the code: public class

问题一:使用AndroidDriver而非原来的AppiumDriver的原因

删除回忆录丶 提交于 2021-02-18 12:55:05
AppiumDriver升级到2.0.0版本引发的问题--Cannot instantiate the type AppiumDriver 1. 问题描述和起因 在使用Appium1.7.0及其以下版本的时候,我们可以直接使用如下代码来创建一个AppiumDriver实例进行对安卓设备的操作。 driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); 但在把Appium包升级到当前最新的2.0.0版本的时候,这段代码会引发如下的一问题 当前的pom.xml相关设置如下:记得把1.7.0改成2.0.0或者是将来更高级版本 <dependency> <groupId>io.appium</groupId> <artifactId>java-client</artifactId> <version>2.0.0</version> <del><version>1.7.0</version></del> </dependency> 2.问题分析 究其原因,发现Appium2.0.0把AppiumDriver这个类改成了抽象函数,所以到导致了这个问题 public <span style="color:#ff0000;">abstract </span>class

Communicating via Bluetooth serial with Python

▼魔方 西西 提交于 2021-02-18 12:51:14
问题 How do you process and receive serial data via Bluetooth and Python? I'm trying to make a simple Python server that access data via Bluetooth as explained here. My server.py file, which sends a random number when sent the text "temp", is: #!/usr/bin/env python import os import glob import time import random from bluetooth import * def read_temp(): return random.random() server_sock=BluetoothSocket( RFCOMM ) server_sock.bind(("",PORT_ANY)) server_sock.listen(1) port = server_sock.getsockname()

android camera2 associate TotalCaptureResult with Frame

非 Y 不嫁゛ 提交于 2021-02-18 12:49:10
问题 this is regarding Android's Camera2 APIs. Since capture result and output frame are produced asynchronously, one could get capture result much before the actual frame. Is there a good way to associate produced frame with the corresponding capture result ? 回答1: Assuming you are talking about a frame that is sent to an ImageReader or SurfaceTexture upon capture (as in the ubiquitous camera2basic example), the trick is to compare unique timestamps identifying the images. Save the

Adding * and # key to the soft keyboard

[亡魂溺海] 提交于 2021-02-18 12:45:11
问题 1) PROBLEM: I have an EditText in which the user has to enter USSD code. Problem is, for entering USSD code the user has to switch to symbol keyboard (two to three times) which creates a very bad user experience. USSD Code Examples: *345*77#, *333*25#, *123*678# etc. <EditText android:id="@+id/field_code" android:layout_width="match_parent" android:layout_height="wrap_content" android:imeActionId="@integer/imo_action_search" android:imeOptions="actionSearch" android:inputType="phone" /> 2)

SSLProtocolException with HTTPs on Retrofit2

折月煮酒 提交于 2021-02-18 12:45:09
问题 I am running into an issue on Android 4.4 phones (specifically, Galaxy S4, although I believe it's not the fault of the phone itself). While using Retrofit2.Http I receive the following error while connecting on HTTPS: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x737510d0: Failure in SSL library, usually a protocol error error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:741

Disable dark theme in Ionic

北战南征 提交于 2021-02-18 12:42:09
问题 I'm designing an Ionic app, and I would like it to have white backgrounds and black texts whether the user has enabled the dark theme or not . This is what I want: However, when I enable the dark theme on an Android phone, it gets automatically converted to this: I want to prevent this from happening. I've searched online and found many articles that describe how to apply the dark theme, but I haven't found anything about disabling it. One solution I've thought about is explicitly enabling

How to proper align three TextViews horizontally with ConstraintLayout

故事扮演 提交于 2021-02-18 12:39:43
问题 I'm trying to align three TextViews horizontally (as the title may suggest), but even after chaining they together and using app:layout_constrainedWidth="true" they're still being pushed out of the screen, strangely only by the left side when the middle or the last one grows large. Notice that I'm setting the android:maxLines="1" and android:ellipsize="end" and aligning they at the start of the screen, not sure if it matters though. I also tried to limit their sizes, but on the case where

Clean Project vs Rebuild Project vs Run Project in Android Studio

本小妞迷上赌 提交于 2021-02-18 12:33:05
问题 Does anyone have or know of a detailed answer to how these three functions in android studio work (I think Eclipse, and probably IntelliJ also, have the same or similar functions). I have seen and been told answers that give a brief outline of how they work and from what I understand a rebuild will also clean the project and running the project runs the last built version of the available code. Ultimately, I am just looking for an in depth explanation of how these three functions work with