为啥macbook pro 页面缩放232pro过错,否则定是wwW232proneT辨当地了

TSC TTP-342E PRO打印机驱动程序
TSC TTP-342E驱动下载
软件大小:11.9MB
软件语言:简体中文
软件类型:
软件授权:免费软件
更新时间:
软件类别:打印机
软件官网:
网友评分:
应用平台:
5.09MB | 简体中文
1.68MB | 简体中文
3MB | 简体中文
197MB | 简体中文
43.75MB | 简体中文
49MB | 简体中文
5.39MB | 简体中文
33.8MB | 简体中文
1.11MB | 简体中文
下载错误?
TSC TTP-342E PRO打印机驱动程序guitar pro 5 中文 破解版下载|gtp吉他谱软件 guitar pro 5.2中文版下载 - 3322软件站
当前位置: >
> guitar pro 5 中文破解版 吉他谱软件
guitar pro 5 中文破解版 吉他谱软件
大小:4.99MB
语言:简体中文
类别:其它行业
类型:国产软件
授权:免费软件
环境:Windows8, Windows7, WinVista, Win2003, WinXP
安全检测:无插件360通过腾讯通过金山通过瑞星通过
Guitar Pro 5中文破解版是一款针对吉他和弦、六线谱、BASS四线谱的编辑软件,能够对其进行绘制、打印、查看和试听,还具备了格式的和输出功能,Guitar Pro 5可以直接用鼠标、键盘按六线谱、四线谱进行乐谱输入、查看、打印和试听,在做弹拨乐器的滑音、倚音、推弦、揉弦、泛音、摇把、闷音、琶音、分解和弦、BASS打弦等方面有绝对的优势。另外软件在吉他和弦、把位的显示、推算、查询、调用等方面,也异常方便、简洁、直观和浩瀚,这是同类软件所根本无法与之相抗衡的一大显著特点,软件自带了很多示范乐谱,而且操作简单快捷,适合初学吉他的人来使用。
小编推荐的这款软件guitar pro 5.2无需进行繁琐的破解程序,即下即破解
向下关联GP5、GP4、GP3、GTP格式曲谱,并集成注册ID,安装完成后即可直接使用,无须手动注册。软件被设置为简化操作模式,开启主程序后不会再出现欢迎界面和声音,“GP在线”也被设置为“从不”,免除您操作时的烦恼
软件相关内容介绍
1、音轨属性
启动软件之后我们用OPEN打开GP3安装目录下的一首示范曲,这时可以看到屏幕被从上至下分成了3个部分,最上面是音符和快捷工具栏,中间是乐谱显示区,下面是音轨属性区。3.0中特别增加的音轨属性区是仿造CAKEWALK设计的,这无疑给广大喜欢于CAKEWALK*作的用户带来了方便。其中用NAME和INSTRUMENT设置音轨名称和使用乐器,VOLUME、PAN设置音量大小和声相位置,而CHO、REV、PHA、TRE则表示合唱、混响、相位、颤音4种常用效果器,除了CH设置主MIDI通道外,GP3还增设了CH2效果通道,通过它可以为不同的音轨加上不同的效果!
2、快捷工具栏
在乐谱区中我们可以看到整洁、清晰的6线谱和和弦、歌词显示。编辑和修改音符的方法也很简单,只需先用鼠标在左上角的工具栏中选择音符的长度,然后在相应的弦上点击鼠标左键再输入一个品的位置就行了。用DEL键可以删除一个音符,用右键的INSERT添加一个小节,用N-TRUPLET设置3连音,DOTTED设置符点。右上角的工具栏中你可以找到TEMPO速度设定、TIME   SIGNATURE排号设定、REPEAT OPEN/CLOSE重复区域设定等等,这些选项对编辑乐谱都有很大的帮助,需要熟练掌握!
GP3中添加和弦的方法也很简单。首先在适当的地方按下A键弹出和弦窗口,接着你就可以在这里可以对任意一个和弦进行精确地设定了,和弦的种类非常丰富,除了有每个调的大小和弦、7和弦、9和弦外,还有相应的各种转位和弦,任意选择一个和弦之后,相应的品位和演奏指法就会显示出来,非常直观。通过GP3的和弦设定,足以满足你各种复杂的和弦要求,最后按下OK键就可以了!
3、和弦窗口
选择一个音符,我们可以为它添加各种力度符号,从PPP到FFF的范围依次加强,也可以将力度符号作用于整个和弦。当然为一个音符加上各种演奏技巧有时也是十分必要的,GP3中为我们提供了丰富的选择。EFFECT菜单下我们可以用BEND     TYPE进入推弦技巧设定窗口,这里可以设置推弦的范围、持续时间等参数,用PLAY键可以预听到作用后的效果!当然其它的演奏技巧包括HAMMER     ON/PULL OF捶弦/钩弦、SLIDE滑弦、VIBRATO左手颤音、WHAMMY BAR摇把颤音、GRACE NOTE装饰音、NATUREL   HARMONIC自然泛音、ARTIFICIAL HARMONIC人工泛音、TAPPING点弦、SLAPPING贝斯拍奏、DEAD    NOTE闷音、STROKE扫弦等等,让人眼花缭乱!这些富于人性化的演奏技巧将大大增强音乐的灵活性,让它听上去更加丰富多彩!
4、丰富的演奏技巧
GP3是一个多轨吉他软件,因此在编辑完成一个音轨之后,可以使用右下角的箭头更换显示其他乐器的音轨,当然在音轨名称上单击鼠标左键可以调出它的音轨特性窗口,这里可以调整每根弦的音高、弦的数目以及模拟12弦吉他效果的选项。调整完毕之后再单击正下方的标题显示可以进入歌曲信息设定窗口,这里面记录着这首歌曲的标题、作者、专辑、版权等信息,确定之后按下OK键。
在OPTIONS的PREFERENCE里可以对GP3的各种显示字体、颜色进行设置,还可以设置乐谱的打印尺寸。MIDI SETUP的PORT    DEVICE用于设置GP3所支持的4个回放端口设备,这样我们就可以在音轨属性的PORT里找到它们相应的名称了,用空格键播放听一下效果,看是不是不一样了!
5、MIDI输出设置
在TOOL菜单下GP3为我们准备了几个非常实用的吉他编辑辅助工具,这些工具能够帮助我们提高工作的效率,达到事半功倍的目的!其中SPEED    TRAINER是一个变速练习工具;可以在你的要求下每个回合递增或递减速度;TRANSPOSE则是自动转调工具;用AUTOMATIC FINGER     POSITIONING可以起到自动指法调整的效果;用CHECK BAR DURATION自动检查小节的音长;BAR    ARRANGER自动排列小节;COMPLETE/REDUCE BARS WITH     RESETS则可以用休止符完成或缩减小节音符。总之熟练掌握TOOLS的这些工具选项可以给编辑带来很大的方便!
6、Tools菜单
不得不承认GP3的出现对长期困惑于钢琴键盘*作的广大吉他爱好者来说,跨出了革命性的一步,再也不必在五线谱和黑白键输入之间绞尽脑汁了,有了GP3,一切都是那么随心所欲,因为它带你进入的是一个全新的吉他世界,相信所有爱好吉他的朋友都不能错过这样一款优秀的软件,也祝你早日做出悦耳动听的音乐
软件功能及特点
1、全新RSE(拟真音效引擎),并且包括真实的打击乐器音效
2、全新用户界面,支持换肤
3、4种显示模式:页面、文稿、纵向显示和横向显示
4、完善的滚动显示以及文档自由缩放(30-20%)
5、完全重新设计的乐谱显示方式,更加接近于印刷乐谱
6、自动调整音符的纵向位置,避免音符间的拥挤和空白
7、可对每一个音轨进行独立的调整,例如可选择显示六线谱、五线谱或是两者都显示,以及其他参数的调整可在编辑和播放时进行多块选择特别说明Guitar Pro 5提供对简体中文和繁体中文在内的25种不同的语言的支持
节拍器软件是指无需真实乐器,通过软件操作设置乐器、制作速度和拍子等,制作出流畅的音乐节奏的软件。学音乐借助节拍器可使学习者精准的掌握节奏和节奏重点(重音),是学习音乐者打好牢固的基础和提高学习效率,节约时间的重要用具。目前常见的节拍器软件种类多样,究竟哪款好用呢?以下是本站提供的节拍器软件合集,欢迎下载体验哦。
guitar pro 5 中文破解版 吉他谱软件
其它下载地址
软件无法下载
下载后无法使用
与描述不一致
热门关键词
精品软件推荐
/共收集81款软件
15:16:14 11:24:17 9:19:24 9:15:31 10:01:47 13:40:35/ GuitarMusic
项目语言:JAVA
权限:read-only(如需更高权限请先加入项目)
GuitarMusic/
Index: main/java/com/peace/guitarmusic/util/CommonUtil.java
===================================================================
--- main/java/com/peace/guitarmusic/util/CommonUtil.java (revision 0)
+++ main/java/com/peace/guitarmusic/util/CommonUtil.java (revision 162)
@@ -0,0 +1,154 @@
+package com.peace.guitarmusic.
+import java.io.FileInputS
+import java.io.IOE
+import java.math.BigI
+import java.security.MessageD
+import java.security.NoSuchAlgorithmE
+import android.app.A
+import android.app.WallpaperM
+import android.content.C
+import android.content.I
+import android.content.pm.ActivityI
+import android.content.pm.ApplicationI
+import android.content.pm.PackageI
+import android.content.pm.PackageM
+import android.content.pm.PackageManager.NameNotFoundE
+import android.graphics.B
+import android.net.ConnectivityM
+import android.net.NetworkI
+import android.os.E
+import android.text.TextU
+import android.view.inputmethod.InputMethodM
+public class CommonUtil {
+ public static String getMd5(String src) {
MessageDigest digest =
digest = MessageDigest.getInstance(&MD5&);
digest.update(src.getBytes());
BigInteger bigInt = new BigInteger(1, digest.digest());
return bigInt.toString(16);
} catch (NoSuchAlgorithmException e) {
* 获取版本号
* @return 当前应用的版本号
+ public static int getVersion(Context context) {
PackageManager manager = context.getPackageManager();
PackageInfo info = manager.getPackageInfo(context.getPackageName(),
return info.versionC
} catch (Exception e) {
return -1;
+ public static String getUmengChanel(Context context) {
return getAppMetaData(context, &UMENG_CHANNEL&);
* 获取application中指定的meta-data
* @return 如果没有获取成功(没有对应值,或者异常),则返回值为空
public static String getAppMetaData(Context ctx, String key) {
ApplicationInfo appI
appInfo = ctx.getPackageManager()
.getApplicationInfo(ctx.getPackageName(),PackageManager.GET_META_DATA);
return appInfo.metaData.getString(key);
} catch (NameNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
+ public static void closeInputMethod(Context context) {
InputMethodManager imm = (InputMethodManager) context
.getSystemService(Context.INPUT_METHOD_SERVICE);
// 得到InputMethodManager的实例
if (imm.isActive()) {
// 如果开启
imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT,
InputMethodManager.HIDE_NOT_ALWAYS);
// 关闭软键盘,开启方法相同,这个方法是切换开启与关闭状态的
+ public static boolean SetWallPaper(Context context, Bitmap bitmap) {
WallpaperManager mWallManager = WallpaperManager.getInstance(context);
mWallManager.setBitmap(bitmap);
} catch (IOException e) {
* 判断手机是否有SD卡。
* @return 有SD卡返回true,没有返回false。
+ public static boolean hasSDCard() {
return Environment.MEDIA_MOUNTED.equals(Environment
.getExternalStorageState());
+ public static void share(Activity activity, String text) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType(&image/*&);
intent.putExtra(Intent.EXTRA_SUBJECT, &分享&);
intent.putExtra(Intent.EXTRA_TEXT, text);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
activity.startActivity(Intent.createChooser(intent, activity.getTitle()));
+ public static boolean isWifiAnd3G(Context context) {
+ public static boolean isNetConnected(Context context) {
if (context != null) {
ConnectivityManager mConnectivityManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo mNetworkInfo = mConnectivityManager
.getActiveNetworkInfo();
if (mNetworkInfo != null) {
return mNetworkInfo.isAvailable();
+ public boolean isWifiConnected(Context context) {
if (context != null) {
ConnectivityManager mConnectivityManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo mWiFiNetworkInfo = mConnectivityManager
.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
if (mWiFiNetworkInfo != null) {
return mWiFiNetworkInfo.isAvailable();
Index: main/java/com/peace/guitarmusic/util/NetUtils.java
===================================================================
--- main/java/com/peace/guitarmusic/util/NetUtils.java (revision 0)
+++ main/java/com/peace/guitarmusic/util/NetUtils.java (revision 162)
@@ -0,0 +1,307 @@
+package com.peace.guitarmusic.
+import java.io.BufferedR
+import java.io.F
+import java.io.FileOutputS
+import java.io.IOE
+import java.io.InputS
+import java.io.InputStreamR
+import java.io.PrintW
+import java.net.HttpURLC
+import java.net.URL;
+import java.net.URLC
+import java.util.L
+import java.util.M
+import com.lidroid.xutils.HttpU
+import com.lidroid.xutils.http.RequestP
+import com.lidroid.xutils.http.ResponseS
+import com.lidroid.xutils.http.client.HttpRequest.HttpM
+import com.peace.guitarmusic.service.UserS
+import android.graphics.B
+import android.graphics.BitmapF
+import android.graphics.BitmapFactory.O
+import android.util.L
+public class NetUtils {
+ // 读取整个文件内容
+ public static String getUrlContent(String urlStr) {
String ret =
URL url = new URL(urlStr);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
InputStream is = conn.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuffer buffer = new StringBuffer();
char[] buff = new char[1024 * 4];
while((len = reader.read(buff)) & 0){
buffer.append(buff, 0, len);
is.close();
reader.close();
ret = buffer.toString();
} catch (Exception e) {
e.printStackTrace();
+ public static boolean downloadFile(String urlStr , String path){
long time1 = System.currentTimeMillis();
URL url = new URL(urlStr);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
InputStream is = conn.getInputStream();
FileOutputStream out = new FileOutputStream(new File(path));
byte[] buff = new byte[1024*80];
while ((len = is.read(buff)) != -1) {
out.write(buff,0,len);
out.flush();
out.close();
is.close();
Log.e(&peace&, &down filelist cost :&+ (System.currentTimeMillis() - time1));
} catch (Exception e) {
e.printStackTrace();
+ public static boolean downloadFile(String urlStr , String path,DownloadListener listener){
URL url = new URL(urlStr);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
int fileLenth = conn.getContentLength();
InputStream is = conn.getInputStream();
FileOutputStream out = new FileOutputStream(new File(path));
StringBuffer buffer = new StringBuffer();
int process = 0;
if(listener !=null){
listener.onProcess(0);
byte[] buff = new byte[1024*80];
while ((len = is.read(buff)) != -1) {
out.write(buff,0,len);
process +=
if(listener !=null){
listener.onProcess((int) (process*100.0f/fileLenth));
out.flush();
out.close();
is.close();
if(listener !=null){
listener.onSuccessed();
} catch (Exception e) {
e.printStackTrace();
if(listener !=null){
listener.onError();
+ public interface DownloadListener{
void onProcess(int percent);
void onSuccessed();
void onError();
* 从网络中获取图片,以流的形式返回
public static InputStream getImageViewInputStream(String url) throws IOException {
InputStream inputStream =
if (url != null) {
//打开连接
HttpURLConnection httpURLConnection = (HttpURLConnection)new URL(url).openConnection();
httpURLConnection.setConnectTimeout(3000);//设置网络连接超时的时间为3??
httpURLConnection.setRequestMethod(&GET&);
//设置请求方法为GET
httpURLConnection.setDoInput(true);
//打开输入??
int responseCode = httpURLConnection.getResponseCode();
// 获取服务器响应??
if (responseCode == HttpURLConnection.HTTP_OK) {
//正常连接
inputStream = httpURLConnection.getInputStream();
//获取输入??
return inputS
public static Bitmap getNetImage(String url){
return BitmapFactory.decodeStream(getImageViewInputStream(url));
} catch (IOException e) {
e.printStackTrace();
public static Bitmap getNetImageFitImageView(String url,int width,int height){
Options op = new Options();
op.outWidth =
op.outHeight =
return BitmapFactory.decodeStream(getImageViewInputStream(url),null,op);
} catch (IOException e) {
e.printStackTrace();
public static String upLoadFile(String url,String path) throws Exception{
RequestParams params = new RequestParams();
params.addHeader(&name&, &value&);
params.addQueryStringParameter(&name&, &value&);
// 只包含字符串参数时默认使用BodyParamsEntity,
// 类似于UrlEncodedFormEntity(&application/x-www-form-urlencoded&)。
params.addBodyParameter(&name&, &value&);
// 加入文件参数后默认使用MultipartEntity(&multipart/form-data&),
// 如需&multipart/related&,xUtils中提供的MultipartEntity支持设置subType为&related&。
// 使用params.setBodyEntity(httpEntity)可设置更多类型的HttpEntity(如:
// MultipartEntity,BodyParamsEntity,FileUploadEntity,InputStreamUploadEntity,StringEntity)。
// 例如发送json参数:params.setBodyEntity(new StringEntity(jsonStr,charset));
params.addBodyParameter(&file&, new File(path));
HttpUtils http = new HttpUtils();
ResponseStream stream = http.sendSync(HttpMethod.POST,url,params);
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
String result = &&;
String line =
while((line = reader.readLine()) != null){
stream.close();
reader.close();
* 向指定URL发送GET方法的请求
* @param url
发送请求的URL
* @param param
请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return URL 所代表远程资源的响应结果
public static String sendGet(String url, String param) {
String result = &&;
BufferedReader in =
String urlNameString =
if(param != null && !param.equals(&&)){
urlNameString= url + &?& +
urlNameString=
URL realUrl = new URL(urlNameString);
// 打开和URL之间的连接
URLConnection connection = realUrl.openConnection();
// 设置通用的请求属性
connection.setRequestProperty(&accept&, &*/*&);
connection.setRequestProperty(&connection&, &Keep-Alive&);
connection.setRequestProperty(&user-agent&,
&Mozilla/4.0 ( MSIE 6.0; Windows NT 5.1;SV1)&);
connection.setRequestProperty(&token&, UserService.getInstance().getToken());
// 建立实际的连接
connection.connect();
// 获取所有响应头字段
Map&String, List&String&& map = connection.getHeaderFields();
// 遍历所有的响应头字段
for (String key : map.keySet()) {
System.out.println(key + &---&& + map.get(key));
// 定义 BufferedReader输入流来读取URL的响应
in = new BufferedReader(new InputStreamReader(
connection.getInputStream()));
while ((line = in.readLine()) != null) {
} catch (Exception e) {
System.out.println(&发送GET请求出现异常!& + e);
e.printStackTrace();
// 使用finally块来关闭输入流
if (in != null) {
in.close();
} catch (Exception e2) {
e2.printStackTrace();
* 向指定 URL 发送POST方法的请求
* @param url
发送请求的 URL
* @param param
请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return 所代表远程资源的响应结果
public static String sendPost(String url, String param) {
PrintWriter out =
BufferedReader in =
String result = &&;
URL realUrl = new URL(url);
// 打开和URL之间的连接
URLConnection conn = realUrl.openConnection();
// 设置通用的请求属性
conn.setRequestProperty(&accept&, &*/*&);
conn.setRequestProperty(&connection&, &Keep-Alive&);
conn.setRequestProperty(&user-agent&,
&Mozilla/4.0 ( MSIE 6.0; Windows NT 5.1;SV1)&);
conn.setRequestProperty(&Content-Type&,&application/json&);
String token = UserService.getInstance().getToken();
conn.setRequestProperty(&token&, token);
// 发送POST请求必须设置如下两行
conn.setDoOutput(true);
conn.setDoInput(true);
// 获取URLConnection对象对应的输出流
out = new PrintWriter(conn.getOutputStream());
// 发送请求参数
out.print(param);
// flush输出流的缓冲
out.flush();
// 定义BufferedReader输入流来读取URL的响应
in = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
while ((line = in.readLine()) != null) {
} catch (Exception e) {
System.out.println(&发送 POST 请求出现异常!&+e);
e.printStackTrace();
//使用finally块来关闭输出流、输入流
if(out!=null){
out.close();
if(in!=null){
in.close();
catch(IOException ex){
ex.printStackTrace();
Index: main/java/com/peace/guitarmusic/util/ResourceUtils.java
===================================================================
--- main/java/com/peace/guitarmusic/util/ResourceUtils.java (revision 0)
+++ main/java/com/peace/guitarmusic/util/ResourceUtils.java (revision 162)
@@ -0,0 +1,601 @@
+package com.peace.guitarmusic.
+import java.io.F
+import java.io.FileInputS
+import java.io.FileNotFoundE
+import java.io.InputS
+import java.net.HttpURLC
+import java.net.URL;
+import android.content.C
+import android.graphics.B
+import android.graphics.BitmapF
+import android.graphics.BitmapFactory.O
+import android.graphics.C
+import android.graphics.M
+import android.graphics.P
+import android.graphics.PorterDuff.M
+import android.graphics.PorterDuffX
+import android.graphics.R
+import android.graphics.RectF;
+import android.graphics.Bitmap.C
+import android.graphics.drawable.D
+import android.view.LayoutI
+import android.view.V
+public class ResourceUtils {
+ public static Bitmap getLoacalBitmap(String url) {
FileInputStream fis = new FileInputStream(url);
Bitmap map =
BitmapFactory.decodeStream(fis);
fis.close();
} catch (Exception e) {
e.printStackTrace();
+ public static Bitmap getHttpBitmap(String url){
URL myFileURL;
Bitmap bitmap=
myFileURL = new URL(url);
//获得连接
HttpURLConnection conn=(HttpURLConnection)myFileURL.openConnection();
//设置超时时间为6000毫秒,conn.setConnectionTiem(0);表示没有时间限制
conn.setConnectTimeout(6000);
//连接设置获得数据流
conn.setDoInput(true);
//不使用缓存
conn.setUseCaches(false);
//这句可有可无,没有影响
//conn.connect();
//得到数据流
InputStream is = conn.getInputStream();
//解析得到图片
bitmap = BitmapFactory.decodeStream(is);
//关闭数据流
is.close();
}catch(Exception e){
e.printStackTrace();
* 加载系统页面资源
* @param resource
* @param context
* @return 布局
+ public static View loadLayout(int resource, Context context) {
if (context == null) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
return inflater.inflate(resource, null);
* 加载图片资源
* @param resource
* @param context
* @return 图片
+ public static Drawable loadDrawable(int resource, Context context) {
if (context == null) {
return context.getResources().getDrawable(resource);
* 加载图片资源
* @param resource
* @param context
* @return 图片
+ public static Bitmap loadBitmap(int resource, Context context) {
if (context == null) {
// BitmapDrawable bd = (BitmapDrawable)
// context.getResources().getDrawable(resource);
Bitmap map = BitmapFactory.decodeStream(context.getResources().openRawResource(resource));
} catch (Exception e) {
e.printStackTrace();
}catch (Error e){
System.gc();
e.printStackTrace();
* @Description 缩放一个图片是适应目标大小
* @return Bitmap
+ public static Bitmap cutScledBitmap(String srcPath, int tarWidth, int tarHeight) {
Bitmap srcMap = loadLocalImage(srcPath);
Bitmap outMap =
int srcWidth = srcMap.getWidth();
int srcHeight = srcMap.getHeight();
if ((srcWidth + 0.0f) / srcHeight &= (tarWidth + 0.0f) / tarHeight) {
float rate = (srcHeight + 0.0f) / tarH
outMap = Bitmap.createScaledBitmap(srcMap, (int) (srcWidth / rate), tarHeight, false);
float rate = (srcWidth + 0.0f) / tarW
outMap = Bitmap.createScaledBitmap(srcMap, tarWidth, (int) (srcHeight / rate), true);
srcMap.recycle();
System.gc();
return outM
} catch (Exception e) {
e.printStackTrace();
}catch(Error e){
System.gc();
e.printStackTrace();
* @Description 缩放一个图片是适应目标大小
* @return Bitmap
+ public static Bitmap cutScledBitmap(Bitmap srcMap, int tarWidth, int tarHeight) {
Bitmap outMap =
int srcWidth = srcMap.getWidth();
int srcHeight = srcMap.getHeight();
if ((srcWidth + 0.0f) / srcHeight &= (tarWidth + 0.0f) / tarHeight) {
float rate = (srcHeight + 0.0f) / tarH
outMap = Bitmap.createScaledBitmap(srcMap, (int) (srcWidth / rate), tarHeight, false);
float rate = (srcWidth + 0.0f) / tarW
outMap = Bitmap.createScaledBitmap(srcMap, tarWidth, (int) (srcHeight / rate), true);
srcMap.recycle();
System.gc();
return outM
} catch (Exception e) {
}catch (Error e) {
System.gc();
e.printStackTrace();
* 加载本地图片
* @param resource
* @param context
+ public static Drawable loadLocalDrawable(int resource, Context context) {
return context.getResources().getDrawable(resource);
} catch (Exception e) {
}catch (Error e){
System.gc();
e.printStackTrace();
* 根据资源加载图片、并且处理成指定的宽和高
* @param resource
资源下图片的ID
* @param context
* @param width
要生成的宽
* @param height
要生成的高
* @return Bitmap
+ public static Bitmap loadBitmap(int resource, Context context, int width, int height) {
// 创建一个指定大小的位图
Bitmap bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888);
// 根据bitmap创建一个画布
Canvas c = new Canvas(bitmap);
// 通过资源获得指定资源下Drawable对象
Drawable drawable = context.getResources().getDrawable(resource);
// 设置大小
drawable.setBounds(0, 0, width, height);
// 将资源画进画布中
drawable.draw(c);
* 为图片加上圆角
* @param bitmap
+ public static Bitmap loadRoundedCornerBitmap(Bitmap bitmap) {
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888);
Canvas canvas = new Canvas(output);
final int color = 0xff424242;
final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
final RectF rectF = new RectF(rect);
paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(color);
canvas.drawRoundRect(rectF, 20, 20, paint);
paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
canvas.drawBitmap(bitmap, rect, rect, paint);
bitmap.recycle();
System.gc();
* 为图片加上圆角
* @param bitmap
+ public static Bitmap loadRoundedCornerBitmap(int resource, Context context) {
Bitmap bitmap = BitmapFactory.decodeStream(context.getResources().openRawResource(resource));
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888);
Canvas canvas = new Canvas(output);
final int color = 0xff424242;
final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
final RectF rectF = new RectF(rect);
paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(color);
canvas.drawRoundRect(rectF, 20, 20, paint);
paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
canvas.drawBitmap(bitmap, rect, rect, paint);
bitmap.recycle();
System.gc();
* 为图片加上圆角
* @param bitmap
+ public static Bitmap loadRoundedCornerBitmap(int resource, Context context, float rx, float ry) {
Bitmap bitmap = BitmapFactory.decodeStream(context.getResources().openRawResource(resource));
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888);
Canvas canvas = new Canvas(output);
final int color = 0xff424242;
final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
final RectF rectF = new RectF(rect);
paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(color);
canvas.drawRoundRect(rectF, rx, ry, paint);
paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
canvas.drawBitmap(bitmap, rect, rect, paint);
bitmap.recycle();
System.gc();
* 为图片加上圆角
* @param bitmap
+ public static Bitmap loadRoundedCornerBitmap(Bitmap bitmap, float rx, float ry) {
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888);
Canvas canvas = new Canvas(output);
final int color = 0xff424242;
final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
final RectF rectF = new RectF(rect);
paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(color);
canvas.drawRoundRect(rectF, rx, ry, paint);
paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
canvas.drawBitmap(bitmap, rect, rect, paint);
bitmap.recycle();
System.gc();
* 为图片加上圆角
* @param bitmap
+ public static Bitmap loadRoundedCornerBitmap(String path, Context context) {
Bitmap bitmap =
bitmap = BitmapFactory.decodeStream(new FileInputStream(new File(path)));
if (bitmap == null) {
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888);
Canvas canvas = new Canvas(output);
final int color = 0xff424242;
final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
final RectF rectF = new RectF(rect);
paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(color);
canvas.drawRoundRect(rectF, 20, 20, paint);
paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
canvas.drawBitmap(bitmap, rect, rect, paint);
bitmap.recycle();
System.gc();
} catch (FileNotFoundException e) {
e.printStackTrace();
* 缩放图片
* @param src
* @param matrix
+ public static Bitmap transform(Bitmap src, Matrix matrix) {
return Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), matrix, false);
* 获取配置字符
* @param context
* @param id
+ public static String getString(Context context, int id) {
return context.getResources().getString(id);
* 从网络加载图片资源.
* 如果没有加载到图片资源.默认为再加载一分钟.一分钟之后仍然加载不了,则退出.
* @param imgURI
+ public static synchronized Bitmap loadInternetImage(String imgURI) {
Bitmap temp =
if (imgURI == null || imgURI.trim().length() &= 0) {
URL url = new URL(imgURI);
temp = BitmapFactory.decodeStream(url.openStream());
long start = System.currentTimeMillis();
while (temp == null) {
System.out.println(&load resource failure : & + imgURI);
temp = BitmapFactory.decodeStream(url.openStream());
if (temp != null || System.currentTimeMillis() - start &= 60000) {
System.out.println(&load image success&);
} catch (Exception e) {
e.printStackTrace();
}catch (Error e){
System.gc();
e.printStackTrace();
}finally {
+ public static Drawable loadLocalImageDrawble(String path) {
return Drawable.createFromPath(path);
} catch (Exception e) {
}catch (Error e){
System.gc();
e.printStackTrace();
+ public static Bitmap loadLocalImage(String path) {
if(path == null){
File f = new File(path);
if(!f.exists()){
return BitmapFactory.decodeStream(new FileInputStream(new File(path)));
return BitmapFactory.decodeFile(path);
return decodeFile(f,1024);
} catch (Exception e) {
e.printStackTrace();
}catch (OutOfMemoryError e){
e.printStackTrace();
System.gc();
}catch(Error e){
e.printStackTrace();
+ public static Bitmap loadLocalImage(String path,int width,int height) {
System.out.println(&width=&+width+&
height==&+height);
if(path == null){
File f = new File(path);
if(!f.exists()){
return BitmapFactory.decodeStream(new FileInputStream(new File(path)));
= new Options();
o.inJustDecodeBounds =
BitmapFactory.decodeFile(path,o);
if(o.outHeight&height && o.outWidth&width){
int rateW = Math.round((o.outWidth+0.0f) / width);
int rateH =Math.round((0.0f+ o.outHeight)/height);
int rateW = o.outWidth /
int rateH = o.outHeight/
int rate = rateW&rateH?rateH:rateW;
System.out.println(&rate=============&+rate);
o.inJustDecodeBounds =
o.inSampleSize =
return BitmapFactory.decodeFile(path,o);
return BitmapFactory.decodeFile(path);
return decodeFile(f,1024);
} catch (Exception e) {
e.printStackTrace();
}catch (OutOfMemoryError e){
e.printStackTrace();
System.gc();
}catch(Error e){
e.printStackTrace();
+ public static Bitmap decodeFile(
final File f,
final int suggestedSize)
if (f == null) {
if (f.exists() == false) {
// return BitmapFactory.decodeFile(f.getAbsolutePath());
// System.gc();
// decode image size
final Options o = new Options();
o.inJustDecodeBounds =
BitmapFactory.decodeStream(new FileInputStream(f), null, o);
// Find the correct scale value. It should be the power of
final int requiredSize = suggestedS
int widthTmp = o.outWidth, heightTmp = o.outH
int scale = 1;
while (true) {
if ((widthTmp / 2) & requiredSize
|| (heightTmp / 2) & requiredSize) {
System.out.println(&decodeFile============&);
widthTmp /= 2;
heightTmp /= 2;
scale *= 2;
// decode with inSampleSize
final Options o2 = new Options();
o2.inSampleSize =
o2.inTempStorage = new byte[64 * 1024];
o2.inPurgeable =
Bitmap bitmap =
BitmapFactory
.decodeStream(new FileInputStream(f), null, o2);
} catch (final Throwable e) {
System.gc();
} catch (final Throwable e) {
Bug.report(e);
System.gc();
\ No newline at end of file
Index: main/java/com/peace/guitarmusic/util/Constants.java
===================================================================
--- main/java/com/peace/guitarmusic/util/Constants.java (revision 0)
+++ main/java/com/peace/guitarmusic/util/Constants.java (revision 162)
@@ -0,0 +1,48 @@
+package com.peace.guitarmusic.
+public class Constants {
+ public static final String API_SECRET=&peace_kuqiao&;
+ public static final String MOGO_ID = &3aeaf371c45b42b6afb8f&;
+ public static final String adSpaceid = &kuPQaJIppg&;
//360底部广告ID
+ public static final String APP_DIR = &guitarmusic2&;
+ public static final String ABOUT_DEFAULT_URL=&http://wapbaike.baidu.com/view/1221.htm?bd_page_type=1&st=3&net=1&ldr=2&sublemmaid=1221&ref=wise&ssid=0&from=844b&uid=0&pu=usm@5,sz@,ta@iphone_2_2.3_3_533&baiduid=1DFCEDC9EE991B9CF8A3B&tj=4ll_1_0_10_title&;
public static final String WEB_URL = &http://192.168.1.100:8080&
+// public static final String WEB_URL = &http://www.kqjita.com/guitarmusic&
//深圳服务器
+ public static final String WEB_URL_API = WEB_URL
+ &/api/v1/song&
+ public static final String WEB_URL_API_DOWNLOAD_IMG_HISTORY = WEB_URL
+ &/api/v1/song/downloadhis&
+ public static final String WEB_URL_API_SONGPLAY_HISTORY = WEB_URL
+ &/api/v1/song/playhis&
+ public static final String WEB_URL_API_DOWNLOAD_AUDIO_HISTORY = WEB_URL
+ &/api/v1/song/downloadAudiohis&
+ public static final String FILE_CONTENTS_URL = WEB_URL + &/contents.txt&;
+ public static final String ABOUT_URL_PATH = WEB_URL + &/aboutUrl.txt&;
+ public static final String VIDEO_PATH = WEB_URL + &/videos&;
+ public static final String IMAGE_PATH = WEB_URL + &/images&;
+ public static final String VOICE_PATH = WEB_URL + &/images&;
+ public static final String SHAREPREFERENCE_DOWNLOAD = &downloadinfo&;
+ public static final String SHAREPREFERENCE_CONFIG = &config&;
+ public static final String SHAREPREFERENCE_PLAYLIST_DEFAULT = &playlist_default&; //默认播放列表
+ public static final String SHAREPREFERENCE_PLAYLIST_FAVORITE = &playlist_favorite&; //喜欢的歌曲列表
+ public static final String SHAREPREFERENCE_PLAYLIST_DOWNLOAD = &playlist_download&; //下载的歌曲列表
+ public static final String LOCK_URL = WEB_URL +&/lock.txt& ;
+ public static String ROOT_PATH;
+ public static boolean isNeC
+ public static final int PAGE_SIZE = 10;
+ public static final boolean is360 =
//360广告标识
* 广电通配置
+ public static final String GDT_APPID = &&;
+ public static final String GDT_BannerPosID = &1374&;
+ public static final String GDT_SplashPosID = &6983&;
+ public static final String ACTION_LOGIN_SECCESS = &action_login_success&;
+ public static final String ACTION_LOGOUT = &action_logout&;
Index: main/java/com/peace/guitarmusic/util/TypeFaceUtil.java
===================================================================
--- main/java/com/peace/guitarmusic/util/TypeFaceUtil.java (revision 0)
+++ main/java/com/peace/guitarmusic/util/TypeFaceUtil.java (revision 162)
@@ -0,0 +1,15 @@
+package com.peace.guitarmusic.
+import android.content.C
+import android.graphics.T
+public class TypeFaceUtil {
+ private static T
static Typeface getTypeFace(Context context){
if(instance == null){
instance = Typeface.createFromAsset(context.getAssets(), &hksnt.ttf&);
Index: main/java/com/peace/guitarmusic/util/FileUtils.java
===================================================================
--- main/java/com/peace/guitarmusic/util/FileUtils.java (revision 0)
+++ main/java/com/peace/guitarmusic/util/FileUtils.java (revision 162)
@@ -0,0 +1,455 @@
+package com.peace.guitarmusic.
+import java.io.F
+import java.io.FileInputS
+import java.io.FileOutputS
+import java.io.IOE
+import java.io.InputS
+import java.math.BigI
+import java.net.URL;
+import java.net.URLC
+import java.security.MessageD
+import android.webkit.MimeTypeM
+ * Copyright: Copyright (c) 2011
+ * Company: 青果科技
+ * @author heping
+ * @date 下午05:06:32
+ * @version 1.0
+ * @Description: 文件相关工具
+public class FileUtils {
public static String getFileMD5(File file) {
if (!file.isFile()) {
MessageDigest digest =
FileInputStream in =
byte buffer[] = new byte[1024];
digest = MessageDigest.getInstance(&MD5&);
in = new FileInputStream(file);
while ((len = in.read(buffer, 0, 1024)) != -1) {
digest.update(buffer, 0, len);
in.close();
} catch (Exception e) {
e.printStackTrace();
BigInteger bigInt = new BigInteger(1, digest.digest());
return bigInt.toString(16);
* @Description 查看sdcard是否可以访问
* @return boolean
+ public static boolean isSdcardAlready() {
File file = new File(&/sdcard&);
if (file.exists()) {
file = new File(&/sdcard/path_check.txt&);
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
+ public static boolean isFileExists(String path){
File file = new File(path);
return file.exists();
* @Description 线程等待直到sdcard可读
* @return void
+ public static void waitforSdcardReady(){
while(!FileUtils.isSdcardAlready()){
System.out.println(&sdcard can not read!!!!&);
+ public static long getFileLength(String path){
File f = new File(path);
return f.length();
* @Description 判断一个文件夹下级目录是否包含文件
* @return boolean
+ public static boolean isDirContainsFile(String dirPath,String fileName){
String[] files = new File(dirPath).list();
for(String f : files){
if(f.equals(fileName)){
+ public static void downLoadFile(String urlStr, String savePath) throws Exception {
URL url = new URL(urlStr);
URLConnection connection = url.openConnection();
connection.connect();
int apkLength = connection.getContentLength();
InputStream in = connection.getInputStream();
File file = new File(savePath);
if (file.exists()) {
file.delete();
FileOutputStream out = new FileOutputStream(file);
int len = 0;
byte[] buff = new byte[1024 * 80];
while ((len = in.read(buff)) != -1) {
out.write(buff, 0, len);
out.flush();
in.close();
out.close();
+ public static void mkdirIfnotExists(String path) {
File f = new File(path);
if (!f.exists()) {
f.mkdir();
* @Description 把文件以字符串方式读出来
* @return String
* @throws IOException
+ public static String readFile(File file) throws IOException {
String jsonStr = &&;
FileInputStream in = new FileInputStream(file);
byte buff[] = new byte[1024 * 10];
int len = 0;
while ((len = in.read(buff)) != -1) {
jsonStr += new String(buff, 0, len);
return jsonS
+ public static String readFile(String path) throws IOException {
File file = new File(path);
String jsonStr = &&;
FileInputStream in = new FileInputStream(file);
byte buff[] = new byte[1024 * 15];
int len = 0;
while ((len = in.read(buff)) != -1) {
jsonStr += new String(buff, 0, len);
return jsonS
* @Description 把字符串写入文件
* @return void
* @throws IOException
+ public static void writeFile(String str, String path) throws IOException {
if(str == null)
File f = new File(path);
FileOutputStream out = new FileOutputStream(f);
out.write(str.getBytes());
* @Description 获取文件的MIMETYPE
* @return String
+ public static String getMimeType(String file) {
String type =
type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(MimeTypeMap.getFileExtensionFromUrl(file));
if (type == null) {
String tmp = file.toLowerCase();
if (tmp.endsWith(&mp3&) || tmp.endsWith(&wav&) || tmp.endsWith(&wma&)) {
type = &audio/*&;
} else if (tmp.endsWith(&apk&)) {
type = &application/vnd.android.package-archive&;
* @Description 拷贝单个文件
* @return boolean是否拷贝成功
+ public static boolean copyFile(String src, String des) {
FileInputStream FIS =
FileOutputStream FOS =
FIS = new FileInputStream(src);
FOS = new FileOutputStream(des);
byte[] bt = new byte[1024];
int readNum = 0;
while ((readNum = FIS.read(bt)) != -1) {
FOS.write(bt, 0, readNum);
FIS.close();
FOS.close();
} catch (Exception e) {
* @Description 网上找的拷贝文件夹方法
* @return boolean是否拷贝成功
+ // public static boolean copyDirectory(String SrcDirectoryPath, String
+ // DesDirectoryPath) {
+ // try {
+ // // 創建不存在的目錄
+ // System.out.println(&DesDirectoryPath---&+DesDirectoryPath);
+ // File F0 = new File(DesDirectoryPath);
+ // if (!F0.exists()) {
+ // if (!F0.mkdir()) {
+ // System.out.println(&目標文件夾不存,創建失敗!&);
+ // File F = new File(SrcDirectoryPath);
+ // File[] allFile = F.listFiles(); // 取得當前目錄下面的所有文件,將其放在文件數組中
+ // int totalNum = allFile. // 取得當前文件夾中有多少文件(包括文件夾)
+ // String srcName = &&;
+ // String desName = &&;
+ // int currentFile = 0;
+ // // 一個一個的拷貝文件
+ // for (currentFile = 0; currentFile & totalN currentFile++) {
+ // if (!allFile[currentFile].isDirectory()) {
+ // // 如果是文件是采用處理文件的方式
+ // srcName = allFile[currentFile].toString();
+ // desName = DesDirectoryPath + &\\& + allFile[currentFile].getName();
+ // copyFile(srcName, desName);
+ // // 如果是文件夾就采用遞歸處理
+ // else {
+ // // 利用遞歸讀取文件夾中的子文件下的內容,再讀子文件夾下面的子文件夾下面的內容...
+ // if (copyDirectory(allFile[currentFile].getPath().toString(),
+ // DesDirectoryPath + &\\& + allFile[currentFile].getName().toString())) {
+ // // System.out.println(&D Copy Successfully!&);
+ // } else {
+ // System.out.println(&SubDirectory Copy Error!&);
+ // } catch (Exception e) {
+ // e.printStackTrace();
+ // System.out.println(& copy -----------------------------&);
+ public static boolean copyDirectory(String SrcDirectoryPath, String DesDirectoryPath) {
// 創建不存在的目錄
File F0 = new File(DesDirectoryPath);
if (!F0.exists()) {
if (!F0.mkdir()) {
System.out.println(&目標文件夾不存,創建失敗!&);
File F = new File(SrcDirectoryPath);
File[] allFile = F.listFiles(); // 取得當前目錄下面的所有文件,將其放在文件數組中
int totalNum = allFile. // 取得當前文件夾中有多少文件(包括文件夾)
String srcName = &&;
String desName = &&;
int currentFile = 0;
// 一個一個的拷貝文件
for (currentFile = 0; currentFile & totalN currentFile++) {
if (!allFile[currentFile].isDirectory()) {
// 如果是文件是采用處理文件的方式
srcName = allFile[currentFile].toString();
desName = DesDirectoryPath + &/& + allFile[currentFile].getName();
copyFile(srcName, desName);
// 如果是文件夾就采用遞歸處理
// 利用遞歸讀取文件夾中的子文件下的內容,再讀子文件夾下面的子文件夾下面的內容...
if (copyDirectory(allFile[currentFile].getPath().toString(), DesDirectoryPath + &/& + allFile[currentFile].getName().toString())) {
// System.out.println(&D Copy Successfully!&);
System.out.println(&SubDirectory Copy Error!&);
} catch (Exception e) {
e.printStackTrace();
* @Description 删除文件夹
* @return void
+ public static void delFolder(String folderPath) {
delAllFile(folderPath); // 删除完里面所有内容
String filePath = folderP
filePath = filePath.toString();
File myFilePath = new File(filePath);
myFilePath.delete(); // 删除空文件夹
} catch (Exception e) {
e.printStackTrace();
+ public static boolean delFile(String path){
File f = new File(path);
return f.delete();
* @Description 删除指定文件夹下面所有子目录及文件
* @return boolean
+ public static boolean delAllFile(String path) {
boolean flag =
File file = new File(path);
if (!file.exists()) {
if (!file.isDirectory()) {
String[] tempList = file.list();
File temp =
for (int i = 0; i & tempList. i++) {
if (path.endsWith(File.separator)) {
temp = new File(path + tempList[i]);
temp = new File(path + File.separator + tempList[i]);
if (temp.isFile()) {
temp.delete();
if (temp.isDirectory()) {
delAllFile(path + &/& + tempList[i]);// 先删除文件夹里面的文件
delFolder(path + &/& + tempList[i]);// 再删除空文件夹
* 根据路径删除指定的目录或文件,无论存在与否
* @param sPath
要删除的目录或文件
* @return 删除成功返回 true,否则返回 false。
+ public boolean DeleteFolder(String sPath) {
boolean flag =
File file = new File(sPath);
// 判断目录或文件是否存在
if (!file.exists()) { // 不存在返回 false
// 判断是否为文件
if (file.isFile()) { // 为文件时调用删除文件方法
return deleteFile(sPath);
} else { // 为目录时调用删除目录方法
return deleteDirectory(sPath);
* 删除单个文件
* @param sPath
被删除文件的文件名
* @return 单个文件删除成功返回true,否则返回false
+ public boolean deleteFile(String sPath) {
boolean flag =
File file = new File(sPath);
// 路径为文件且不为空则进行删除
if (file.isFile() && file.exists()) {
file.delete();
* 删除目录(文件夹)以及目录下的文件
* @param sPath
被删除目录的文件路径
* @return 目录删除成功返回true,否则返回false
+ public boolean deleteDirectory(String sPath) {
// 如果sPath不以文件分隔符结尾,自动添加文件分隔符
if (!sPath.endsWith(File.separator)) {
sPath = sPath + File.
File dirFile = new File(sPath);
// 如果dir对应的文件不存在,或者不是一个目录,则退出
if (!dirFile.exists() || !dirFile.isDirectory()) {
boolean flag =
// 删除文件夹下的所有文件(包括子目录)
File[] files = dirFile.listFiles();
for (int i = 0; i & files. i++) {
// 删除子文件
if (files[i].isFile()) {
flag = deleteFile(files[i].getAbsolutePath());
if (!flag)
} // 删除子目录
flag = deleteDirectory(files[i].getAbsolutePath());
if (!flag)
if (!flag)
// 删除当前目录
if (dirFile.delete()) {
Index: main/java/com/peace/guitarmusic/util/ImageUtil.java
===================================================================
--- main/java/com/peace/guitarmusic/util/ImageUtil.java (revision 0)
+++ main/java/com/peace/guitarmusic/util/ImageUtil.java (revision 162)
@@ -0,0 +1,156 @@
+package com.peace.guitarmusic.
+import java.net.HttpURLC
+import java.net.URL;
+import com.peace.guitarmusic.activity.MainA
+import com.peace.guitarmusic.R;
+import android.graphics.B
+import android.os.H
+import android.widget.ImageV
+public class ImageUtil {
+ public static void setImage(final ImageView iv,final String urlStr){
iv.setImageResource(R.drawable.noimage);
if(urlStr == null)
iv.setTag(urlStr);
final Handler handler = new Handler();
final String localPath = MainActivity.rootDir.toString() + &/images/& + urlStr.hashCode();
if(FileUtils.isFileExists(localPath)){
iv.setImageBitmap(ResourceUtils.getLoacalBitmap(localPath));
if(Constants.isNeConnected){
new Thread(new Runnable() {
public void run() {
url = new URL(urlStr);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
int fileLenth = conn.getContentLength();
if(FileUtils.getFileLength(localPath) != fileLenth){
NetUtils.downloadFile(urlStr, localPath, new NetUtils.DownloadListener() {
public void onSuccessed() {
handler.post(new Runnable() {
public void run() {
if(iv.getTag() == urlStr)
iv.setImageBitmap(ResourceUtils.getLoacalBitmap(localPath));
public void onProcess(int percent) {
public void onError() {
// TODO Auto-generated method stub
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}).start();
+ public static void setImage(final ImageView iv,final String urlStr,ThreadPool pool){
iv.setImageResource(R.drawable.noimage);
if(urlStr == null)
iv.setTag(urlStr);
final Handler handler = new Handler();
final String localPath = MainActivity.rootDir.toString() + &/images/& + urlStr.hashCode();
if(FileUtils.isFileExists(localPath)){
iv.setImageBitmap(ResourceUtils.getLoacalBitmap(localPath));
if(Constants.isNeConnected){
pool.addTask(new Runnable() {
public void run() {
url = new URL(urlStr);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
int fileLenth = conn.getContentLength();
if(FileUtils.getFileLength(localPath) != fileLenth){
NetUtils.downloadFile(urlStr, localPath, new NetUtils.DownloadListener() {
public void onSuccessed() {
handler.post(new Runnable() {
public void run() {
//if(iv.getTag() == urlStr)
iv.setImageBitmap(ResourceUtils.getLoacalBitmap(localPath));
public void onProcess(int percent) {
public void onError() {
// TODO Auto-generated method stub
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
* 读取网络图片以合适大小设置给控件
+ public static void setImageFitView(final ImageView iv,final String urlStr){
iv.setBackgroundResource(R.drawable.noimage);
if(urlStr == null)
iv.setTag(urlStr);
final Handler handler = new Handler();
if(Constants.isNeConnected){
new Thread(new Runnable() {
public void run() {
final Bitmap map = NetUtils.getNetImageFitImageView(urlStr, iv.getWidth() , iv.getHeight());
handler.post(new Runnable() {
public void run() {
iv.setImageBitmap(map);
}).start();
Index: main/java/com/peace/guitarmusic/util/ThreadPool.java
===================================================================
--- main/java/com/peace/guitarmusic/util/ThreadPool.java (revision 0)
+++ main/java/com/peace/guitarmusic/util/ThreadPool.java (revision 162)
@@ -0,0 +1,188 @@
+package com.peace.guitarmusic.
+import java.io.BufferedR
+import java.io.InputStreamR
+import java.util.LinkedL
+ * 线程??
+public class ThreadPool {
+ private int maxThreads = 15;
+ private int threadN
+ private int threadID = 1;
+ private int poolID;
+ private ThreadG
+ private LinkedList&Runnable& taskQ
* @param threadNum
+ public ThreadPool(int threadNum, int id) {
this.threadNum = threadN
this.poolID =
* 初始化pool
+ public void init() {
if (threadNum & maxThreads)
threadNum = maxT
if(threadNum &= 0)
threadNum = maxT
taskQueue = new LinkedList&Runnable&();
pool = new ThreadGroup(&ThreadPool& + poolID);
for (int i = 0; i & threadN i++) {
new TaskThread().start();
* 关闭pool
+ public synchronized void destroy() {
if(pool == null)
Thread[] threads = new Thread[pool.activeCount()];
pool.enumerate(threads);
TaskThread taskT
for (int i = 0; i & threads. i++) {
taskThread = (TaskThread)threads[i];
taskThread.stopThread();
notifyAll();
for (int i = 0; i & threads. i++) {
threads[i].join();
} catch (InterruptedException ex) {
* 添加任务
* @param task
+ public synchronized void addTask(Runnable task) {
if(!active){
throw new IllegalStateException();// 线程被关则抛出IllegalStateException异常
if(task != null){
taskQueue.add(task);
+ private synchronized Runnable getTask() throws InterruptedException {
while (taskQueue.size() == 0) {
if (!active)
return (Runnable) taskQueue.removeFirst();
+ private class TaskThread extends Thread {
private boolean running =
public TaskThread() {
super(pool, &TaskThread& + (threadID++));
public void run() {
while (running) {
Runnable task =
task = getTask();
} catch (InterruptedException e) {
if (task == null)
task.run();
} catch (Throwable e) {
pool.uncaughtException(this, e);
public void stopThread() {
public String toString() {
return &[& + getId() + &][& + getName() + &][& + isAlive() + &][&
+ getState() + &]&;
+ public void setMaxThreads(int maxThreads) {
this.maxThreads = maxT
+ public int getMaxThreads() {
return this.maxT
+ public String toString() {
String description = pool.getName() + &\r\n&;
Thread[] threads = new Thread[pool.activeCount()];
pool.enumerate(threads);
for (int i = 0; i & threads. i++) {
description += threads[i].toString() + &\r\n&;
+ public static void main(String[] args) throws Exception {
ThreadPool pool = new ThreadPool(10, 333);
pool.init();
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
while (true) {
System.out.println(&请输入指??---&);
String cmd = in.readLine();
if (cmd.equals(&list&)) {
System.out.println(pool);
} else if (cmd.equals(&exit&)) {
pool.destroy();
System.out.println(pool);
} else if (cmd.equals(&notify&)) {
} else if (cmd.equals(&task&)){
for (int i = 0; i & 20; i++) {
pool.addTask(createTask(i));
* ????????的任??打印ID)
+ private static Runnable createTask(final int taskID) {
return new Runnable() {
public void run() {
System.out.println(&Task & + taskID + &: start&);
// 增加耗时
Thread.sleep(500);
} catch (InterruptedException ex) {
System.out.println(&Task & + taskID + &: end&);
Index: main/java/com/peace/guitarmusic/util/UserLogUtils.java
===================================================================
--- main/java/com/peace/guitarmusic/util/UserLogUtils.java (revision 0)
+++ main/java/com/peace/guitarmusic/util/UserLogUtils.java (revision 162)
@@ -0,0 +1,32 @@
+package com.peace.guitarmusic.
+public class UserLogUtils {
+ public static void downloadImgLog(final long songId){
new Thread(new Runnable() {
public void run() {
NetUtils.getUrlContent(Constants.WEB_URL_API_DOWNLOAD_IMG_HISTORY+&?id=&+songId);
}).start();
+ public static void playSongLog(final long songId){
new Thread(new Runnable() {
public void run() {
NetUtils.getUrlContent(Constants.WEB_URL_API_SONGPLAY_HISTORY+&?id=&+songId);
}).start();
+ public static void downAudioLog(final long songId){
new Thread(new Runnable() {
public void run() {
NetUtils.getUrlContent(Constants.WEB_URL_API_DOWNLOAD_AUDIO_HISTORY+&?id=&+songId);
}).start();
Index: main/java/com/peace/guitarmusic/util/ImageHelper.java
===================================================================
--- main/java/com/peace/guitarmusic/util/ImageHelper.java (revision 0)
+++ main/java/com/peace/guitarmusic/util/ImageHelper.java (revision 162)
@@ -0,0 +1,143 @@
+package com.peace.guitarmusic.
+import java.io.F
+import android.annotation.SuppressL
+import android.content.C
+import android.net.U
+import android.widget.ImageV
+import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscC
+import com.nostra13.universalimageloader.cache.disc.naming.HashCodeFileNameG
+import com.nostra13.universalimageloader.cache.memory.impl.LruMemoryC
+import com.nostra13.universalimageloader.core.DisplayImageO
+import com.nostra13.universalimageloader.core.ImageL
+import com.nostra13.universalimageloader.core.ImageLoaderC
+import com.nostra13.universalimageloader.core.assist.QueueProcessingT
+import com.nostra13.universalimageloader.core.download.BaseImageD
+public class ImageHelper {
+ private static ImageH
+ private ImageL
+ private C
+ private ImageHelper(Context context){
this.context =
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context)
.memoryCacheExtraOptions(480, 800) // default = device screen dimensions
.threadPoolSize(3) // default
.threadPriority(Thread.NORM_PRIORITY - 1) // default
.tasksProcessingOrder(QueueProcessingType.FIFO) // default
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new LruMemoryCache(2 * 1024 * 1024))
.memoryCacheSize(5 * 1024 * 1024)
.memoryCacheSizePercentage(13) // default
.diskCache(new UnlimitedDiscCache(new File(&/sdcard/.happyGo&))) // default
.diskCacheSize(500 * 1024 * 1024)
.diskCacheFileCount(1000)
.diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default
.imageDownloader(new BaseImageDownloader(context)) // default
.defaultDisplayImageOptions(DisplayImageOptions.createSimple()) // default
.writeDebugLogs()
loader = ImageLoader.getInstance();
loader.init(config);
+ public static ImageHelper getInstance(Context context){
if(instance == null){
instance = new ImageHelper(context);
+ public ImageLoader getLoader(){
+ @SuppressLint(&NewApi&)
+ public void displayNetImage(String url,ImageView imageView){
if(url == null){
String after =
if(url.endsWith(&.jpg&)){
after = &.jpg&;
}else if(url.endsWith(&.jpeg&)){
after = &.jpeg&;
}else if(url.endsWith(&.png&)){
after = &.png&;
url = url.replace(after, &_800x800_0&)+
url = url.replace(after, &_&+imageView.getMeasuredWidth()+&x&+imageView.getMeasuredHeight()+&_1&)+
DisplayImageOptions options = new DisplayImageOptions.Builder()
.showStubImage(R.drawable.ic_stub)
// image在加载过程中,显示的图片
.showImageForEmptyUri(R.drawable.ic_empty)
// empty URI时显示的图片
.showImageOnFail(R.drawable.ic_error)
// 不是图片文件 显示图片
.resetViewBeforeLoading(false)
// default
.delayBeforeLoading(1000)
.cacheInMemory(false)
// default 不缓存至内存
.cacheOnDisc(true)
// default 不缓存至手机SDCard
.cacheOnDisk(true)
.preProcessor(...)
.postProcessor(...)
.extraForDownloader(...)
.imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2)// default
.bitmapConfig(Bitmap.Config.ARGB_8888)
// default
.decodingOptions(...)
.displayer(new SimpleBitmapDisplayer()) // default 可以设置动画,比如圆角或者渐变
.handler(new Handler())
// default
loader.displayImage(url, imageView,options);
+ @SuppressLint(&NewApi&)
+ public void displayNetImage(String url,ImageView imageView,int width ,int height){
if(url == null){
imageView.setImageBitmap(null);
String after =
if(url.endsWith(&.jpg&)){
after = &.jpg&;
}else if(url.endsWith(&.jpeg&)){
after = &.jpeg&;
}else if(url.endsWith(&.png&)){
after = &.png&;
if(after == null){
url = url.replace(after, &_480x480_0&)+
url = url.replace(after, &_&+width+&x&+height+&_1&)+
DisplayImageOptions options = new DisplayImageOptions.Builder()
.showStubImage(R.drawable.ic_stub)
// image在加载过程中,显示的图片
.showImageForEmptyUri(R.drawable.ic_empty)
// empty URI时显示的图片
.showImageOnFail(R.drawable.ic_error)
// 不是图片文件 显示图片
.resetViewBeforeLoading(false)
// default
.delayBeforeLoading(1000)
.cacheInMemory(false)
// default 不缓存至内存
.cacheOnDisc(true)
// default 不缓存至手机SDCard
.cacheOnDisk(true)
.preProcessor(...)
.postProcessor(...)
.extraForDownloader(...)
.imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2)// default
.bitmapConfig(Bitmap.Config.ARGB_8888)
// default
.decodingOptions(...)
.displayer(new SimpleBitmapDisplayer()) // default 可以设置动画,比如圆角或者渐变
.handler(new Handler())
// default
loader.displayImage(url, imageView,options);
+ public void displayLocalImage(String path,ImageView imageView){
loader.displayImage(Uri.fromFile(new File(path)).toString(),imageView);
Index: main/java/com/peace/guitarmusic/util/MyMediaPlayer.java
===================================================================
--- main/java/com/peace/guitarmusic/util/MyMediaPlayer.java (revision 0)
+++ main/java/com/peace/guitarmusic/util/MyMediaPlayer.java (revision 162)
@@ -0,0 +1,232 @@
+//package com.peace.guitarmusic.
+//import java.io.IOE
+//import java.util.ArrayL
+//import java.util.L
+//import com.peace.guitarmusic.activity.MainA
+//import com.peace.guitarmusic.bean.S
+//import android.media.AudioM
+//import android.media.MediaP
+//import android.media.MediaPlayer.OnBufferingUpdateL
+//import android.media.MediaPlayer.OnCompletionL
+//import android.media.MediaPlayer.OnErrorL
+//import android.media.MediaPlayer.OnPreparedL
+//import android.media.MediaPlayer.OnSeekCompleteL
+//import android.util.L
+//public class MyMediaPlayer implements OnBufferingUpdateListener, OnErrorListener, OnSeekCompleteListener,
OnPreparedListener, OnCompletionListener {
+// private MediaP
+// private static MyMediaP
+// private boolean isS
+// private List&MyMediaPlayerListener& listeners = new ArrayList&MyMediaPlayerListener&();
+// // private String sourceP
+// private S
+// private boolean canGetI
+// private MediaPlayer getPlayer() {
+// public void registerListener(MyMediaPlayerListener listener) {
this.listeners.add(listener);
+// public void unRegisterListener(MyMediaPlayerListener listener) {
listeners.remove(listener);
+// public void stop() {
canGetInfo =
player.stop();
isStoped =
+// public boolean setDataSourceAndStart(Story story) {
this.story =
canGetInfo =
player.reset();
if(story.isDownloaded()){
player.setDataSource(story.getVoiceLocalPath());
player.setDataSource(story.getVoiceUrl());
player.prepare();
canGetInfo =
} catch (IOException e) {
+// public boolean isStoped() {
return isS
+// public void start() {
if (isStoped()) {
player.reset();
if(story.isDownloaded()){
player.setDataSource(story.getVoiceLocalPath());
player.setDataSource(story.getVoiceUrl());
for (MyMediaPlayerListener listener : listeners) {
listener.onStartPrepare();
player.prepare();
player.start();
isStoped =
for (MyMediaPlayerListener listener : listeners) {
listener.onPlayerStart(story);
} catch (Exception e) {
e.printStackTrace();
player.start();
isStoped =
for (MyMediaPlayerListener listener : listeners) {
listener.onPlayerStart(story);
+// public void pause() {
player.pause();
for (MyMediaPlayerListener listener : listeners) {
listener.onPlayerPause();
+// public void reset() {
player.reset();
+// private MyMediaPlayer() {
player = new MediaPlayer();
player.setAudioStreamType(AudioManager.STREAM_MUSIC);
player.setOnBufferingUpdateListener(this);
player.setOnCompletionListener(this);
player.setOnErrorListener(this);
player.setOnSeekCompleteListener(this);
player.setOnPreparedListener(this);
new Thread() {
public void run() {
while (MainActivity.running) {
MainActivity.handler.post(new Runnable() {
public void run() {
for (MyMediaPlayerListener listener : listeners) {
if (canGetInfo) {
listener.onProgress(player.getCurrentPosition(), player.getDuration());
Thread.sleep(400);
} catch (InterruptedException e) {
e.printStackTrace();
}.start();
+// public static MyMediaPlayer getInstance() {
if (instance == null) {
instance = new MyMediaPlayer();
+// @Override
+// public void onCompletion(MediaPlayer arg0) {
Log.e(&peace&, &onCompletion&);
for (MyMediaPlayerListener listener : listeners) {
listener.onPalyerCompletion();
+// @Override
+// public void onPrepared(MediaPlayer arg0) {
for (MyMediaPlayerListener listener : listeners) {
listener.onPrepared();
Log.e(&peace&, &onPrepared&);
+// @Override
+// public void onSeekComplete(MediaPlayer arg0) {
Log.e(&peace&, &onSeekComplete&);
+// @Override
+// public boolean onError(MediaPlayer arg0, int arg1, int arg2) {
Log.e(&peace&, &onError&);
player.reset();
player.setDataSource(story.getVoiceUrl());
player.prepare();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
+// @Override
+// public void onBufferingUpdate(MediaPlayer arg0, int arg1) {
for (MyMediaPlayerListener listener : listeners) {
listener.onPlayerBufferingUpdate(arg1);
Log.e(&peace&, &onBufferingUpdate arg1=& + arg1);
+// public void seekTo(int percent) {
player.seekTo((int) (percent / 100f * player.getDuration()));
+// public interface MyMediaPlayerListener {
void onPlayerStart(Story story);
void onPlayerPause();
void onProgress(int current, int duration);
void onPlayerStop();
void onPalyerCompletion();
void onPlayerBufferingUpdate(int percent);
void onPrepared();
void onStartPrepare();
+// public Story getStory() {
+// public void setStory(Story story) {
this.story =
Index: main/java/com/peace/guitarmusic/service/UserService.java
===================================================================
--- main/java/com/peace/guitarmusic/service/UserService.java (revision 0)
+++ main/java/com/peace/guitarmusic/service/UserService.java (revision 162)
@@ -0,0 +1,106 @@
+package com.peace.guitarmusic.
+import java.io.BufferedR
+import java.io.FileInputS
+import java.io.FileNotFoundE
+import java.io.FileOutputS
+import java.io.IOE
+import java.io.InputStreamR
+import java.io.ObjectInputS
+import java.io.ObjectOutputS
+import java.io.StreamCorruptedE
+import android.content.C
+import android.content.I
+import com.peace.guitarmusic.bean.U
+import com.peace.guitarmusic.util.C
+import com.peace.guitarmusic.util.FileU
+public class UserService {
+ private static UserS
+ private S
+ private U
UserService(){
+ public static UserService getInstance(){
if(instance == null){
instance =
new UserService();
+ public void logout(Context context){
context.sendBroadcast(new Intent(Constants.ACTION_LOGOUT));
FileUtils.delFile(&/sdcard/.ldg/loginInfo&);
FileUtils.delFile(&/sdcard/.ldg/token&);
+ public void loginFromLocal(){
ObjectInputStream in = new ObjectInputStream(new FileInputStream(&/sdcard/.ldg/loginInfo&));
setCurrentLoginUser((User) in.readObject());
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(&/sdcard/.ldg/token&)));
setToken(reader.readLine());
in.close();
reader.close();
} catch (StreamCorruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
+ public boolean login(String token,User user){
setToken(token);
setCurrentLoginUser(user);
FileUtils.mkdirIfnotExists(&/sdcard/.ldg&);
ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(&/sdcard/.ldg/loginInfo&));
out.writeObject(user);
out.close();
FileOutputStream fOut = new FileOutputStream(&/sdcard/.ldg/token&);
fOut.write(token.getBytes());
fOut.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
+ public User getCurrentLoginUser(){
+ private void setCurrentLoginUser(User user){
this.user =
+ public String getToken() {
+ private void setToken(String token) {
this.token =
Index: main/java/com/peace/guitarmusic/fragment/BlogFragment.java
===================================================================
--- main/java/com/peace/guitarmusic/fragment/BlogFragment.java (revision 0)
+++ main/java/com/peace/guitarmusic/fragment/BlogFragment.java (revision 162)
@@ -0,0 +1,23 @@
+package com.peace.guitarmusic.
+import android.app.F
+import android.os.B
+import android.support.annotation.N
+import android.view.LayoutI
+import android.view.V
+import android.view.ViewG
+import com.peace.guitarmusic.R;
+ * Created by Administrator on .
+public class BlogFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_blog, null);
Index: main/java/com/peace/guitarmusic/fragment/HomeFragment.java
===================================================================
--- main/java/com/peace/guitarmusic/fragment/HomeFragment.java (revision 0)
+++ main/java/com/peace/guitarmusic/fragment/HomeFragment.java (revision 162)
@@ -0,0 +1,215 @@
+package com.peace.guitarmusic.
+import android.app.F
+import android.os.B
+import android.os.H
+import android.os.M
+import android.support.annotation.N
+import android.support.v4.view.ViewP
+import android.util.L
+import android.view.LayoutI
+import android.view.TextureV
+import android.view.V
+import android.view.ViewG
+import android.widget.AbsListV
+import android.widget.BaseA
+import android.widget.ImageV
+import android.widget.ListV
+import android.widget.TextV
+import com.peace.guitarmusic.R;
+import com.peace.guitarmusic.bean.B
+import com.peace.guitarmusic.bean.P
+import com.peace.guitarmusic.util.ImageH
+import java.util.ArrayL
+import java.util.L
+ * Created by Administrator on .
+public class HomeFragment extends Fragment implements AbsListView.OnScrollListener {
public static final int MSG_BLOG = 1;
private LayoutI
private ViewPager bannerP
private ViewPager singerP
private List&ImageView& bannerViews = new ArrayList&ImageView&();
private List&View& singerViews = new ArrayList&View&();
private ListView listV
private View footerV
private boolean isToL
private boolean isL
private boolean isD
private List&Blog& blogList = new ArrayList&&();
private BlogAdapter blogA
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_home, null);
bannerPager =
(ViewPager) v.findViewById(R.id.bannerPager);
singerPager = (ViewPager)v.findViewById(R.id.singerPager);
listView = (ListView) v.findViewById(R.id.listView);
View headerView = inflater.inflate(R.layout.home_fragment_header,
listView.addHeaderView(headerView);
footerView = inflater.inflate(R.layout.listfooter, null);
listView.addFooterView(footerView);
blogAdapter = new BlogAdapter();
listView.setAdapter(blogAdapter);
initHandler();
loadData();
private void loadData(){
new Thread(new Runnable() {
public void run() {
bannerResult
= ApiManager.getInstance(getActivity()).getBanner(&home&);
handler.sendEmptyMessage(MSG_BANNER_RESULT);
newProductResult = ApiManager.getInstance(getActivity()).getNewProductInfo(1, 99);
handler.sendEmptyMessage(MSG_NEWPRODUCT_RESULT);
categoryResult = ApiManager.getInstance(getActivity()).getCategory

我要回帖

更多关于 tscttp244pro页面设置 的文章

 

随机推荐