小编Akh*_*ain的帖子

Jenkins/Hudson上游工作没有获得下游工作的"球"颜色状态

我有一个上游工作,执行4个下游工作.

如果上游作业成功完成,则下游作业开始执行.

上游工作,因为它成功完成,获得一个蓝色球(构建结果=稳定),但即使下游工作失败(红球)或不稳定(黄球),上游工作仍然保持其蓝色.

无论如何都要让上游作业的结果依赖于下游作业?我的意思是,如果三个下游作业得到稳定的构建但其中一个得到不稳定的构建,则上游构建结果应该是不稳定的.

continuous-integration hudson hudson-plugins jenkins

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

ADT插件安装问题Eclipse 3.7 Ubuntu 11.10

我正在尝试为Eclipse 3.7和Ubuntu 11.10安装Android SDK和ADT Plugiun.

  1. 我已下载android-sdk_r15-linux.tgz并解压缩到/home/user/android-sdk-linux
  2. 我浏览到/home/user/android-sdk-linux/tools并提到在终端的android跑这里第4步
  3. 然后我下载了所有平台和其他组件.
  4. 我进入了Eclipse并帮助 - >安装新软件并成功添加了Google Android 站点并检查了开发人员工具,当我这样做时,我得到的是:

    无法完成安装,因为找不到一个或多个必需的项目.
    正在安装的软件:Android开发工具15.0.0.v201110251216-213216(com.android.ide.eclipse.adt.feature.group 15.0.0.v201110251216-213216)
    缺少要求:Android开发工具15.0.0.v201110251216-213216( com.android.ide.eclipse.adt.feature.group 15.0.0.v201110251216-213216)需要'org.eclipse.wst.sse.core 0.0.0'但无法找到

我之前已经在Ubuntu 10.04上安装了它并且它工作正常.我错过了什么.

PS当我进入Eclipse并转到Window - > Preferences时,我不会在左侧看到Android作为选项,其他选项让我感到困惑.

我是否需要使用从developer.android.com下载的tar.gz文件执行其他操作?

ubuntu android adt

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

设置Toast到视图的动态位置

首先,这不是完整的代码

@Override
    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) 
    {
        Toast toast=Toast.makeText(getApplicationContext(), "", Toast.LENGTH_SHORT);
        toast.setGravity(Gravity.CENTER_HORIZONTAL, 0, 0); 
        View view=toast.getView();
        switch(buttonView.getId())
        {
            case R.id.chkRed: if(chkRed.isChecked())
            {   
                              chkGreen.setChecked(false);
                              chkBlue.setChecked(false);
                              chkYellow.setChecked(false);
                              toast.setText("You Selected Red");
                                toast.setGravity(Gravity.NO_GRAVITY,buttonView.getRight(), chkRed.getTop());
                             //top does not align
                             //it align perfectly to right of checkbox
                              view.setBackgroundColor(Color.RED);
            }
                             break;
}
}
Run Code Online (Sandbox Code Playgroud)

所以现在,问题是,我想在复选框旁边显示烤面包,我尝试使用setGravity(),但它只是没有进行操作并且已经被击中并尝试了很长时间,但没有进展

如何在复选框旁边显示吐司.

checkbox events android toast

8
推荐指数
1
解决办法
3649
查看次数

针对包结构问题的Android最佳做法

基于

我做了以下Android包结构:

  • com.company.product.activities

  • com.company.product.database

  • com.company.product.fragments

  • com.company.product.fragments.adapters

  • com.company.product.models

但有时,根据要求,我需要为自定义对话框提供适配器.

我应该把它放在哪里?因为它是一个小型适配器,所以它主要用在对话框中的活动中,操作反映回活动.

面临的问题是:

  1. 将过多的上下文(Activity)引用传递给适配器.

  2. 所有方法最终都是公开的,这违反了隐藏实现细节的OOP概念.

  3. 私有适配器和包装结构有多大区别?这是Android项目包结构的标准方法吗?

standards android project-structure package

8
推荐指数
1
解决办法
6956
查看次数

导入com.google.android.gms时出错.*;

我正在尝试在链接中实现解决方案

需要导入这些:

import com.google.android.gms.common.ConnectionResult;  
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.common.GooglePlayServicesClient.ConnectionCallbacks; 
import com.google.android.gms.common.GooglePlayServicesClient.OnConnectionFailedListener; import com.google.android.gms.location.ActivityRecognitionClient;
Run Code Online (Sandbox Code Playgroud)

我无法编译因为eclipse无法识别

 "com.google.android.gms."......
Run Code Online (Sandbox Code Playgroud)

还将SDK和google API更新到最新版(4.3)

仍然无法导入包.

java sdk android google-api importerror

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

设置可拖动对象的边界限制

我有两个要素:

1.身高固定的父母,overflow:hidden

2.它的孩子更大的固定高度.

<style type="text/css">
    .myList {list-style:none; margin:0px; padding:1px;}
    .myList li{ height:50px;  margin:4px; padding:2px;}
    .dragPanel {height:230px; border:solid; overflow:hidden;}
</style>

<div class="dragPanel">
    <ul class="myList">
        <li>1</li>
        <li>2</li>
        ...   ....
        <li>8</li>
        <li>9</li>
    </ul>
</div>
Run Code Online (Sandbox Code Playgroud)

我希望能够在父div中上下拖动列表.我使用jquery ui draggable插件来实现Verticle拖动,但我不确定如何约束父div中的列表.

<script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.3.2.js"></script>
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.core.js"></script>
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.draggable.js"></script>

<script type="text/javascript">
    $(document).ready(function() {
        $('.dragPanel').addClass("hover");
        $('.myList').draggable({ axis: 'y' });
    });
</script>
Run Code Online (Sandbox Code Playgroud)

我如何为列表的位置设置Verticle上限和下限?

javascript jquery jquery-ui draggable

7
推荐指数
3
解决办法
3万
查看次数

Android:如何获取我的应用程序的所有首选项xml的列表并阅读它们?

如何获取应用程序的所有应用程序首选项列表,

1.我保存共享偏好以这种方式用于将键值对保存在所需首选项xml中的活动

2.我知道,他们是在data/data/app_packagename/shared_prefs 首选项Xml的shared_pref文件夹


3.问题:但是如何在微调器中获取所有首选xml文件的列表 在此输入图像描述

并阅读每个偏好,我搜索了SO,但我没有找到任何关于此的帮助,如何读取我的应用程序目录中的所有首选项xml文件并访问首选项?

PS:我知道 SharedPreference.getAll();,一旦我拿到文件就足够了吗?

我写过比特(粗略代码),它试图运行时给出错误,这里是实现的方法

void getList()
{
  //will be invoked from onCreate to populate spinner,yes spinner is already binded
   PackageManager m = getPackageManager();
        String s = getPackageName();
        try {
            PackageInfo p = m.getPackageInfo(s, 0);
            s = p.applicationInfo.dataDir;
        } catch (NameNotFoundException e) {
            Log.w("yourtag", "Error Package name not found ", e);
        }
        Log.i("dir", s=s+"/shared_prefs");
     //is this write way, how to proceed from here
}
Run Code Online (Sandbox Code Playgroud)

android readfile android-preferences sharedpreferences android-file

7
推荐指数
1
解决办法
8134
查看次数

Widget中的图像

我正在尝试在onUpdate中的窗口小部件布局中的图像视图中设置图像,但图像未更新

 @Override
     public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) 
     {
         Log.i(TAG, "onUpdate called");
         for (int appWidgetId : appWidgetIds) 
         {
             Bitmap bitmap=ImageUtils.getBitmap(context, appWidgetId);
             RemoteViews remoteView = new RemoteViews(context.getPackageName(), R.layout.widget);

             remoteView.setImageViewBitmap(R.id.imgView,bitmap);
             appWidgetManager.updateAppWidget(appWidgetId, remoteView);
         }
     }
Run Code Online (Sandbox Code Playgroud)

小部件的xml布局

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/imgView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:src="@drawable/ic_launcher" />

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

清单文件

<application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.demo.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
         <activity
             android:name=".WidgetConfig"
             android:label="@string/app_name" >
             <intent-filter>
                  <action
                    android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
             </intent-filter>
         </activity>
        <receiver
            android:name="BasicWidgetProvider"> …
Run Code Online (Sandbox Code Playgroud)

android android-widget remoteview appwidgetprovider android-appwidget

7
推荐指数
1
解决办法
1784
查看次数

带有小部件片段的选项卡式对话框

我正在处理小部件,我在寻找小部件设置,我希望提供一个带有标签片段的对话框,问题是对话框没有操作栏标签,我尝试了各种布局模式,但它们似乎都没有工作.

  1. 在清单中,已经做了活动

    <activity android:theme="@android:style/Theme.Dialog"  android:launchMode="singleInstance"
              android:name="WidgetConfigureActivity"></activity>
    
    Run Code Online (Sandbox Code Playgroud)
  2. 我不确定,在UI中使用哪种布局正好使用ViewPager,FragmentTabHost,基本上不清楚要采用哪种布局.

  3. WidgetConfigureActivity FragmentActivity现在扩展,下面是它的代码(代码取自FragmentTabHost)

    FragmentTabHost mTabHost;
    @Override
    protected void onCreate(Bundle arg0) {
        super.onCreate(arg0);
        setContentView(R.layout.widget_configure_activity);
        mTabHost = (FragmentTabHost)findViewById(android.R.id.tabhost);
        mTabHost.setup(this, getSupportFragmentManager(), R.id.tabhost);
        //this above setup line gives error => (The method setup(Context, FragmentManager, int) in the type FragmentTabHost is not applicable for the arguments (WidgetConfigureActivity, FragmentManager, int))
        mTabHost.addTab(mTabHost.newTabSpec("simple").setIndicator("Simple"),
                MyFragment.class, null);
    }
    
    Run Code Online (Sandbox Code Playgroud)

ViewPager并不重要,但如何使用带有片段的标签对话框是个问题?

4.即使应用于Theme.Dialog我的活动,如何使UI /布局不改变,所有字体在白色背景中显示为白色?(我通过倾斜屏幕看到了文字)

android android-widget android-layout android-fragments fragment-tab-host

7
推荐指数
1
解决办法
1116
查看次数

你如何调试android'apapt failed'错误

我收到此错误,我现在不知道如何恢复它.有没有人有解决方案?

Gradle:任务':SGMA:processDebugResources'的执行失败.运行C:\ Users\lenovo\AppData\Local\Android\android-studio\sdk\build-tools\android-4.2.2\aapt.exe失败.见输出

android

7
推荐指数
1
解决办法
4981
查看次数