Questions tagged «android»

Android是Google的移动操作系统,用于对数字设备(智能手机,平板电脑,汽车,电视,Wear,Glass和IoT)进行编程或开发。对于与Android相关的主题,请使用特定于Android的标签,例如android-intent,android-activity,android-adapter等。对于与开发或编程无关但与Android框架相关的问题,请使用以下链接:https:// android.stackexchange.com。



13
如何在Android模拟器中“摇动” Android设备以调出开发菜单来调试我的React Native应用
我正在开发一个跨平台的React Native移动应用程序。我在开发时正在编写console.log语句。我想在默认的Android模拟器中运行Android应用时在Chrome中看到这些日志记录语句。根据Facebook的文档,我只需要“摇动设备”即可。如何在Android模拟器中执行此操作? 要访问应用内开发者菜单: 在iOS上,摇动设备或在模拟器中按Control +⌘+ z。在Android上,摇动设备或按硬件菜单按钮(在较旧的>设备和大多数仿真器中可用,例如在genymotion中,您可以按⌘+ m来>单击模拟硬件菜单按钮)

25
Android无法加载JS捆绑包
我正在尝试在Nexus5(android 5.1.1)上运行AwesomeProject。 我能够构建项目并将其安装在设备上。但是当我运行它时,我得到一个红色屏幕说 无法下载JS捆绑包。您是否忘了启动开发服务器或连接设备? 在React Native iOS中,我可以选择离线加载jsbundle。如何在Android上做同样的事情?(或者至少在哪里可以配置服务器地址?) 更新资料 要在本地服务器上运行,请在react-native项目根目录下运行以下命令 react-native start > /dev/null 2>&1 & adb reverse tcp:8081 tcp:8081 请查看dsissitka的答案以了解更多详细信息。 要在没有服务器的情况下运行,请通过运行以下命令将jsfile捆绑到apk中: 在下面创建资产文件夹 android/app/src/main curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle" 请查看kzzzf的答案以了解更多详细信息。



14
将double转换为字符串
我不确定是我还是什么,但是将双精度转换为字符串时遇到问题。 这是我的代码: double total = 44; String total2 = Double.toString(total); 我是在做错什么还是在这里错过了一步。 NumberFormatException尝试将其转换时出现错误。 totalCost.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { try { double priceG = Double.parseDouble(priceGal.getText().toString()); double valG = Double.parseDouble(volGal.toString()); double total = priceG * valG; String tot = new Double(total).toString(); totalCost.setText(tot); } catch(Exception e) { Log.e("text", e.toString()); …
201 java  android 

8
您如何知道何时绘制布局?
我有一个自定义视图,可在屏幕上绘制可滚动的位图。为了初始化它,我需要传入父布局对象的像素大小。但是在onCreate和onResume函数期间,尚未绘制布局,因此layout.getMeasuredHeight()返回0。 解决方法是,我添加了一个处理程序,等待一秒钟,然后进行测量。这行得通,但是草率,而且我不知道在绘制布局之前我可以减少多少时间。 我想知道的是,如何确定何时绘制布局?是否有事件或回调?


6
如何在ConstraintLayout中将元素居中
我正在ConstraintLayout应用程序中进行布局。我想一个创建屏幕wheren一个EditText,并Button应在中心和Button应低于EditText与marginTop只16DP。 这是我的布局和屏幕截图,目前情况如何。 activity_authenticate_content.xml <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="16dp" android:paddingRight="16dp" tools:context="com.icici.iciciappathon.login.AuthenticationActivity"> <android.support.design.widget.TextInputLayout android:id="@+id/client_id_input_layout" android:layout_width="0dp" android:layout_height="wrap_content" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent"> <android.support.design.widget.TextInputEditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/login_client_id" android:inputType="textEmailAddress" /> </android.support.design.widget.TextInputLayout> <android.support.v7.widget.AppCompatButton android:id="@+id/authenticate" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginTop="16dp" android:text="@string/login_auth" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="@id/client_id_input_layout" app:layout_constraintRight_toRightOf="@id/client_id_input_layout" app:layout_constraintTop_toTopOf="@id/client_id_input_layout" /> </android.support.constraint.ConstraintLayout>

23
通过xml循环播放ImageView
我想将我的任何图像制作ImageView成带有边框的圆形。 我进行了搜索,但是找不到任何有用的信息(我尝试的任何方法均无效)。 如何通过xml实现此目标:创建ImageView具有特定src的,并使其带有边框的圆形?
201 android  xml  imageview 

23
读取Android APK的软件包名称
我需要获取Android APK 的软件包名称。我试图解压缩APK并读取的内容AndroidManifest.xml,但似乎不是文本文件。 如何提取APK的软件包名称?
200 android  apk 

13
如何在不使用Firebase控制台的情况下发送Firebase Cloud Messaging通知?
我将从通知的新Google服务开始Firebase Cloud Messaging。 多亏了这段代码https://github.com/firebase/quickstart-android/tree/master/messaging,我能够从Firebase用户控制台发送通知发送到Android设备。 是否有任何API或方法无需使用Firebase控制台即可发送通知?我的意思是,例如,一个PHP API或类似的东西,可以直接从我自己的服务器创建通知。

11
apk必须使用与先前版本相同的证书签名
不久前,我已将我的应用上传到Google Play(当时称为Android Market)。 今天,我更新了该应用程序,但删除了先前的密钥库并创建了一个新的密钥库。 上传时,提示APK必须使用与以前版本相同的证书签名: 上传失败 您已将使用其他证书签名的APK上传到以前的APK。您必须使用相同的证书。 您现有的APK用带有指纹的证书签名: [SHA1:89:2F:11:FE:CE:D6:CC:DF:65:E7:76:3E:DD:A7:96: 4F:84:DD:BA:33], 并且用于签署上传的APK的证书具有指纹: [SHA1:20:26:F4:C1:DF:0F:2B:D9:46: 03:FF:AB:07:B1:28:7B:9C:75:44:CC] 但是我没有此证书,也不想删除并重新发布该应用程序,因为它具有活跃的用户。 我该怎么做才能用新证书签署我的应用程序?
200 android  google-play  apk 


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.