草庐IT

email_from

全部标签

Android SAF(存储访问框架): Get particular file Uri from TreeUri

我正在获取外部SD卡的PersistableUriPermission并将其存储以供进一步使用。现在我希望当用户从我的应用程序的文件列表中向我提供文件路径时,我想编辑文档并重命名它。所以我有要编辑的文件的文件路径。我的问题是如何从我的TreeUri中获取该文件的Uri以便编辑文件。 最佳答案 访问SD卡的文件使用DOCUMENT_TREE对话框获取SD卡的Uri。告知用户如何在对话框中选择sd-card。(配图或gif动图)//callfordocumenttreedialogIntentintent=newIntent(Inten

android - 如何设置android :layout_width ="match_parent" from code?

我有不同的布局。一些由xml创建。其他一些动态地通过代码。当我在xml上时,我可以使用“wrap_content”值设置宽度或高度。如何动态获得相同的结果?这是我的动态TextView的fragment。我需要删除“finalintwidth=440;”并获得相同的“wrap_content”值。怎么办?finalintwidth=440;finalintheight=textViewHeight;finalinttop=getNewTop(height);FrameLayout.LayoutParamslayoutParams;layoutParams=getLayoutParams

Android MediaCodec 和摄像头 : how to achieve a higher frame rate to get frame raw data from camera?

bigflake.com中CameraToMpegTest.java的例子,或者Grafika中的“Show+capturecamera”,使用camera.preview获取帧数据。实验表明(Nexus4,Android4.4.2)帧率为10fps。这没有预期的那么高。如果我们使用同一台设备(Nexus4、Android4.4.2)使用摄像头录制视频,帧率为30fps。所以我假设使用camera.preview的较低帧率在于方法(预览方法)。我曾经看过一个帖子,说相机预览方法的帧率较低。所以看起来解决方法是直接使用来自相机硬件的原始帧数据。怎么做?我的印象是iOS有视频处理API可以

android - 在安卓 : How to Call Function of Activity from a Service?

我有一个Activity(A)和一个由A启动的服务(S):Intenti=newIntent();i.putExtra("updateInterval",10);i.setClassName("com.blah","com.blah.S");startService(i);A在A中有一个这样的函数:publicvoidsomeInfoArrived(Infoi){...}现在我想从S中调用A.someInfoArrived(i)。Intent.putExtra没有我可以传递对象引用等的版本......请帮忙!PS:反过来(轮询S获取新信息)不是我所需要的。我找到了足够的信息来了解如何做

android - 解析 : send push notifications from app

我想知道如何使用我的应用程序直接从我的Android应用程序向其他人发送解析推送通知。可以这样做吗? 最佳答案 如果您想使用Parse,请转到解析仪表板,在那里您会看到推送设置,您可以在其中找到此客户端推送设置。ParsePushpush=newParsePush();Stringmessage="Clientmessage"+Integer.toString(i++);push.setChannel("ChannelName");push.setMessage(message);push.sendInBackground();

java - 安卓错误 : Could not read input channel file descriptors from parcel

我已经为Android开发了一个大致像这样工作的应用程序:应用程序与Web服务通信并传输信息(不是文件)我可以使用Intent和startActivity导航到不同的屏幕不幸的是,有时应用程序会在不同的Activity中崩溃并出现以下错误:java.lang.RuntimeException:Couldnotreadinputchannelfiledescriptorsfromparcel.atandroid.view.InputChannel.nativeReadFromParcel(NativeMethod)atandroid.view.InputChannel.readFromP

安卓NDK : read file from assets inside of shared library

在我的应用程序中,我必须将文件从assets文件夹传递到sharedlibrary。我现在不能用jni来做。我在我的项目中使用预编译的共享库,其中我有我的文件的硬编码路径,但我收到错误“没有这样的文件或目录”。所以在我的.apk文件中,我在libs/armeabi-v7a文件夹中有.so文件,在/assets文件夹。我试过这样做:char*cert_file="/assets/cacert.cert";av_strdup(cert_file);还有一些其他的路径,但是都不行。有可能吗? 最佳答案 您可以简单地使用C++中的AAsse

android - 谷歌地图实用程序 : how to get all markers from ClusterManager<? >?

对不起我的英语我尝试了ClusterManager.getMarkerCollection().getMarkers()方法,但它返回空集合。我在我的应用程序中使用GoogleMapsUtilityLibrary.每次屏幕旋转后,我都会创建AsynkTask并在后台线程中从数据库中读取数据并将项目添加到ClusterManager:cursor.moveToFirst();while(!cursor.isAfterLast()){SomeDatarow=readSomeDataRow(cursor);clusterManager.addItem(newClusterItemImpl(r

android - select-multiple-images-from-android,如何获取Uris?

描述:http://www.rqgg.net/topic/vrvkz-select-multiple-images-from-android-gallery.html如果调用者可以处理多个返回项(用户执行多项选择),那么它可以指定EXTRA_ALLOW_MULTIPLE来指示这一点。这很有趣。他们在这里指的是用户可以选择多个项目的用例吗?@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)publicvoidselectPhotos(){Intentintent=newIntent();intent.setType("image/*");inte

Android 项目提示 "The type bolts.Task cannot be resolved. It is indirectly referenced from required .class files"

我正在尝试通过ParseMealspotting教程,但在添加Parse库后,我遇到了奇怪的错误。我在谷歌搜索时发现了其他类似的错误,但没有任何效果。Here'sone.我也读书看看AddingtheSupportLibraries,但这并没有解决它。准确的文本是:Multiplemarkersatthisline-Thetypebolts.Taskcannotberesolved.Itisindirectlyreferencedfromrequired.classfiles-TheclassfileTaskcontainsasignature'Ljava/util/Set.TaskC