小编use*_*244的帖子

任何替代CachingHttpClient for Android?

我想为我的Android应用程序启用HttpCaching,所以我正在寻找一个依赖的库项目.CachingHttpClient看起来不错,但是使用Apache HttpClient 4.1和Android只包含4.0

那么,有没有其他适用于Android的好的http-cache项目可以在Android上使用?

apache android caching http

9
推荐指数
0
解决办法
1654
查看次数

在 iTerm2 中使用按键打开链接

我喜欢 iTerm2 中的增量搜索和选项卡扩展以选择功能。有什么方法可以将其配置为通过按键支持神奇打开选定链接?就像 cmd 单击 url 一样?

macos iterm2

6
推荐指数
1
解决办法
1450
查看次数

Swift 标头中的 AVCaptureAudioDataOutput 中是否缺少 audioSettings 属性?

我正在开发 iOS 应用程序,我想在其中录制分段视频。我已经阅读了https://developer.apple.com/library/content/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/00_Introduction.html并且我有一个工作解决方案AVCaptureVideoDataOutput,在那里我捕获帧并使用AVAssetWriter. 我加入AVCaptureVideoDataOutputAVCaptureSession这样的:

// Setup videoDataOutput in order to capture samplebuffers
let videoDataOutput = AVCaptureVideoDataOutput()
videoDataOutput.videoSettings = [kCVPixelBufferPixelFormatTypeKey as AnyHashable : Int(kCVPixelFormatType_32BGRA)]
videoDataOutput.alwaysDiscardsLateVideoFrames = true
videoDataOutput.setSampleBufferDelegate(self, queue: CaptureManager.CAPTURE_QUEUE)

guard captureSession.canAddOutput(videoDataOutput) else {
    return
}

captureSession.addOutput(videoDataOutput)
self.videoDataOutput = videoDataOutput
Run Code Online (Sandbox Code Playgroud)

效果很好,我可以成功运行捕获会话并获得可播放的电影文件。

现在我想挂入音频。所以我想做同样的事情:

// Setup audioDataOutput in order to capture audio
let audioDataOutput = AVCaptureAudioDataOutput()
audioDataOutput.audioSettings = ...
audioDataOutput.setSampleBufferDelegate(self, queue: CaptureManager.CAPTURE_QUEUE)

guard captureSession.canAddOutput(audioDataOutput) else {
    return
}

captureSession.addOutput(audioDataOutput)
self.audioDataOutput = audioDataOutput
Run Code Online (Sandbox Code Playgroud)

疯狂的事情是, …

avfoundation ios avcapturesession avcapturemoviefileoutput swift

5
推荐指数
1
解决办法
1678
查看次数

客户经理集成 - Android 与 iOS

我是 Android 开发人员,但我需要回答一些有关其他平台的可能性的问题,我想知道 iOS 提供了哪些与http://developer.android.com/reference/android/accounts/AccountManager.html相当的功能。我找到了https://developer.apple.com/library/ios/documentation/Accounts/Reference/ACAccountClassRef/Reference/Reference.html,但我无法理解全部可能性。

问题:

  • iOS 中的账户管理器如何使用?
  • 在 Android 中可以共享服务的令牌,iOS 是否具有相同的功能
  • 是否有集中式 API 或者已解决 app-2-app 问题?
  • 是否有任何与此相关的可用安全概念(限制某些应用程序对令牌的访问等)

很高兴收到简短而快速的回复!// 乔纳斯

iphone android accountmanager ios

4
推荐指数
1
解决办法
7689
查看次数

OAuth,Twitter和Android的问题:与服务器的http通信失败

有没有人对Android的Twitter进行OAuth身份验证的工作示例?我曾试图同时使用Twitter4J和SignPost,但我得到了非常奇怪的错误,说twitter.com是一个未知的主机.我已经知道使用SignPost库和Android 存在问题(在谷歌Android下),并且根据项目的主页,CommonsHttpOAuth*类应该有效.

这是我的SignPost:

private void getReqTokenAndAuthenticateUsingSignPost() {
    String callbackUrl = "twitter-test:///";
    CommonsHttpOAuthConsumer consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY,
            CONSUMER_SECRET);
    CommonsHttpOAuthProvider provider = new CommonsHttpOAuthProvider(
            "http://twitter.com/oauth/request_token", "http://twitter.com/oauth/access_token",
            "http://twitter.com/oauth/authorize");

    String tokenStr = consumer.getToken();
    String tokenSecretStr = consumer.getTokenSecret();

    SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
    Editor edit = preferences.edit();
    edit.putString(REQ_TOKEN, tokenStr);
    edit.putString(REQ_TOKEN_SECRET, tokenSecretStr);

    try {
        String authUrl = provider.retrieveRequestToken(consumer, callbackUrl);
        Uri authenticationUri = Uri.parse(authUrl);
        startActivity(new Intent(Intent.ACTION_VIEW, authenticationUri));
    } catch (OAuthMessageSignerException e) {
        e.printStackTrace();
    } catch (OAuthNotAuthorizedException e) {
        e.printStackTrace();
    } catch (OAuthExpectationFailedException e) {
        e.printStackTrace();
    } …
Run Code Online (Sandbox Code Playgroud)

twitter android oauth signpost twitter4j

3
推荐指数
1
解决办法
8502
查看次数