小编dor*_*nad的帖子

Android意图捕获图像和视频?

是否有启动摄像头的Intent,可以选择在Android上捕获图片和视频?

我已经使用MediaStore.ACTION_VIDEO_CAPTURE和MediaStore.ACTION_IMAGE_CAPTURE来捕获音频或视频,但我找不到可以在两者之间切换的Intent,就像在这个示例app中一样:

在此输入图像描述

谢谢!

android android-intent android-camera

23
推荐指数
3
解决办法
8303
查看次数

从Spotify意图开始一首歌

无论如何从它的URI启动Spotify Track?

我尝试了以下方法,但没有一个工作.当Spotify打开时,它总是落在播放列表页面中,而不是轨道播放器.

String spotifyTrackURI = "spotify:track:1cC9YJ8sQjC0T5H1fXMUT2";
Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage("com.spotify.mobile.android.ui");

// I've tried with Intent#putExtra()..
launchIntent.putExtra( SearchManager.QUERY, spotifyTrackURI );
// or with setData
launchIntent.setData(Uri.parse(spotifyTrackURI))

context.startActivity(launchIntent);
Run Code Online (Sandbox Code Playgroud)

谢谢

android spotify android-intent

11
推荐指数
1
解决办法
1万
查看次数

将应用内购买收据数据发送到我的服务器

我正在实施应用内购买的收据验证服务器端,如收据验证编程指南所述.

每当我尝试将收据编码到Base64并将其发送到我的服务器时,我都会收到来自Apple的错误.但是如果我手动将非编码的base64复制粘贴到服务器上,在那里进行编码并触发对Apple的REST调用,他们的iTunes服务器会正​​确响应.

我不确定我做错了什么客户端.代码非常简单:

-(NSString*) retrieveReceiptFromCompletedTransaction:(SKPaymentTransaction*)transaction
{
  NSData *receiptData;
  NSString *receiptString;
  NSBundle *bundle = [NSBundle mainBundle];

  if ([bundle respondsToSelector:@selector(appStoreReceiptURL)]) {
    NSURL *receiptURL = [bundle performSelector:@selector(appStoreReceiptURL)];
    receiptData= [NSData dataWithContentsOfURL:receiptURL];
  }
  else {
    receiptData = transaction.transactionReceipt;
  }

  receiptString = [receiptData base64EncodedStringWithOptions:0];
  return receiptString;
}
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

base64 in-app-purchase ios receipt

9
推荐指数
1
解决办法
9400
查看次数

Amazon S3分段上传期间的javax.net.ssl.SSLException

我正在使用Simpl3r,这是一个简单的高级Android API,可以使用Amazon S3服务上传强大且可恢复的多部分文件,将媒体文件上传到我的存储桶.

在一些上传,我收到SSLException错误.这是抛出异常的代码:

(根据Simpl3r示例,我的类是IntentService的子类)

@Override
protected void onHandleIntent(Intent intent) {

    String filePath = intent.getStringExtra(ARG_FILE_PATH);
    final String s3ObjectKey = intent.getStringExtra(ARG_OBJECT_KEY);
    File fileToUpload = new File(filePath);
    String s3BucketName = getString(R.string.s3_bucket);

    final String msg = "Uploading " + s3ObjectKey + "...";

    // create a new uploader for this file
    uploader = new Uploader(this, s3Client, s3BucketName, s3ObjectKey, fileToUpload);

    // listen for progress updates and broadcast/notify them appropriately
    uploader.setProgressListener(new UploadProgressListener() {
        @Override
        public void progressChanged(ProgressEvent progressEvent,
                                    long bytesUploaded, int percentUploaded) {

            Notification …
Run Code Online (Sandbox Code Playgroud)

android file-upload amazon-s3 sslexception

9
推荐指数
1
解决办法
716
查看次数

Facebook Credits:获得学分数量

只是想知道是否有人知道如何查询Facebook Credits(FBC)API获取用户拥有的积分数量?我的应用程序有此要求,并且在FBC API中没有对此进行解释或提及.

谢谢

facebook facebook-credits

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

部署社交游戏的多个分支的想法

我正在努力解决以下问题:我们是一个正在Facebook上开发实验性社交游戏的团队.我们的团队分散在世界各地,很多时候我们希望有一个自动机制来在提交后直接部署功能分支.

我想这类似于CI解决方案,但更重.对于out case(我们正在使用git),我们希望开发人员能够"自动"将他们的功能部门部署到facebook,以便围绕最新的开发进行以skype为中心的讨论.

我们的前端是Flash,我们的后端是Google App Engine.我们的CDN是Amazon S3.

有任何想法吗?

〜谢谢.

git flash version-control continuous-integration actionscript-3

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

找出之前是否已经喜欢过开放图形对象

无论如何确定Open Graph中的对象是否已被喜欢?

文档似乎意味着我必须在我的对象上发布类似的操作,并且在之前已经被喜欢时期望错误3501.

从UI pov这没有意义,我想把我喜欢的按钮ui改为"不像"状态,而不必喜欢我的对象,看看它是否失败.

谢谢!

facebook-fql facebook-like facebook-graph-api

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

与Gradle缺少依赖关系?

我正在为一个Android项目启动,这似乎是用Gradle管理的.

说实话,我是Gradle的完全新手,所以我慢慢准备好了.

这是我的gradle包装器的输出:

C:\Users\Daniel\Projects\JustSingIt-Android [feature/no-newrelic +0 ~1 -0]> .\gradlew --info
Starting Build
Settings evaluated using settings file 'C:\Users\Daniel\Projects\JustSingIt-    Android\settings.gradle'.
Projects loaded. Root project using build file 'C:\Users\Daniel\Projects\JustSingIt-Android\build.gradle'.
Included projects: [root project 'JustSingIt-Android', project ':JustSingIt']
Evaluating root project 'JustSingIt-Android' using build file 'C:\Users\Daniel\Projects\JustSingIt-Android\build.grad'.
Evaluating project ':JustSingIt' using build file 'C:\Users\Daniel\Projects\JustSingIt-Android\JustSingIt\build.gradl'
Compiling build file 'C:\Users\Daniel\Projects\JustSingIt-  Android\JustSingIt\build.gradle' using BuildScriptClasspathiptTransformer.
Compiling build file 'C:\Users\Daniel\Projects\JustSingIt-Android\JustSingIt\build.gradle' using BuildScriptTransform

Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to …
Run Code Online (Sandbox Code Playgroud)

android intellij-idea gradle

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

条件之间的差异

只是想知道是否有人可以解释这两个条件之间的区别:

if ( !object ) 

if ( object == null )

where object is an instance of a user-defined class.
Run Code Online (Sandbox Code Playgroud)

我敢肯定这两个不能以可互换的方式使用,或者是吗?

谢谢.

actionscript-3

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

IBOutlet连接和继承

我现在正在编写一个插页式类层次结构的两个问题.

我的插页式广告有一个基类:

  • 基类:JSBaseCustomizeableIntersitialView
  • 子类1:JSInviteFriendsCustomizableIntersititialView
  • 子类2:JSBadgeCustomizableIntersititialView

基类为我将要开发的每个插页式广告保存IBOutlets用于公共UI:标题,描述,"风味"图像和确定/取消按钮.

每个子类在xib文件中都有自己的View,我正在尝试连接到基类上声明的出口.

知道怎么做吗?这是我想要实现的图形示例:

在此输入图像描述

(此处以全屏模式打开图像)

inheritance interface-builder iboutlet ios

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

在测试LinkedLists时编译VS2010中的错误

我正在对LinkedList进行一些测试,它有两个指针:一个指向列表中的下一个项目,另一个指向列表中的随机节点.

这是代码:

struct Node
{
   Node* pNext;      // a pointer to the next node in the list
   Node* pReference; // a pointer to a random node within the list
   int   number;     // an integer value
};

/**
 * This version works for small/medium lists, using recursion.
 */

Node* duplicateList(Node* n)
{
  if (n == NULL) return NULL;

  return new Node()
  {
     number  = n->number,
     pNext  = duplicateList(n->pNext),
     pReference = duplicateList(n->pReference)
  };
} 
Run Code Online (Sandbox Code Playgroud)

我收到以下错误(VS2010):

d:\dornad\my documents\visual studio 2010\projects\test\test.cpp(21): error C2143: syntax …

c++ linked-list data-structures

0
推荐指数
1
解决办法
103
查看次数