android问题

1.URI   URL是什么?


2.任务是什么   任务和进程有啥关系  有啥区别


3.adapter 到底是个什么



4.intent.setclass  

intent.setClass(Activity01.this, Activity02.class);

示意代码:

       <activity android:name=".Activity01"
                  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="Activity02"></activity>

根据intent 匹配机制发现应该无法匹配到,intent.setClass(Activity01.this, Activity02.class);

这个猜测初始组件到指向组件

5.设置时间的弹出窗口,我去设置时间发现会弹出2次TOAST

m_dpButton.setOnClickListener(new Button.OnClickListener(){
            public void onClick(View v)
            {
                new DatePickerDialog(Activity01.this,
                    new DatePickerDialog.OnDateSetListener()
                    {
                        public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth)
                        {
                            showToast("设置日期弹出窗口:"+year+"年"+monthOfYear+"月"+dayOfMonth+"日");
                        }
                    },c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH)).show();
            }
        });


下面是我的提示方法

    public void showToast(String str){
        num++;
        Toast.makeText(this, str+"   ID:"+num, Toast.LENGTH_SHORT).show();
    }


package com.yarin.android.Examples_04_11;

import java.util.Calendar;

import android.R.integer;
import android.app.Activity;
import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;

public class Activity01 extends Activity
{
    TextView    m_TextView;
    DatePicker    m_DatePicker;
    TimePicker    m_TimePicker;
    Button         m_dpButton;
    Button         m_tpButton;
    Calendar     c;
    
    int num=0;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);   
        c=Calendar.getInstance();
      
        m_TextView= (TextView) findViewById(R.id.TextView01);
        m_dpButton = (Button)findViewById(R.id.button1);
        m_tpButton = (Button)findViewById(R.id.button2);
       
        m_DatePicker = (DatePicker) findViewById(R.id.DatePicker01);
        m_DatePicker.init(c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH), new DatePicker.OnDateChangedListener() {
            @Override
            public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth)
            {
                showToast("日期控件设置日期:"+year+"年"+monthOfYear+"月"+dayOfMonth+"日");//弹出两次提示
            }
        });

        m_TimePicker = (TimePicker) findViewById(R.id.TimePicker01);
        m_TimePicker.setIs24HourView(true);

        m_TimePicker.setOnTimeChangedListener(new TimePicker.OnTimeChangedListener() {
            @Override
            public void onTimeChanged(TimePicker view, int hourOfDay, int minute)
            {

                //c.set(year, month, day, hourOfDay, minute, second);
                showToast("时间控件设置时间:"+hourOfDay+":"+minute);//这个只弹出一次提示
            }
        });
        
        
        m_dpButton.setOnClickListener(new Button.OnClickListener(){
            public void onClick(View v)
            {
                new DatePickerDialog(Activity01.this,
                    new DatePickerDialog.OnDateSetListener()
                    {
                        public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth)
                        {
                            showToast("设置日期弹出窗口:"+year+"年"+monthOfYear+"月"+dayOfMonth+"日");//弹出两次提示
                        }
                    },c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH)).show();
            }
        });
        
        m_tpButton.setOnClickListener(new Button.OnClickListener() {
            public void onClick(View v)
            {
                new TimePickerDialog(Activity01.this,
                    new TimePickerDialog.OnTimeSetListener()
                    {
                        public void onTimeSet(TimePicker view, int hourOfDay,int minute)
                        {
                            showToast("设置时间弹出窗口:"+hourOfDay+":"+minute);//弹出两次提示
                        }
                    },c.get(Calendar.HOUR_OF_DAY), c.get(Calendar.MINUTE), true).show();
            }
        });
    }
    
    public void showToast(String str){
        num++;
        Toast.makeText(this, str+"   ID:"+num, Toast.LENGTH_SHORT).show();
    }
}






6.FRAME动画制作内存泄漏

05-21 08:41:05.367: D/dalvikvm(1480): GC_FOR_ALLOC freed 56K, 7% free 2663K/2840K, paused 134ms, total 137ms
05-21 08:41:05.377: I/dalvikvm-heap(1480): Grow heap (frag case) to 3.322MB for 635812-byte allocation
05-21 08:41:05.407: D/dalvikvm(1480): GC_FOR_ALLOC freed 4K, 6% free 3279K/3464K, paused 34ms, total 34ms
05-21 08:41:05.467: D/dalvikvm(1480): GC_CONCURRENT freed <1K, 5% free 3300K/3464K, paused 13ms+20ms, total 56ms
05-21 08:41:06.057: I/Choreographer(1480): Skipped 96 frames!  The application may be doing too much work on its main thread.
05-21 08:41:06.067: D/gralloc_goldfish(1480): Emulator without GPU emulation detected.
05-21 08:41:12.768: I/System.out(1480): 1
05-21 08:41:12.967: D/dalvikvm(1480): GC_FOR_ALLOC freed 49K, 5% free 3443K/3612K, paused 72ms, total 107ms
05-21 08:41:13.027: I/dalvikvm-heap(1480): Grow heap (frag case) to 4.568MB for 1143424-byte allocation
05-21 08:41:13.127: D/dalvikvm(1480): GC_CONCURRENT freed 12K, 4% free 4547K/4732K, paused 15ms+3ms, total 102ms
05-21 08:41:13.127: D/dalvikvm(1480): WAIT_FOR_CONCURRENT_GC blocked 14ms
05-21 08:41:13.217: D/dalvikvm(1480): GC_FOR_ALLOC freed 2K, 4% free 4545K/4732K, paused 82ms, total 82ms
05-21 08:41:13.267: I/dalvikvm-heap(1480): Grow heap (frag case) to 7.007MB for 2572684-byte allocation
05-21 08:41:13.367: D/dalvikvm(1480): GC_FOR_ALLOC freed <1K, 3% free 7057K/7248K, paused 94ms, total 94ms
05-21 08:41:13.397: D/dalvikvm(1480): GC_CONCURRENT freed 0K, 3% free 7057K/7248K, paused 4ms+3ms, total 36ms
05-21 08:41:13.477: D/dalvikvm(1480): GC_FOR_ALLOC freed 1116K, 16% free 7058K/8368K, paused 21ms, total 22ms
05-21 08:41:13.497: I/dalvikvm-heap(1480): Grow heap (frag case) to 9.461MB for 2572684-byte allocation
05-21 08:41:13.547: D/dalvikvm(1480): GC_CONCURRENT freed <1K, 13% free 9570K/10884K, paused 4ms+3ms, total 49ms
05-21 08:41:13.618: D/dalvikvm(1480): GC_FOR_ALLOC freed 1116K, 13% free 9571K/10884K, paused 21ms, total 21ms
05-21 08:41:13.628: I/dalvikvm-heap(1480): Grow heap (frag case) to 11.915MB for 2572684-byte allocation
05-21 08:41:13.678: D/dalvikvm(1480): GC_CONCURRENT freed <1K, 10% free 12083K/13400K, paused 5ms+14ms, total 51ms
05-21 08:41:13.758: D/dalvikvm(1480): GC_FOR_ALLOC freed 1116K, 10% free 12084K/13400K, paused 24ms, total 24ms
05-21 08:41:13.768: I/dalvikvm-heap(1480): Grow heap (frag case) to 14.369MB for 2572684-byte allocation
05-21 08:41:13.838: D/dalvikvm(1480): GC_CONCURRENT freed <1K, 9% free 14596K/15916K, paused 4ms+15ms, total 64ms
05-21 08:41:13.897: D/dalvikvm(1480): GC_FOR_ALLOC freed 1116K, 9% free 14597K/15916K, paused 24ms, total 25ms
05-21 08:41:13.907: I/dalvikvm-heap(1480): Grow heap (frag case) to 16.823MB for 2572684-byte allocation
05-21 08:41:13.978: D/dalvikvm(1480): GC_CONCURRENT freed <1K, 8% free 17109K/18432K, paused 3ms+4ms, total 63ms
05-21 08:41:14.037: D/dalvikvm(1480): GC_FOR_ALLOC freed 1116K, 8% free 17110K/18432K, paused 25ms, total 26ms
05-21 08:41:14.057: I/dalvikvm-heap(1480): Grow heap (frag case) to 19.277MB for 2572684-byte allocation
05-21 08:41:14.127: D/dalvikvm(1480): GC_CONCURRENT freed <1K, 7% free 19622K/20948K, paused 4ms+4ms, total 68ms
05-21 08:41:14.187: D/dalvikvm(1480): GC_FOR_ALLOC freed 1116K, 7% free 19623K/20948K, paused 26ms, total 26ms
05-21 08:41:14.197: I/dalvikvm-heap(1480): Grow heap (frag case) to 21.731MB for 2572684-byte allocation
05-21 08:41:14.277: D/dalvikvm(1480): GC_CONCURRENT freed <1K, 6% free 22135K/23464K, paused 4ms+5ms, total 71ms
05-21 08:41:14.347: D/dalvikvm(1480): GC_FOR_ALLOC freed 1116K, 6% free 22135K/23464K, paused 33ms, total 34ms
05-21 08:41:14.357: I/dalvikvm-heap(1480): Grow heap (frag case) to 24.185MB for 2572684-byte allocation
05-21 08:41:14.437: D/dalvikvm(1480): GC_CONCURRENT freed <1K, 6% free 24648K/25980K, paused 5ms+16ms, total 74ms
05-21 08:41:14.497: D/dalvikvm(1480): GC_FOR_ALLOC freed 1116K, 6% free 24648K/25980K, paused 29ms, total 31ms
05-21 08:41:14.507: I/dalvikvm-heap(1480): Grow heap (frag case) to 26.639MB for 2572684-byte allocation
05-21 08:41:14.598: D/dalvikvm(1480): GC_CONCURRENT freed <1K, 5% free 27161K/28496K, paused 4ms+6ms, total 88ms
05-21 08:41:14.668: D/dalvikvm(1480): GC_FOR_ALLOC freed 1116K, 5% free 27161K/28496K, paused 33ms, total 33ms
05-21 08:41:14.688: I/dalvikvm-heap(1480): Grow heap (frag case) to 29.093MB for 2572684-byte allocation
05-21 08:41:14.758: D/dalvikvm(1480): GC_CONCURRENT freed <1K, 5% free 29674K/31012K, paused 4ms+16ms, total 74ms
05-21 08:41:14.828: D/dalvikvm(1480): GC_FOR_ALLOC freed 1116K, 5% free 29674K/31012K, paused 33ms, total 34ms
05-21 08:41:14.828: I/dalvikvm-heap(1480): Forcing collection of SoftReferences for 2572684-byte allocation
05-21 08:41:14.878: D/dalvikvm(1480): GC_BEFORE_OOM freed 9K, 5% free 29665K/31012K, paused 49ms, total 49ms
05-21 08:41:14.878: E/dalvikvm-heap(1480): Out of memory on a 2572684-byte allocation.
05-21 08:41:14.887: I/dalvikvm(1480): "main" prio=5 tid=1 RUNNABLE
05-21 08:41:14.887: I/dalvikvm(1480):   | group="main" sCount=0 dsCount=0 obj=0x40a729a0 self=0x2a00bba8
05-21 08:41:14.887: I/dalvikvm(1480):   | sysTid=1480 nice=0 sched=0/0 cgrp=apps handle=1073849308
05-21 08:41:14.887: I/dalvikvm(1480):   | state=R schedstat=( 2212239619 3213156345 1193 ) utm=175 stm=46 core=0
05-21 08:41:14.887: I/dalvikvm(1480):   at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
05-21 08:41:14.887: I/dalvikvm(1480):   at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
05-21 08:41:14.887: I/dalvikvm(1480):   at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
05-21 08:41:14.887: I/dalvikvm(1480):   at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:785)
05-21 08:41:14.887: I/dalvikvm(1480):   at android.content.res.Resources.loadDrawable(Resources.java:1965)
05-21 08:41:14.887: I/dalvikvm(1480):   at android.content.res.Resources.getDrawable(Resources.java:660)
05-21 08:41:14.887: I/dalvikvm(1480):   at android.graphics.drawable.AnimationDrawable.inflate(AnimationDrawable.java:282)
05-21 08:41:14.887: I/dalvikvm(1480):   at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:885)
05-21 08:41:14.887: I/dalvikvm(1480):   at android.graphics.drawable.Drawable.createFromXml(Drawable.java:822)
05-21 08:41:14.887: I/dalvikvm(1480):   at android.content.res.Resources.loadDrawable(Resources.java:1950)
05-21 08:41:14.887: I/dalvikvm(1480):   at android.content.res.Resources.getDrawable(Resources.java:660)
05-21 08:41:14.887: I/dalvikvm(1480):   at android.view.View.setBackgroundResource(View.java:14468)
05-21 08:41:14.897: I/dalvikvm(1480):   at com.example.mysecondapp.LoginActivity.onWindowFocusChanged(LoginActivity.java:170)
05-21 08:41:14.897: I/dalvikvm(1480):   at com.android.internal.policy.impl.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:2451)
05-21 08:41:14.897: I/dalvikvm(1480):   at android.view.View.dispatchWindowFocusChanged(View.java:7440)
05-21 08:41:14.897: I/dalvikvm(1480):   at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:930)
05-21 08:41:14.897: I/dalvikvm(1480):   at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:2927)
05-21 08:41:14.897: I/dalvikvm(1480):   at android.os.Handler.dispatchMessage(Handler.java:99)
05-21 08:41:14.897: I/dalvikvm(1480):   at android.os.Looper.loop(Looper.java:137)
05-21 08:41:14.897: I/dalvikvm(1480):   at android.app.ActivityThread.main(ActivityThread.java:5041)
05-21 08:41:14.897: I/dalvikvm(1480):   at java.lang.reflect.Method.invokeNative(Native Method)
05-21 08:41:14.897: I/dalvikvm(1480):   at java.lang.reflect.Method.invoke(Method.java:511)
05-21 08:41:14.897: I/dalvikvm(1480):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
05-21 08:41:14.897: I/dalvikvm(1480):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
05-21 08:41:14.897: I/dalvikvm(1480):   at dalvik.system.NativeStart.main(Native Method)
05-21 08:41:14.897: D/skia(1480): --- allocation failed for scaled bitmap
05-21 08:41:14.897: D/AndroidRuntime(1480): Shutting down VM
05-21 08:41:14.897: W/dalvikvm(1480): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
05-21 08:41:14.928: E/AndroidRuntime(1480): FATAL EXCEPTION: main
05-21 08:41:14.928: E/AndroidRuntime(1480): java.lang.OutOfMemoryError
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:785)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.content.res.Resources.loadDrawable(Resources.java:1965)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.content.res.Resources.getDrawable(Resources.java:660)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.graphics.drawable.AnimationDrawable.inflate(AnimationDrawable.java:282)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:885)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.graphics.drawable.Drawable.createFromXml(Drawable.java:822)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.content.res.Resources.loadDrawable(Resources.java:1950)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.content.res.Resources.getDrawable(Resources.java:660)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.view.View.setBackgroundResource(View.java:14468)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at com.example.mysecondapp.LoginActivity.onWindowFocusChanged(LoginActivity.java:170)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at com.android.internal.policy.impl.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:2451)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.view.View.dispatchWindowFocusChanged(View.java:7440)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:930)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:2927)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.os.Looper.loop(Looper.java:137)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at android.app.ActivityThread.main(ActivityThread.java:5041)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at java.lang.reflect.Method.invokeNative(Native Method)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at java.lang.reflect.Method.invoke(Method.java:511)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
05-21 08:41:14.928: E/AndroidRuntime(1480):     at dalvik.system.NativeStart.main(Native Method)
05-21 08:41:16.227: I/Process(1480): Sending signal. PID: 1480 SIG: 9

7.对CANVAS和MAtrix

http://ipjmc.iteye.com/blog/1306509

8.对传感器模拟器

package com.z.app;

import org.openintents.sensorsimulator.hardware.Sensor;
import org.openintents.sensorsimulator.hardware.SensorEvent;
import org.openintents.sensorsimulator.hardware.SensorEventListener;
import org.openintents.sensorsimulator.hardware.SensorManagerSimulator;

import com.example.mysecondapp.R;
import com.example.mysecondapp.R.layout;
import com.example.mysecondapp.R.menu;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.Button;
import android.widget.TextView;

public class TestSensorSimulatorActivity extends Activity {

    //private Boolean flagBoolean=false;
    private TextView sensorsimulatorTextView;
    private SensorManagerSimulator sensorManagerSimulator;
    private SensorEventListener mySensorEventListener=new SensorEventListener() {
        
        @Override
        public void onSensorChanged(SensorEvent arg0) {
            // TODO Auto-generated method stub
            sensorsimulatorTextView.setText("Type:"+arg0.type+"   Values[0]"+arg0.values[0]);
        }
        
        @Override
        public void onAccuracyChanged(Sensor arg0, int arg1) {
            // TODO Auto-generated method stub
            
        }
    };
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test_sensor_simulator);
        sensorsimulatorTextView=(TextView)findViewById(R.id.test_senser_simulator_text);
        
        sensorManagerSimulator=SensorManagerSimulator.getSystemService(this, SENSOR_SERVICE);
        
        new Thread(myRunnable).start();
    
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.test_sensor_simulator, menu);
        return true;
    }
    
    @Override
    protected void onPause() {
        // TODO Auto-generated method stub
        sensorManagerSimulator.unregisterListener(mySensorEventListener);
        super.onPause();
    }

    @Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();
        //if(flagBoolean)
        sensorManagerSimulator.registerListener(mySensorEventListener, sensorManagerSimulator.getDefaultSensor(3), 1);
    }

    private Runnable myRunnable=new  Runnable() {
        
        @Override
        public void run() {
            // TODO Auto-generated method stub
            sensorManagerSimulator.connectSimulator();
            sensorManagerSimulator.registerListener(mySensorEventListener, sensorManagerSimulator.getDefaultSensor(3), 1);
            //flagBoolean=true;
        }
    };

}
如果不在线程中注册那么就不会被执行,如果用上面代码在另外线程中注册,会发先会报

05-29 07:49:05.170: I/Choreographer(1746): Skipped 34 frames!  The application may be doing too much work on its main thread.
05-29 07:49:06.120: I/Choreographer(1746): Skipped 34 frames!  The application may be doing too much work on its main thread.
05-29 07:49:06.290: I/Choreographer(1746): Skipped 31 frames!  The application may be doing too much work on its main thread.
05-29 07:49:16.880: D/dalvikvm(1949): GC_FOR_ALLOC freed 89K, 8% free 2664K/2876K, paused 69ms, total 72ms
05-29 07:49:16.880: I/dalvikvm-heap(1949): Grow heap (frag case) to 3.323MB for 635812-byte allocation
05-29 07:49:16.950: D/dalvikvm(1949): GC_FOR_ALLOC freed 4K, 7% free 3280K/3500K, paused 63ms, total 63ms
05-29 07:49:16.980: D/dalvikvm(1949): GC_CONCURRENT freed <1K, 7% free 3288K/3500K, paused 4ms+2ms, total 33ms
05-29 07:49:17.260: I/Choreographer(1949): Skipped 41 frames!  The application may be doing too much work on its main thread.
05-29 07:49:17.270: D/gralloc_goldfish(1949): Emulator without GPU emulation detected.
05-29 07:49:33.590: I/System.out(1949): 3
05-29 07:49:33.730: D/dalvikvm(1949): GC_FOR_ALLOC freed 33K, 5% free 3442K/3596K, paused 26ms, total 61ms
05-29 07:49:33.790: I/dalvikvm-heap(1949): Grow heap (frag case) to 5.455MB for 2073616-byte allocation
05-29 07:49:33.880: D/dalvikvm(1949): GC_FOR_ALLOC freed 2K, 3% free 5465K/5624K, paused 87ms, total 87ms
05-29 07:49:33.970: D/dalvikvm(1949): GC_CONCURRENT freed <1K, 3% free 5465K/5624K, paused 3ms+3ms, total 96ms
05-29 07:49:34.120: D/dalvikvm(1949): GC_FOR_ALLOC freed 11K, 4% free 5454K/5624K, paused 49ms, total 49ms
05-29 07:49:34.140: I/dalvikvm-heap(1949): Grow heap (frag case) to 9.891MB for 4665616-byte allocation
05-29 07:49:34.180: D/dalvikvm(1949): GC_CONCURRENT freed 0K, 2% free 10010K/10184K, paused 3ms+3ms, total 36ms
05-29 07:49:34.280: D/dalvikvm(1949): GC_FOR_ALLOC freed 2025K, 22% free 7986K/10184K, paused 19ms, total 19ms
05-29 07:49:34.280: I/dalvikvm-heap(1949): Grow heap (frag case) to 9.891MB for 2073616-byte allocation
05-29 07:49:34.330: D/dalvikvm(1949): GC_CONCURRENT freed <1K, 2% free 10011K/10184K, paused 4ms+21ms, total 45ms
05-29 07:49:34.360: D/dalvikvm(1949): GC_FOR_ALLOC freed <1K, 2% free 10011K/10184K, paused 21ms, total 21ms
05-29 07:49:34.390: I/dalvikvm-heap(1949): Grow heap (frag case) to 14.341MB for 4665616-byte allocation
05-29 07:49:34.440: D/dalvikvm(1949): GC_CONCURRENT freed 0K, 2% free 14567K/14744K, paused 5ms+4ms, total 52ms
05-29 07:49:34.530: D/dalvikvm(1949): GC_FOR_ALLOC freed 2025K, 15% free 12543K/14744K, paused 21ms, total 22ms
05-29 07:49:34.580: D/dalvikvm(1949): GC_CONCURRENT freed <1K, 2% free 14568K/14744K, paused 5ms+14ms, total 46ms
05-29 07:49:34.621: D/dalvikvm(1949): GC_FOR_ALLOC freed <1K, 2% free 14568K/14744K, paused 22ms, total 22ms
05-29 07:49:34.641: I/dalvikvm-heap(1949): Grow heap (frag case) to 18.791MB for 4665616-byte allocation
05-29 07:49:34.700: D/dalvikvm(1949): GC_CONCURRENT freed 0K, 1% free 19124K/19304K, paused 4ms+5ms, total 54ms
05-29 07:49:34.790: D/dalvikvm(1949): GC_FOR_ALLOC freed 2025K, 12% free 17100K/19304K, paused 25ms, total 26ms
05-29 07:49:34.850: D/dalvikvm(1949): GC_CONCURRENT freed <1K, 1% free 19125K/19304K, paused 4ms+4ms, total 52ms
05-29 07:49:34.880: D/dalvikvm(1949): GC_FOR_ALLOC freed <1K, 1% free 19125K/19304K, paused 25ms, total 25ms
05-29 07:49:34.911: I/dalvikvm-heap(1949): Grow heap (frag case) to 23.241MB for 4665616-byte allocation
05-29 07:49:34.970: D/dalvikvm(1949): GC_CONCURRENT freed 0K, 1% free 23681K/23864K, paused 5ms+4ms, total 61ms
05-29 07:49:35.120: W/IInputConnectionWrapper(1949): finishComposingText on inactive InputConnection
05-29 07:49:39.659: I/Choreographer(1949): Skipped 50 frames!  The application may be doing too much work on its main thread.
05-29 07:49:40.350: I/Choreographer(1949): Skipped 38 frames!  The application may be doing too much work on its main thread.
05-29 07:49:40.690: I/Choreographer(1949): Skipped 66 frames!  The application may be doing too much work on its main thread.
05-29 07:49:40.700: I/Hardware(1949): Starting connection...
05-29 07:49:40.870: I/Hardware(1949): Connecting to 192.168.1.188 : 8010
05-29 07:49:40.890: I/Hardware(1949): Read line...
05-29 07:49:40.890: I/Hardware(1949): Received: SensorSimulator
05-29 07:49:40.900: I/Hardware(1949): Connected
05-29 07:49:41.050: I/Choreographer(1949): Skipped 66 frames!  The application may be doing too much work on its main thread.
05-29 07:49:41.381: D/Hardware(1949): Create cache for sensor 0
05-29 07:49:41.381: D/Hardware(1949): Create cache for sensor 1
05-29 07:49:41.381: D/Hardware(1949): Create cache for sensor 2
05-29 07:49:41.381: D/Hardware(1949): Create cache for sensor 3
05-29 07:49:41.381: D/Hardware(1949): Create cache for sensor 4
05-29 07:49:41.381: D/Hardware(1949): Create cache for sensor 5
05-29 07:49:41.390: D/Hardware(1949): Create cache for sensor 6
05-29 07:49:41.390: D/Hardware(1949): Create cache for sensor 7
05-29 07:49:41.390: D/Hardware(1949): Create cache for sensor 8
05-29 07:49:41.390: D/Hardware(1949): Create cache for sensor 9
05-29 07:49:41.390: D/Hardware(1949): Create cache for sensor 10
05-29 07:49:41.390: D/Hardware(1949): Create cache for sensor 11
05-29 07:49:41.390: D/AndroidRuntime(1949): Shutting down VM
05-29 07:49:41.390: W/dalvikvm(1949): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
05-29 07:49:41.460: E/AndroidRuntime(1949): FATAL EXCEPTION: main
05-29 07:49:41.460: E/AndroidRuntime(1949): android.os.NetworkOnMainThreadException
05-29 07:49:41.460: E/AndroidRuntime(1949):     at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1117)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:163)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at libcore.io.IoBridge.recvfrom(IoBridge.java:513)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at java.io.InputStreamReader.read(InputStreamReader.java:244)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at java.io.BufferedReader.fillBuf(BufferedReader.java:130)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at java.io.BufferedReader.readLine(BufferedReader.java:354)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at org.openintents.sensorsimulator.hardware.SensorSimulatorClient.readSensor(SensorSimulatorClient.java:654)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at org.openintents.sensorsimulator.hardware.SensorSimulatorClient.readSensor(SensorSimulatorClient.java:571)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at org.openintents.sensorsimulator.hardware.SensorSimulatorClient.access$1000(SensorSimulatorClient.java:53)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at org.openintents.sensorsimulator.hardware.SensorSimulatorClient$1.handleMessage(SensorSimulatorClient.java:505)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at android.os.Looper.loop(Looper.java:137)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at android.app.ActivityThread.main(ActivityThread.java:5041)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at java.lang.reflect.Method.invokeNative(Native Method)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at java.lang.reflect.Method.invoke(Method.java:511)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
05-29 07:49:41.460: E/AndroidRuntime(1949):     at dalvik.system.NativeStart.main(Native Method)

05-29 07:51:54.750: I/Process(1949): Sending signal. PID: 1949 SIG: 9

20.MATRIX里的数值怎么根据不同分辨率修改,按到底说不同分辨率 顶多或导致整个画布缩小,不会造成画布里内容乱掉,

里面数值根据什么换算出来的

21. jni 是沟通NATIVE和JAVA层,还是通过JNI去实现JAVA不方便实现的东西


22.Android service通过单例模式去调用某个函数,发现无法发送广播

但是注册监听时间改变广播走了onstartcommand却可以,打LOG发现这样取的竟然是2个不同对象,不能发送广播原理不清楚,但是以后要杜绝不通过单例去取Service


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值