AndroidÖи÷ÖÖJAVA°üµÄ¹¦ÄÜÃèÊö
AndroidÖи÷ÖÖJAVA°üµÄ¹¦ÄÜÃèÊö
2009-09-29 13:05
ÔÚAndroidµÄÓ¦ÓóÌÐò¿ª·¢ÖУ¬Í¨³£Ê¹ÓõÄÊÇJAVAÓïÑÔ£¬³ýÁËÐèÒªÊìϤJAVAÓïÑԵĻù´¡ÖªÊ¶Ö®Í⣬»¹ÐèÒªÁ˽âAndroidÌṩµÄÀ©Õ¹µÄJAVA¹¦ÄÜ¡£
ÔÚÒ»°ãµÄJAVAÓ¦ÓÃÖУ¬Èç¹ûÐèÓÃÒýÓûù´¡Àà¿â£¬Í¨³£ÐèҪʹÓÃÈçϵķ½Ê½£º
import javax.swing.*;
ÒÔÉÏ´úÂë±íʾÁËÒýÓÃJAVAµÄGUI×é¼þSwing,javax.swing¼´JAVAÖеÄÒ»¸ö°ü¡£
androidÌṩһЩÀ©Õ¹µÄJAVAÀà¿â£¬Àà¿â·ÖΪÈô¸É¸ö°ü£¬Ã¿¸ö°üÖаüº¬Èô¸É¸öÀà¡£ÀýÈ磺ÔÚAndroidÖмÆËãÆ÷ÊÇÒ»¸öÏà¶Ô¼òµ¥µÄ³ÌÐò£¬ÆäÈë¿Ú³ÌÐòÎļþΪCalculator.java£¬¸ÃÎļþ°üº¬ÁËÒÔÏÂÄÚÈÝ£º
package com.android.calculator2;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.util.Config;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;
import android.content.res.Configuration;
ÔÚAndroidÖУ¬¸÷ÖÖ°üд³Éandroid.*µÄ·½Ê½£¬ÖØÒª°üµÄÃèÊöÈçÏÂËùʾ£º
android.app £ºÌṩ¸ß²ãµÄ³ÌÐòÄ£ÐÍ¡¢Ìṩ»ù±¾µÄÔËÐл·¾³
android.content£º°üº¬¸÷ÖֵĶÔÉ豸ÉϵÄÊý¾Ý½øÐзÃÎʺͷ¢²¼µÄÀà
android.database £ºÍ¨¹ýÄÚÈÝÌṩÕßä¯ÀÀºÍ²Ù×÷Êý¾Ý¿â
android.graphics£ºµ×²ãµÄͼÐο⣬°üº¬»²¼£¬ÑÕÉ«¹ýÂË£¬µã£¬¾ØÐΣ¬¿ÉÒÔ½«ËûÃÇÖ±½Ó»æÖƵ½ÆÁÄ»ÉÏ.
android.location £º¶¨Î»ºÍÏà¹Ø·þÎñµÄÀà
android.media £ºÌṩһЩÀà¹ÜÀí¶àÖÖÒôƵ¡¢ÊÓÆµµÄýÌå½Ó¿Ú
android.net £ºÌṩ°ïÖúÍøÂç·ÃÎʵÄÀ࣬³¬¹ýͨ³£µÄjava.net.* ½Ó¿Ú
android.os£ºÌṩÁËϵͳ·þÎñ¡¢ÏûÏ¢´«Êä¡¢IPC»úÖÆ
android.opengl £ºÌṩOpenGLµÄ¹¤¾ß
android.provider£ºÌṩÀà·ÃÎÊAndroidµÄÄÚÈÝÌṩÕß
android.telephony £ºÌṩÓ벦´òµç»°Ïà¹ØµÄAPI½»»¥
android.view£ºÌṩ»ù´¡µÄÓû§½çÃæ½Ó¿Ú¿ò¼Ü
android.util£ºÉæ¼°¹¤¾ßÐԵķ½·¨£¬ÀýÈçʱ¼äÈÕÆÚµÄ²Ù×÷
android.webkit£ºÄ¬ÈÏä¯ÀÀÆ÷²Ù×÷½Ó¿Ú
android.widget£º°üº¬¸÷ÖÖUIÔªËØ£¨´ó²¿·ÖÊǿɼûµÄ£©ÔÚÓ¦ÓóÌÐòµÄÆÁÄ»ÖÐʹÓÃ
À´Ô´£ºÉãÊÏÁã¶È
Ïà¹ØÎĵµ£º
1.¼ÆËãijһÔ·ݵÄ×î´óÌìÊý
Calendar time=Calendar.getInstance();
time.clear();
time.set(Calendar.YEAR,year);
time.set(Calendar.MONTH,i-1);//×¢Òâ,Calendar¶ÔÏóĬÈÏÒ»ÔÂΪ0
int day=time.getActualMaximum(Calendar.DAY_OF_MONTH);//±¾Ô·ݵÄÌìÊý ......
¼òµ¥µÄ˵µ¥Àý¾ÍÊÇ Ö»ÄÜÓÐÒ»¸öʵÀý£¬ËùÒԵط½Óõ½µÄʵÀý¶¼ÊÇͬһ¸ö¡£
¾ÍºÃÏñ¼ÒÈ˳Է¹£¬×À×ÓÊǵ¥ÀýµÄ£¬´ó¼ÒÓõÄÊÇͬһ¸ö¡£¶øÍëÊǶàÀýµÄ£¬Ã¿È˶¼ÓÐ×Ô¼¸µÄ¡£ ÏÂÃæÊǾßÌåµÄÀý×Ó£º
Javaģʽ֮µ¥Àýģʽ£º
µ¥Àýģʽȷ±£Ò»¸öÀàÖ»ÓÐÒ»¸öʵÀý£¬×ÔÐÐÌṩÕâ¸öʵÀý²¢ÏòÕû¸öÏµÍ ......
package org.bupt.test;
import java.util.ArrayList;
class MyResource {
ArrayList<Integer> arrList= new ArrayList<Integer>();
public MyResource(ArrayList<Integer> arrList) {
this.arrList = arrList;
&nbs ......
×°ÊÎÆ÷ģʽÖ÷ÒªÓ¦ÓÃÓÚÕâÑùÒ»ÖÖ³¡ºÏ£¬µ±ÄãÒѾÓÐÁËÒ»¸öÄ¿±êÀ࣬²¢ÇÒËüÊÇÒ»¸ö½Ó¿ÚµÄʵÏÖÀ࣬ÔÚ¶Ô¸ÃÀàʹÓõĺóÆÚ·¢ÏÖÐèÒª¶ÔÏàÓ¦½Ó¿Ú³ÌÐòµÄǰºó×ö¸ü¶àµÄ´¦Àí£¬ÕâЩ´¦ÀíÊDZ仯µÄ£¬²»¹Ì¶¨µÄ£¬µ«ÊÇÓв»ÄÜÈ¥ÐÞ¸ÄÕâ¸öÄ¿±êÀ࣬ÕâʱÎÒÃǾͿÉÒÔʹÓÃÕâ¸ö×°ÊÎÆ÷ģʽ£º
±ÈÈ磬ÎÒÃÇÒѾÓÐÒ»¸ö¸¶¿îµÄ·½·¨ payMoney(long count) £¬Õâ¸ö·½·¨Ö» ......
ÒòΪ´óËÄÁ˾ÍÒª¶ÁÑÐÁË£¬±¾¿ÆÆÚ¼ä×ö¹ýµÄСÏîÄ¿´ó¶¼ÊÇ»ùÓÚ.NetµÄ£¬ËüÌṩÁËÌ«ÓÅÔ½µÄ¿ª·¢»·¾³£¬µ¼ÖÂ×ÔÉíˮƽÌá¸ßÓÐÏÞ¡£
¿ìÒª¶ÁÑÐÁË£¬¾ÝÁ˽âÑо¿ÉúÆÚ¼ä£¬Ö÷Òª¶¼ÊÇJ2EEµÄÏîÄ¿£¬ËùÒÔ×¼±¸ÖØÐÂ×ÔѧJava£¬²¢³¢ÊÔ»ùÓÚJ2EE×öµã¶«Î÷¡£
Ê×ÏȽèÁ˱¾JavaµÄÊ飬×Ô¼ºÒ²ÓÐJavaµÄÊ飬²»¹ý×Ô¼º¸Ð¾õ¸üÔ¸Òâ¿´Íâ¹úµÄÊ飬ÒòÎ ......