小编TWi*_*lly的帖子

Android Studio - 无法刷新Gradle项目 - 找不到目标4.4w

在此输入图像描述

我正在尝试将我的项目从eclipse转移到android studio,以便我可以开始构建一个android穿戴应用程序.我从eclipse导出应用程序并将其导入android studio.但是,当我尝试添加android磨损应用程序时,我开始收到错误消息"找不到目标4.4w"看屏幕截图.

创建全新项目时,不会发生此错误.我注意到我仍然在android api 19上运行外部库,但我无法升级它,因为它无法找到它.

4.4w是通过sdk管理器安装的,为什么android studio不能看到这个?

android android-studio wear-os

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

使用推送通知IntentService中的GoogleApiClient将数据发送到Android Wear

这是一个跟进问题... Android Wear捆绑通知和背景图像

我想创建一个Android Wear GridViewPager布局,当新的推送通知进入时,它会被创建.

下面是我的代码,当新消息进入时初始化GoogleApiClient连接,然后我可以将数据发送到Wear应用程序,然后创建GridView寻呼机.

我的问题是GoogleApiClient永远不会得到连接.我已成功运行sdk文件夹中的SynchonizedNotifications示例应用程序,因此我知道我的设备和手表已正确配对.

以下是当前代码......

public class GCMIntentService extends IntentService implements GoogleApiClient.ConnectionCallbacks,
    GoogleApiClient.OnConnectionFailedListener{

    @Override
    protected void onHandleIntent(Context context, Intent intent) {

        mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addApi(Wearable.API)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .build();

        ConnectionResult connectionResult =   mGoogleApiClient.blockingConnect(30, TimeUnit.SECONDS);

        // Extract the payload from the message
        Bundle extras = intent.getExtras();
        if (this.mGoogleApiClient.isConnected())        {

           // sending a simple message works
           MessageApi.SendMessageResult result = Wearable.MessageApi.sendMessage(mGoogleApiClient,
                node.getId(), "path", null).await();

            PutDataMapRequest putDataMapRequest = PutDataMapRequest.create(Constants.BOTH_PATH);
            putDataMapRequest.getDataMap().putString(Constants.KEY_CONTENT, "content");
            putDataMapRequest.getDataMap().putString(Constants.KEY_TITLE, "title");
            PutDataRequest request = putDataMapRequest.asPutDataRequest();

            // push data …
Run Code Online (Sandbox Code Playgroud)

android push-notification android-gridview wear-os

5
推荐指数
2
解决办法
2725
查看次数

Android Wear - 从手持动作开始磨损活动

我正在从Android手持设备向android服装设备发送通知.我想在android设备上添加一个启动活动的通知操作.

如何将待处理意图设置为磨损设备上的活动?如果在可穿戴设备上创建通知,我可以启动活动,但如果通知是在手机上创建然后发送到可穿戴设备,则无法启动.

 // creating action for push notification created on handheld
 public NotificationCompat.Action CreateWearAppAction(Integer metricId) {
    // I wasnt able to look up the wear's main activity class since this is in the handheld project.
    Intent wearPageIntent = new Intent(Intent.ACTION_VIEW);
    Uri wearUri = Uri.parse("mywearapp://Test?MetricId=" + metricId);
    wearPageIntent.setData(wearUri);
    PendingIntent wearPagePendingIntent = PendingIntent.getActivity(context, 0, wearPageIntent, 0);

    return new NotificationCompat.Action.Builder(R.drawable.ic_action_metric,
            "Open Charts on Wear", wearPagePendingIntent)
            .build();
}
Run Code Online (Sandbox Code Playgroud)

我正在尝试推出的磨损应用程序的活动清单:

    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:noHistory="true"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

        <!-- deep …
Run Code Online (Sandbox Code Playgroud)

android android-notifications wear-os

5
推荐指数
2
解决办法
4659
查看次数

Android Gradle 1.0计算多风味设置中的版本代码

计算不同产品风格的版本代码的代码不再适用于Android Gradle 1.0系统.我成功之前使用了下面的示例代码.

http://tools.android.com/tech-docs/new-build-system/tips#TOC-Computing-Version-code-in-multi-flavor-setup.

productFlavors.get(0).versionCode现在计算为null.

Gradle代码..

android {

  buildscript {
    repositories {
      mavenCentral()
    }
    dependencies {
      classpath 'com.android.tools.build:gradle:1.0.0'
    }
  }

  // This actual the app version code. Our given range is [0, 99999]
  defaultConfig.versionCode = 123

  // 2 dimensions of flavors. API is more important than ABI.
  flavorGroups "api", "abi"

  productFlavors {
    gingerbread {
      flavorGroup "api"
      minSdkVersion 10
      versionCode = 1
    }
    icecreamSandwich {
      flavorGroup "api"
      minSdkVersion 14
      // this must be higher than the gingerbread version to ensure …
Run Code Online (Sandbox Code Playgroud)

android android-gradle-plugin

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

gulp任务,动态创建名称基于文件名的文件夹

我有以下gulp任务,目前无法正常工作.

gulp.task('emails', function() {
  gulp.src('views/emails/src/**/*.html')
    .pipe(inky())
    .pipe(gulp.dest('views/emails/dist/'+debug()+"/html.ejs"));
});
Run Code Online (Sandbox Code Playgroud)

我想遍历/ views/emails/src /目录,查找所有html文件,然后使用inky将它们转换为html,然后将生成的html文件复制到...

views/emails/dist/'+ folderName +"/html.ejs
Run Code Online (Sandbox Code Playgroud)

其中folderName是已处理的.html文件的名称.

我需要这个,以获得npm email-templates包所需格式的文件结构.

node.js npm zurb-foundation gulp inky

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

Azure Powershell获取暂存云服务的公共IP

我正在使用这个答案来查找我们的云服务的公共IP.

Azure Powershell:获取公共虚拟服务IP

这仅返回生产云服务的端点.我们还需要轻松查找我们的暂存云服务端点.

有谁知道如何使用Azure Powershell查找这些内容?

谢谢!

powershell azure

2
推荐指数
2
解决办法
1757
查看次数

Dynamics CRM 2015 - 通过javascript更新商机所有者ID

我正在尝试使用Dynamics CRM 2015中的机会更新OwnerId.

到目前为止,我使用以下代码,但我的更改未生效.

Xrm.Page.data.entity.attributes.get('ownerid').setValue('487ecd0c-d8c1-e411-80eb-c4346bade4b0')
Xrm.Page.data.entity.save();
Run Code Online (Sandbox Code Playgroud)

这是GetValue调用的视图.

在此输入图像描述

属性类型是"lookup",当我调用getIsDirty()时,它在我执行setValue后返回false,所以我不确定这是否是在"lookup"类型上设置值的正确方法.

dynamics-crm dynamics-crm-2015

2
推荐指数
1
解决办法
2068
查看次数