下面是我的xml文件.它的名字是main.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageView android:id="@+id/imageView" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:src="@drawable/icon"
android:scaleType="matrix">
</ImageView>
<ImageView android:id="@+id/imageView1" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:src="@drawable/bg_sound"
android:scaleType="matrix"></ImageView>
</FrameLayout>
Run Code Online (Sandbox Code Playgroud)
我的Java文件在下面
import android.app.Activity;
import android.graphics.Matrix;
import android.graphics.PointF;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.FloatMath;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.ImageView;
public class Test1Activity extends Activity implements OnTouchListener {
private static final String TAG = "Touch";
// These matrices will be used to move and zoom image
Matrix matrix = new Matrix();
Matrix savedMatrix = new …Run Code Online (Sandbox Code Playgroud) (已解决 - 见下面的评论)
我有一个实现多部分文件上传的类.代码适用于我尝试过的每个java客户端,除了Android,它是我的Android应用程序中唯一不能与我的后端服务配合使用的HTTP请求代码.
连接responseCode是"-1"所以这里有一些非常讨厌的东西.在Apache访问或错误日志中没有显示任何条目,似乎请求永远不会脱离Android平台.代码通过连接写入正确,但挂起连接读取,超时然后返回.真实手机和模拟器的行为是相同的.
有没有人知道在Android中发布多部分文件时需要注意的任何问题?
我包括下面的课程(制作的小卫生模型),所以你可以看到我在做什么
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
public class GeoPictureUploader
{
static String serviceDomain = "http://staging.abaqus.net";
static String postUrl = serviceDomain + "/geo/upl/wupload/pictures";
static String CRLF = "\r\n";
static String twoHyphens = "--";
static String boundary = "*****mgd*****";
private String pictureFileName = null;
private String name = null;
private String password = null;
private DataOutputStream dataStream = null;
enum ReturnCode …Run Code Online (Sandbox Code Playgroud) 这真的开始让我发疯.
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@id+/textview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/hello"/>
Run Code Online (Sandbox Code Playgroud)
产生以下错误消息:" Error: no resource found that matches the given name (at 'id' with value '@id+/textview').
这是从Android hello world 示例中复制和粘贴的 .
如果有人能解释是否可以在EditText中输入文本,我将非常感激.(这将完成 android:text="")
但是当用户在其中单击时,文本将消失.
谢谢
在颜色选择器中,我有3个用于色调,饱和度和值的SeekBars.在这些SeekBars上调用setProgressDrawable只能运行一次 - 在onCreate初始化时.当用户更新Hue SeekBar时,我想为Saturation和Value SeekBars调用setProgressDrawable,以向用户显示新Hue的颜色选择.
但是所有对setProgressDrawable的调用(在最初的调用之后onCreate)导致SeekBar被清空.
如何根据用户输入更新SeekBars的背景渐变?
我知道可以使用唤醒锁来保持屏幕,cpu等,但我怎样才能以编程方式更改Android手机上的" 屏幕超时 "设置.
所以,我的"Utility"一些项目中有一些样式类.我很好奇我是否可以将它们移动到包含我所有或大部分非特定应用胶水代码(主要是包装和接口)的Android库项目.
所以,我的问题是该库中不需要的文件会发生什么.我知道Android Library Projects基本上只是将他们的代码复制到另一个项目中,所以如果我说在我的"通用"库中使用25%的代码,我的应用程序实际上是否包含所有100%的字节码,或者它是否正确剥离这只是我需要的东西.
我过去在Proguard中遇到了一些未使用过的课程的问题,所以我现在只是曾经被咬过一次,两次因为ADT而害羞......
我正在开发一个Android应用程序,需要对几个数据文件进行操作30MB.我把测试放在一起,模拟器失败了OutOfDiskSpace.即使数据量较小,设备上的调试也会失败.阅读谷歌群组后,似乎没有在任何地方说明应用程序大小限制,谷歌的任何人都没有详细说明.鉴于iPhone应用程序的100MB规模过大,对Android应用程序施加如此小的限制似乎很奇怪,只是因为您拥有相对较少的总可用应用程序存储空间(< 100MB).
现在我的问题:
您使用什么技术来处理此限制?如果您的应用程序需要超过10MB,您是否将其放在Web服务器上并首次处理下载?如果是这样,您如何处理访问控制,以便只有您的应用程序可以获取数据?
有没有办法可以在任何给定时间找到特定ImageButton设置的资源?
例如:我有一个我设置为R.drawable.btn_ononCreate 的ImageButton .稍后,在某些时候,ImageButton被设置为R.drawable.btn_off.我希望能够在我的代码中检查ImageButton设置的资源.
谢谢克里斯
有谁知道我可以在哪里获得免版税图片(Preferably High Quality)为背景?我需要这些用于我目前正在开发的Android应用程序.