当前位置:操作系统 > 安卓/Android >>

android多余资源自动清理工具arc发布到google code

. 我已经将arc(android resource cleaner)的3.0 beta版本的源代码发布到google code,项目目前还很粗鄙,需要进一步的完善,里面也可能还有不少bug,需要解决,感兴趣的朋友可以联系我,里面有我的qq号码(286505491).
 .项目里面两个主要的类:
ARC.java   主要负责UI和事件处理
[java] 
package xiaogang.src; 
 
import java.awt.BorderLayout; 
import java.awt.event.ActionEvent; 
import java.awt.event.ActionListener; 
import java.io.File; 
import java.util.List; 
 
import javax.swing.JButton; 
import javax.swing.JFileChooser; 
import javax.swing.JFrame; 
import javax.swing.JList; 
import javax.swing.JMenu; 
import javax.swing.JMenuBar; 
import javax.swing.JMenuItem; 
import javax.swing.JOptionPane; 
import javax.swing.JScrollPane; 
import javax.swing.JSeparator; 
import javax.swing.SwingUtilities; 
 
class ARC extends JFrame { 
    private static final String VERSION_STR = "3.0 beta"; 
    private static final long serialVersionUID = -1600532762007579488L; 
 
    private JMenu mFileMenu; 
    private JMenu mActionMenu; 
    private JMenu mHelpMenu; 
 
    private JMenuItem mOpenFileMenuItem; 
    private JMenuItem mDeleteMenuItem; 
    private JMenuItem mDeleteAllMenuItem; 
    private JMenuItem mExitMenuItem; 
    private JMenuItem mHelpMenuItem; 
 
    private JButton mJButton; 
    private JMenuBar mJMenuBar1; 
    private JList mUnusedResList; 
    private JSeparator mJSeparator1, mJSeparator2; 
 
    private ResProbe mCleanRes; 
 
    private String mSPath; 
 
    private boolean running = false; 
 
    public static void main(String[] args) { 
        SwingUtilities.invokeLater(new Runnable() { 
            @Override 
            public void run() { 
                ARC inst = new ARC(); 
                inst.setLocationRelativeTo(null); 
                inst.setVisible(true); 
            } 
        }); 
    } 
 
    public ARC() { 
        super(); 
        setupGUI(); 
    } 
 
    private void setupGUI() { 
        try { 
            BorderLayout thisLayout = new BorderLayout(); 
            getContentPane().setLayout(thisLayout); 
 
            mUnusedResList = new JList(); 
            mUnusedResList.setListData(new String[] { 
                    "请打开Android工程根目录" 
            }); 
            mUnusedResList.setLayoutOrientation(JList.VERTICAL); 
            JScrollPane listScroller = new JScrollPane(mUnusedResList); 
            getContentPane().add(listScroller, BorderLayout.CENTER); 
 
            mJButton = new JButton("开始"); 
            mJButton.addActionListener(new ActionListener() { 
 
                @Override 
                public void actionPerformed(ActionEvent arg0) { 
                    if (running) { 
                        mCleanRes.setbCancel(true); 
                        mJButton.setText("开始"); 
                        running = false; 
                        return; 
                    } 
                    if (mSPath == null && mSPath.length() <= 0) { 
                        JOptionPane.showMessageDialog(ARC.this, "选择目录", "Error", 
                                JOptionPane.ERROR_MESSAGE); 
                    } 
 
                    running = true; 
                    mJButton.setText("取消"); 
 
                    new Thread() { 
 
                        @Override 
                        public void run() { 
                            mCleanRes.run(ARC.this
补充:移动开发 , Android ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,