我已将'gen'文件夹添加到svn:ignore,还有其他我应该忽略的吗?
更新:
有一些我不确定
.classpath
.project
The .settings folder
Run Code Online (Sandbox Code Playgroud)
而且,要忽略一个文件夹,我只是在subclipse中输入gen进入忽略列表,这是正确的吗?怎么知道gen是文件夹还是文件?
据我了解,分发我的应用程序的三种方式是通过Jar,Android Library和Android Library Project.
Jar - 不能包含资源或XML布局(所以这对我而言)
Android库 - 我真的不知道这是如何工作的,但Google API使用它...
Android库项目 - 包括资源,但允许客户端自由地控制代码,因为它作为源分发.
如果我要创建一个需要绘图和XML文件的封闭源应用程序,我想将其分发给其他Android程序员,我应该使用什么?有人可以指导我创建一个关于创建Android库的教程吗?
我在Android库项目中有一个自定义的PieTimer视图
package com.mysite.android.library.pietimer;
public class PieTimerView extends View {
...
Run Code Online (Sandbox Code Playgroud)
我还有一个XML属性文件,我在PieTimer中使用它
TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.PieTimerView);
Run Code Online (Sandbox Code Playgroud)
XML样式文件如下所示
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="PieTimerView">
<attr name="max_size" format="dimension" />
<attr name="start_angle" format="string" />
<attr name="start_arc" format="string" />
<attr name="ok_color" format="color" />
<attr name="warning_color" format="color" />
<attr name="critical_color" format="color" />
<attr name="background_color" format="color" />
</declare-styleable>
</resources>
Run Code Online (Sandbox Code Playgroud)
我在一个布局文件中有PieTimer用于使用该库的项目,就像这样
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root" android:layout_gravity="center_horizontal"
xmlns:app="http://schemas.android.com/apk/res/com.mysite.android.library.myapp"
xmlns:pie="com.mysite.library.pietimer"
>
<com.mysite.library.pietimer.PieTimerView
pie:start_angle="270"
pie:start_arc="0"
pie:max_size="70dp"
pie:ok_color="#9798AD"
pie:warning_color="#696DC1"
pie:critical_color="#E75757"
pie:background_color="#D3D6FF"
android:visibility="visible"
android:layout_height="wrap_content" android:id="@+id/clock"
android:layout_width="wrap_content"
android:layout_alignParentRight="true">
</com.mysite.library.pietimer.PieTimerView>
Run Code Online (Sandbox Code Playgroud)
以前我用的xmlns:app是属性的命名空间, …
我已经阅读了Ember.js网站上的大多数初学者指南,但我仍然对正确放置东西的地方感到困惑.
路线 - 来自在线研究人员建议在路线中放置路由相关逻辑.这一切都很好,但我唯一能想到的是this.transisionTo().我在其他地方读到所有与模型相关的操作都应该在路径中,因为这model是定义字段的地方.它是否正确?actions在控制器上放置路径有哪些好的用例?
查看 - 目前,我看不到视图的重点.文档说它处理本机DOM事件但我可能总是使用{{action}}将由控制器处理的帮助程序.那么在操作方面使用控制器视图的一些好用例是什么?视图的一些好用例通常考虑我将使用组件而不是视图来获取可重用代码.
控制器 - 在我看来,控制器可以执行View或Route可以执行的任何操作.它可以使用转换this.transitionToRoute(),它可以保存模型使用,this.get('model').save()并可以使用{{action}}帮助程序处理操作.所有初学者教程似乎都完全忽略了视图,而是使用控制器.在View或Route上使用Controller有哪些好的用例?
我想这一切都归结为对一切如何挂起的理解不足.我无法在线或在灰色区域明确的文档中找到任何内容,例如在{{action}}不同场景中使用帮助程序的位置.一些好材料的链接也会有所帮助.
我刚刚使用了proguard,但我试图通过反射实例化的类不起作用.
我有一个界面
Algorithm
Run Code Online (Sandbox Code Playgroud)
我通过这样的课程
AlgorithmFactory.SomeClassThatExtendsAlgorithmImpl.class
Run Code Online (Sandbox Code Playgroud)
该类实例化如下
public ArrayList<Algorithm> getAlgorithms(Context cnx) {
ArrayList<Algorithm> list = new ArrayList<Algorithm>();
for(Class<? extends Algorithm> alg: algorithms) {
try {
Constructor<? extends Algorithm> c = alg.getConstructor(Context.class);
list.add(c.newInstance(cnx));
} catch (IllegalArgumentException e) {
Log.e(TAG, "IllegalArgumentException", e);
throw new IllegalStateException("There was a problem creating the Algorithm class");
} catch (InvocationTargetException e) {
Log.e(TAG, "InvocationTargetException", e);
throw new IllegalStateException("There was a problem creating the Algorithm class");
} catch (InstantiationException e) {
Log.e(TAG, "InstantiationException", e);
throw new IllegalStateException("There was a …Run Code Online (Sandbox Code Playgroud) 我有一个下载一些文件的IntentService.问题是我在IntentService中创建了一个Toast
Toast.makeText(getApplicationContext(), "some message", Toast.LENGTH_SHORT).show();
Run Code Online (Sandbox Code Playgroud)
如果我退出应用程序,Toast将永远不会消失.摧毁它的唯一方法就是杀死这个过程.
我究竟做错了什么?
我正在考虑创建一个核心应用程序库(一个包含所有逻辑的库项目),一个免费版本)和一个使用该库的完整版本.
据我所知,清单中的一些东西不像权限和活动那样合并,版本代码是否合并?我可以在库中放置单个版本代码以应用于免费版和付费版吗?
第二个问题是,我当前的应用程序(我将变成一个Android库)取决于一个库,因此如果我把它变成一个库,据我所知,你不能让一个库从库中继承.我该如何解决这个问题?
在常规车把我能够做到:
<div {{bind-attr class="model.isNew:new:old"}}>
Run Code Online (Sandbox Code Playgroud)
我怎么能在Htmlbars中这样做?我尝试了这个,但它没有用.
<div class="{{model.isNew:new:old}}">
Run Code Online (Sandbox Code Playgroud) 如何对每个选定的列表项执行此操作.
我试过把它添加到 android:background
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true"
android:state_pressed="false"
android:drawable="@color/android_green" />
<item android:state_focused="true"
android:state_pressed="true"
android:drawable="@color/black_alpha" />
<item android:state_focused="false"
android:state_pressed="true"
android:drawable="@color/black_alpha" />
<item android:drawable="@color/white_alpha" />
</selector>
Run Code Online (Sandbox Code Playgroud)
但它不起作用,它改变了整个ListView.
仍然没有工作,这是我到目前为止
:: listview_background
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:drawable="@color/black_alpha" />
<item android:drawable="@color/white_alpha" />
</selector>
Run Code Online (Sandbox Code Playgroud)
::我的观点正在使用上述内容
<ListView android:id="@+id/list" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_below="@+id/round"
android:listSelector="@drawable/listview_background">
</ListView>
Run Code Online (Sandbox Code Playgroud)
问题是black_alpha将应用整个列表,而不仅仅是选定的列表项
将Context传递给构造函数并将其保存为私有变量供内部使用是不好的做法吗?另一种选择是将Context作为参数传递给需要它的方法.
哪个更好?我有一种感觉,传递给构造函数可能会导致内存泄漏意外.
android ×8
ember.js ×2
htmlbars ×1
java ×1
memory-leaks ×1
obfuscation ×1
proguard ×1
reflection ×1
svn ×1