草庐IT

token_storage

全部标签

javascript - 安卓 WebView "Uncaught SyntaxError: Unexpected token ILLEGAL"

在我的android程序中,我有一个webview,需要动态地为webview元素(文本区域、复选框等)设置值。我有一个javascript方法,它从程序接收值并执行字符串操作并将值存储到正确的元素。但我总是收到这个错误......有点卡在这里。任何帮助将不胜感激。我在w3schoolsTryIt编辑器中成功地执行了脚本,但在程序中没有工作!finalWebViewwebView=newWebView(getApplicationContext());LayoutParamsparams=newLinearLayout.LayoutParams(LinearLayout.LayoutP

android - java.io.FileNotFoundException :/storage/emulated/0/saved_images/grub. jpg:打开失败:ENOENT(没有这样的文件或目录)

我正在使用下面的代码将图像保存在sd卡中,但我一直收到下面的异常privatevoidSaveImage(BitmapfinalBitmap,Stringfilename){Stringroot=Environment.getExternalStorageDirectory().toString();FilemyDir=newFile(root+"/saved_images");myDir.mkdirs();Stringfname=filename;Filefile=newFile(myDir,fname);if(file.exists())file.delete();try{File

Android Facebook 应用程序 : access token expiry ( expires_in ) is always 0

我正在开发一个使用facebook集成的应用程序。我正在尝试从facebook库类接收access_token和expires_intoken。一旦我登录,我就正确地获得了access_token,但我总是得到expires_intoken始终为0。因此,我的isSessionValid()方法总是返回false。如果有人遇到并解决了这个问题,请告诉我。当我没有在模拟器中安装Facebook应用程序时,我的代码运行得很好。我得到了webview,我可以登录并更新状态。但是当我安装Facebook应用程序时,单击更新状态菜单选项打开Facebook应用程序,我被重定向到权限页面,然后我收

android - 为什么使用 FileProvider 我无法使用外部应用程序从 INTERNAL STORAGE 打开文件?

我创建了一个可以在其内部存储中导入文件的应用程序。为了使用外部应用程序(例如PF查看器或照片)打开文件,我尝试遵循以下指南:theofficialguide,topic1,topic2,topic3和topic4但没有成功。这是我的代码:在我的list中我的包裹值(value):package="com.myapp.catcher"我的文件路径.xml我的代码StringfileName=path.substring(path.lastIndexOf("/")+1);Stringshelf=path.substring(path.lastIndexOf("PRIVATE")+8,pat

Android - 没有获得 GCM token

我调用RegistrationIntentService:if(checkPlayServices()){Log.i("udazzT","checkservicies");//StartIntentServicetoregisterthisapplicationwithGCM.Intentintent2=newIntent(this,RegistrationIntentService.class);startService(intent2);}但我在RegistrationIntentService中看不到任何日志:publicclassRegistrationIntentServic

android - Google 始终返回过期的 ID token (JWT)

根据https://developers.google.com/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInApi.html#constant-summaryIfyouusetheIDtokenexpirytimetodetermineyoursessionlifetime,youshouldretrievearefreshedIDtoken,bycallingsilentSignInpriortoeachAPIcalltoyourapplicationserver.我正在尝试通过调用sile

android - 运行时异常 : Unable to create output dir:/storage/emulated/0/app_spoon-screenshots

我正在使用gradle-spoon-plugin为AndroidUI测试设置Spoon使用Spoon2.0.0快照。我的项目是使用AndroidGradle插件3.0.1设置的。当通过spoonRule.screenshot(activity,"hello")截屏时,我得到这个RuntimeException:java.lang.RuntimeException:Unabletocreateoutputdir:/storage/emulated/0/app_spoon-screenshotsatcom.squareup.spoon.SpoonRule.createDir(SpoonRu

android - Android集成谷歌登录时ID token过期如何刷新?

我已按照https://developers.google.com/上的指南进行操作并且我可以在用户登录后获取登录用户的GoogleIDtoken。但我注意到该token将在1小时后过期。我找不到任何官方引用资料告诉我如何处理过期的GoogleIDtoken,所以我只能让用户再次点击Google登录按钮。如何在旧token过期后刷新有效的GoogleIDtoken,而无需用户一次又一次地手动登录? 最佳答案 是的,GoogleIDtoken的有效期为一小时,会过期,您可以简单地使用silentSignIn在您的应用程序中获取新的应用

android - 为什么我需要在 Android Lollipop 上使用 getExternalCacheDir() 的 WRITE_EXTERNAL_STORAGE 权限?

我的应用程序将缓存文件写入(和读取)到getExternalCacheDir()位置。在AndroidLollipop(API21)之前,我一直在成功使用此权限:存在maxSdkVersion是因为在APIv18之后不需要此权限:http://developer.android.com/reference/android/Manifest.permission.html#WRITE_EXTERNAL_STORAGE但是在AndroidLollipop(5.0)上,我获得了这样的访问权限(我的日志输出显示了实际使用的路径):11-1913:01:59.2574462-4541/com.m

android - 无法在模拟器上的/storage/emulated/0 上创建目录

我想在我的android模拟器上创建一个目录,但我做不到,我已经有listwrite_storage的权限,我没有得到任何错误,但mkdir()返回false,我验证外部存储是否是也是可写的,它适用于物理设备我的代码:///CriaumanovapastaparacolocarobackupFiledirect=newFile(Environment.getExternalStorageDirectory(),"/FinancasRWBackup");try{if(!direct.exists()){if(isExternalStorageWritable()&&isExternalS