当前位置: 编程技术>移动开发
本页文章导读:
▪座标数据收集 坐标数据收集
ublic class GPSDataCollectorService extends Service {
private static final String TAG = GPSDataCollectorService.class
.getSimpleName();
LocationManager locationManager;
LocationListener gpsLoca.........
▪ QuickSearcheBox-SearchWidgetConfigActivity QuickSearcheBox---SearchWidgetConfigActivity
再把QuickSearchBox放到桌面前,会先触发它的ConfigAcitivty,而这个config是对search 范围的选择:All, Web, Contact,Music...它的表现形式会有两种选择:一种是用ListView,.........
▪ 制造默认开机动画 制作默认开机动画
刷第一个开机画面软件使用教程:先打开机子的fastboot模式1:先找好图片(适合自己分辨率的图片)放在工具里(最好是PNG格式,其他格式容易失真)2:点开 G2开机画面制作工.........
[1]座标数据收集
来源: 互联网 发布时间: 2014-02-18
坐标数据收集
ublic class GPSDataCollectorService extends Service { private static final String TAG = GPSDataCollectorService.class .getSimpleName(); LocationManager locationManager; LocationListener gpsLocationListener; @Override public IBinder onBind(Intent intent) { return null; } @Override public void onCreate() { super.onCreate(); locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); gpsLocationListener = new GPSLocationListener(); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 10 * 1000L, 0, gpsLocationListener); } @Override public void onDestroy() { super.onDestroy(); Log.i(TAG, "Service destroying"); locationManager.removeUpdates(gpsLocationListener); } private class GPSLocationListener implements LocationListener { @Override public void onLocationChanged(Location location) { Log.d(TAG, "onLocationChanged: " + location.toString()); } @Override public void onStatusChanged(String provider, int status, Bundle extras) { Log.d(TAG, "onStatusChanged: " + status); } @Override public void onProviderEnabled(String provider) { // TODO Auto-generated method stub } @Override public void onProviderDisabled(String provider) { // TODO Auto-generated method stub } } }
[2] QuickSearcheBox-SearchWidgetConfigActivity
来源: 互联网 发布时间: 2014-02-18
QuickSearcheBox---SearchWidgetConfigActivity
再把QuickSearchBox放到桌面前,会先触发它的ConfigAcitivty,而这个config是对search 范围的选择:All, Web, Contact,Music...它的表现形式会有两种选择:一种是用ListView,另一种是用GridView.那么这里就会用到接口编程了。
我们先来看看用ListView显示的做法:Google将header+listview这样Activity用一个叫ChoiceActivty来实现,这样独立的模块,我们以后再开发的过程,若有需要也可以直接拿来用了,这样就做到了代码的重复利用了。
SearchWidgetConfigActivity就会继承ChoiceActivity:
protected CorpusView createView(ViewGroup parent) {
if (mGridView) {
return mViewFactory.createGridCorpusView(parent);
} else {
return mViewFactory.createListCorpusView(parent);
}
}这里就选择了是用GridView还是用ListView
这里就用到了接口编程的思想了:将一些规则抽象到CorpusViewFactory里面,那么通过CorpusViewFactory直接调用,不用管是如何实现的。真正的实现是在CorpusViewInflater。从代码看来若你想把ListView换成Gridview来表现,只需修改小部分代码:
1,SearchWidgetConfigActivity中:
@Override
protected void onStart() {
setAdapter(CorporaAdapter.createListAdapter(getViewFactory(), getCorpusRanker()));
super.onStart();
}
-->
@Override
protected void onStart() {
setAdapter(CorporaAdapter.createGridAdapter(getViewFactory(), getCorpusRanker()));
super.onStart();
}
2,ChoiceActivity中的choice_activity.xml
从这个例子中,可以看出了接口编程思想的重要与方便性。也许我讲得不是很清楚很明白,语言表达能力有限,只可意会不可言传。呵呵...
今天才发现,其实QuickSearchBox也用了GridView来显示search 范围的,是在CorpusSelectionDialog。
ListView的效果可以看附件里面的Listview.png,GridView看Gridview.png
再把QuickSearchBox放到桌面前,会先触发它的ConfigAcitivty,而这个config是对search 范围的选择:All, Web, Contact,Music...它的表现形式会有两种选择:一种是用ListView,另一种是用GridView.那么这里就会用到接口编程了。
我们先来看看用ListView显示的做法:Google将header+listview这样Activity用一个叫ChoiceActivty来实现,这样独立的模块,我们以后再开发的过程,若有需要也可以直接拿来用了,这样就做到了代码的重复利用了。
/* * Copyright (C) 2009 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.quicksearchbox; import android.app.Activity; import android.os.Bundle; import android.view.Window; import android.widget.AdapterView; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.TextView; /** * Activity that shows a list of choices. */ public abstract class ChoiceActivity extends Activity { protected TextView mTitleView; protected ListView mChoicesView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().requestFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.choice_activity); mTitleView = (TextView) findViewById(R.id.alertTitle); mChoicesView = (ListView) findViewById(R.id.list); } public void setHeading(int titleRes) { mTitleView.setText(titleRes); } public void setHeading(CharSequence title) { mTitleView.setText(title); } public void setAdapter(ListAdapter adapter) { mChoicesView.setAdapter(adapter); } public void setOnItemClickListener(AdapterView.OnItemClickListener listener) { mChoicesView.setOnItemClickListener(listener); // TODO: for some reason, putting this in the XML layout instead makes // the list items unclickable. mChoicesView.setFocusable(true); } }
SearchWidgetConfigActivity就会继承ChoiceActivity:
/* * Copyright (C) 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.quicksearchbox; import com.android.quicksearchbox.ui.CorporaAdapter; import com.android.quicksearchbox.ui.CorpusViewFactory; import android.appwidget.AppWidgetManager; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.AdapterView; import android.widget.ListAdapter; /** * The configuration screen for search widgets. */ public class SearchWidgetConfigActivity extends ChoiceActivity { private static final boolean DBG = false; private static final String TAG = "QSB.SearchWidgetConfigActivity"; private static final String PREFS_NAME = "SearchWidgetConfig"; private static final String WIDGET_CORPUS_NAME_PREFIX = "widget_corpus_"; private static final String WIDGET_CORPUS_SHOWING_HINT_PREFIX = "widget_showing_hint_"; private CorporaAdapter mAdapter; private int mAppWidgetId; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setHeading(R.string.search_widget); setOnItemClickListener(new SourceClickListener()); Intent intent = getIntent(); mAppWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID); if (mAppWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) { finish(); } // If there is only All, or only All and one other corpus, there is no // point in asking the user to select a corpus. if (getCorpusRanker().getRankedCorpora().size() <= 1) { selectCorpus(null); } } @Override protected void onStart() { setAdapter(CorporaAdapter.createListAdapter(getViewFactory(), getCorpusRanker())); super.onStart(); } @Override protected void onStop() { setAdapter(null); super.onStop(); } @Override public void setAdapter(ListAdapter adapter) { if (adapter == mAdapter) return; if (mAdapter != null) mAdapter.close(); mAdapter = (CorporaAdapter) adapter; super.setAdapter(adapter); } protected void selectCorpus(Corpus corpus) { setWidgetCorpusName(mAppWidgetId, corpus); SearchWidgetProvider.updateSearchWidgets(this); Intent result = new Intent(); result.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId); setResult(RESULT_OK, result); finish(); } private static SharedPreferences getWidgetPreferences(Context context) { return context.getSharedPreferences(PREFS_NAME, MODE_PRIVATE); } private static String getCorpusNameKey(int appWidgetId) { return WIDGET_CORPUS_NAME_PREFIX + appWidgetId; } private static String getShowingHintKey(int appWidgetId) { return WIDGET_CORPUS_SHOWING_HINT_PREFIX + appWidgetId; } private void setWidgetCorpusName(int appWidgetId, Corpus corpus) { String corpusName = corpus == null ? null : corpus.getName(); SharedPreferences.Editor prefs = getWidgetPreferences(this).edit(); prefs.putString(getCorpusNameKey(appWidgetId), corpusName); prefs.commit(); } public static String getWidgetCorpusName(Context context, int appWidgetId) { SharedPreferences prefs = getWidgetPreferences(context); return prefs.getString(getCorpusNameKey(appWidgetId), null); } public static void setWidgetShowingHint(Context context, int appWidgetId, boolean showing) { SharedPreferences.Editor prefs = getWidgetPreferences(context).edit(); prefs.putBoolean(getShowingHintKey(appWidgetId), showing); boolean c = prefs.commit(); if (DBG) Log.d(TAG, "Widget " + appWidgetId + " set showing hint " + showing + "("+c+")"); } public static boolean getWidgetShowingHint(Context context, int appWidgetId) { SharedPreferences prefs = getWidgetPreferences(context); boolean r = prefs.getBoolean(getShowingHintKey(appWidgetId), false); if (DBG) Log.d(TAG, "Widget " + appWidgetId + " showing hint: " + r); return r; } private CorpusRanker getCorpusRanker() { return QsbApplication.get(this).getCorpusRanker(); } private CorpusViewFactory getViewFactory() { return QsbApplication.get(this).getCorpusViewFactory(); } private class SourceClickListener implements AdapterView.OnItemClickListener { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Corpus corpus = (Corpus) parent.getItemAtPosition(position); selectCorpus(corpus); } } }从setAdapter(CorporaAdapter.createListAdapter(getViewFactory(), getCorpusRanker()));不管是ListView还是用GrideView都会用到Adapter.
/* * Copyright (C) 2009 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.quicksearchbox.ui; import com.android.quicksearchbox.Corpus; import com.android.quicksearchbox.CorpusRanker; import android.database.DataSetObserver; import android.graphics.drawable.Drawable; import android.util.Log; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import java.util.ArrayList; import java.util.List; /** * Adapter for showing a list of sources in the source selection activity. */ public class CorporaAdapter extends BaseAdapter { private static final String TAG = "CorporaAdapter"; private static final boolean DBG = false; private final CorpusViewFactory mViewFactory; private final CorpusRanker mRanker; private final DataSetObserver mCorporaObserver = new CorporaObserver(); private List<Corpus> mRankedEnabledCorpora; private boolean mGridView; private CorporaAdapter(CorpusViewFactory viewFactory, CorpusRanker ranker, boolean gridView) { mViewFactory = viewFactory; mRanker = ranker; mGridView = gridView; mRanker.registerDataSetObserver(mCorporaObserver); updateCorpora(); } public static CorporaAdapter createListAdapter(CorpusViewFactory viewFactory, CorpusRanker ranker) { return new CorporaAdapter(viewFactory, ranker, false); } public static CorporaAdapter createGridAdapter(CorpusViewFactory viewFactory, CorpusRanker ranker) { return new CorporaAdapter(viewFactory, ranker, true); } private void updateCorpora() { mRankedEnabledCorpora = new ArrayList<Corpus>(); for (Corpus corpus : mRanker.getRankedCorpora()) { if (!corpus.isCorpusHidden()) { mRankedEnabledCorpora.add(corpus); } } notifyDataSetChanged(); } public void close() { mRanker.unregisterDataSetObserver(mCorporaObserver); } public int getCount() { return 1 + mRankedEnabledCorpora.size(); } public Corpus getItem(int position) { if (position == 0) { return null; } else { return mRankedEnabledCorpora.get(position - 1); } } public long getItemId(int position) { return position; } /** * Gets the position of the given corpus. */ public int getCorpusPosition(Corpus corpus) { if (corpus == null) { return 0; } int count = getCount(); for (int i = 0; i < count; i++) { if (corpus.equals(getItem(i))) { return i; } } Log.w(TAG, "Corpus not in adapter: " + corpus); return 0; } public View getView(int position, View convertView, ViewGroup parent) { CorpusView view = (CorpusView) convertView; if (view == null) { view = createView(parent); } Corpus corpus = getItem(position); Drawable icon; CharSequence label; if (corpus == null) { icon = mViewFactory.getGlobalSearchIcon(); label = mViewFactory.getGlobalSearchLabel(); } else { icon = corpus.getCorpusIcon(); label = corpus.getLabel(); } if (DBG) Log.d(TAG, "Binding " + position + ", label=" + label); view.setIcon(icon); view.setLabel(label); return view; } protected CorpusView createView(ViewGroup parent) { if (mGridView) { return mViewFactory.createGridCorpusView(parent); } else { return mViewFactory.createListCorpusView(parent); } } private class CorporaObserver extends DataSetObserver { @Override public void onChanged() { updateCorpora(); } @Override public void onInvalidated() { updateCorpora(); } } }
protected CorpusView createView(ViewGroup parent) {
if (mGridView) {
return mViewFactory.createGridCorpusView(parent);
} else {
return mViewFactory.createListCorpusView(parent);
}
}这里就选择了是用GridView还是用ListView
/* * Copyright (C) 2009 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.quicksearchbox.ui; import android.graphics.drawable.Drawable; import android.net.Uri; import android.view.ViewGroup; /** * Creates corpus views. */ public interface CorpusViewFactory { CorpusView createGridCorpusView(ViewGroup parentViewType); CorpusView createListCorpusView(ViewGroup parentViewType); String getGlobalSearchLabel(); Drawable getGlobalSearchIcon(); Uri getGlobalSearchIconUri(); }
/* * Copyright (C) 2009 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.quicksearchbox.ui; import com.android.quicksearchbox.R; import com.android.quicksearchbox.util.Util; import android.content.Context; import android.graphics.drawable.Drawable; import android.net.Uri; import android.view.LayoutInflater; import android.view.ViewGroup; /** * Inflates corpus views. */ public class CorpusViewInflater implements CorpusViewFactory { private final Context mContext; public CorpusViewInflater(Context context) { mContext = context; } protected LayoutInflater getInflater() { return (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } public CorpusView createGridCorpusView(ViewGroup parentViewType) { return inflateCorpusView(R.layout.corpus_grid_item, parentViewType); } public CorpusView createListCorpusView(ViewGroup parentViewType) { return inflateCorpusView(R.layout.corpus_list_item, parentViewType); } protected CorpusView inflateCorpusView(int res, ViewGroup parentViewType) { return (CorpusView) getInflater().inflate(res, parentViewType, false); } public String getGlobalSearchLabel() { return mContext.getString(R.string.corpus_label_global); } private int getGlobalSearchIconResource() { return R.drawable.search_app_icon; } public Drawable getGlobalSearchIcon() { return mContext.getResources().getDrawable(getGlobalSearchIconResource()); } public Uri getGlobalSearchIconUri() { return Util.getResourceUri(mContext, getGlobalSearchIconResource()); } }
/* * Copyright (C) 2009 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.quicksearchbox.ui; import com.android.quicksearchbox.R; import android.content.Context; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; /** * A corpus in the corpus selection list. */ public class CorpusView extends RelativeLayout { private ImageView mIcon; private TextView mLabel; public CorpusView(Context context, AttributeSet attrs) { super(context, attrs); } public CorpusView(Context context) { super(context); } @Override protected void onFinishInflate() { super.onFinishInflate(); mIcon = (ImageView) findViewById(R.id.source_icon); mLabel = (TextView) findViewById(R.id.source_label); } public void setLabel(CharSequence label) { mLabel.setText(label); } public void setIcon(Drawable icon) { mIcon.setImageDrawable(icon); } }
这里就用到了接口编程的思想了:将一些规则抽象到CorpusViewFactory里面,那么通过CorpusViewFactory直接调用,不用管是如何实现的。真正的实现是在CorpusViewInflater。从代码看来若你想把ListView换成Gridview来表现,只需修改小部分代码:
1,SearchWidgetConfigActivity中:
@Override
protected void onStart() {
setAdapter(CorporaAdapter.createListAdapter(getViewFactory(), getCorpusRanker()));
super.onStart();
}
-->
@Override
protected void onStart() {
setAdapter(CorporaAdapter.createGridAdapter(getViewFactory(), getCorpusRanker()));
super.onStart();
}
2,ChoiceActivity中的choice_activity.xml
<?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2010 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/parentPanel" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:paddingTop="9dip" android:paddingBottom="3dip" android:paddingLeft="3dip" android:paddingRight="1dip" > <LinearLayout android:id="@+id/topPanel" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="54dip" android:background="@drawable/popup_top_dark" android:orientation="vertical"> <LinearLayout android:id="@+id/titlePanel" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_vertical" android:layout_marginTop="6dip" android:layout_marginBottom="9dip" android:layout_marginLeft="10dip" android:layout_marginRight="10dip" > <ImageView android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="top" android:paddingTop="6dip" android:paddingRight="10dip" android:src="/blog_article/@drawable/ic_dialog_menu_generic/index.html" /> <TextView android:id="@+id/alertTitle" android:singleLine="false" android:maxLines="3" android:ellipsize="end" android:layout_width="match_parent" android:layout_height="wrap_content" /> </LinearLayout> </LinearLayout> <ListView android:id="@+id/list" android:layout_width="match_parent" android:layout_height="match_parent" android:cacheColorHint="@null" android:background="@drawable/popup_bottom_bright" android:divider="@drawable/divider_horizontal_bright" android:scrollbars="vertical" /> </LinearLayout>中的ListView换成GridView就可以了。
从这个例子中,可以看出了接口编程思想的重要与方便性。也许我讲得不是很清楚很明白,语言表达能力有限,只可意会不可言传。呵呵...
今天才发现,其实QuickSearchBox也用了GridView来显示search 范围的,是在CorpusSelectionDialog。
ListView的效果可以看附件里面的Listview.png,GridView看Gridview.png
[3] 制造默认开机动画
来源: 互联网 发布时间: 2014-02-18
制作默认开机动画
刷第一个开机画面软件使用教程:
先打开机子的fastboot模式
1:先找好图片(适合自己分辨率的图片)放在工具里(最好是PNG格式,其他格式容易失真)
2:点开 G2开机画面制作工具
3:点OPEN打开图片
4:点convert生成第一个开机画面文件
5:刷开机画面(系统C:\WINDOWS\system32里面必须有Adb那2个文件)
刷第二屏开机画面比较麻烦
下面分析一下2.0、2.1系统开机画面的构成
文件名为bootanimation.zip 一定是这个不能修改
里面包含part1 part2文件夹 和desc.txt(另一种就是android文件夹+desc.txt,这样设置就可以改系统开机几秒的音乐了)
part 文件夹里面放的是动画拆分的图片 格式为png 大家可以自己制作
desc.txt里面是播放的设置
格式是这样的
480 800 15
p 1 0 part1
p 0 0 part2
480 800是指显示的分辨率 宽 高
15是一秒的帧数
p后面的数字是指播放次数 0为循环
后面那位数字 一般为0 pause If pause = 10, it will show the last frame and then sleep 10/fps seconds before continuing with the animation.这是外国人写的 没有很大影响
part0 为文件夹名
为什么要用两个文件夹呢 其实一个也可以的
按照我的设置
part1是播放一遍的
part2是循环播放直到开机
这里看懂了 就可以开始制作了 按照上面的格式搞好之后用 zip软件打包(最好把原来的bootanimation.zip备份一份)
注意文件名不能错一定为bootanimation.zip
制作bootanimation.zip
首先从里面的图片说起 图片一定要转换成PNG格式,建议找到的图片要和自己机子的分辨率一样,如果不是也可以的 有可能变形 注意图片的大小要统一(如果不会做连接的图片组 直接找个适合自己分辨率的动态图片分解出PNG格式的静态图片,用ImageReady可以批量导出)
建立part1 part2或android文件夹 放进一组连接的图片组
开始压缩成ZIP格式 名字一定要bootanimation.zip 压缩方式一定是存储 压缩完了看下大小一般最大的2MB左右 太大了用JPEG Imager压缩下 压缩图片很好的
开始写desc.txt (文件每节后面有个黑色符号不知道是什么 最好写的时候看下我传的样本)
desc.txt 格式(解释看上面)
有2个文件夹 part1、part2 (此种没开机声音)
代码:
320 480 15
p 1 1 part1
p 0 0 part2
有1个文件夹 android (有声音 声音文件下面讲解)
320 480 15
p 1 1 android
保存后拖入bootanimation.zip 里面OK
android文件夹的声音文件制作
把一个体积很小的MP3文件改成android_audio.mp3 放到system/media/ 和system/customize/resource/
刷的时候直接用ES或Root explorer打开system读写权限R/O 直接用ES、Root explorer或91助手(用 91的时候也要用ES或Root explorer打开system读写权限R/O)替换system/media/bootanimation.zip 和system/customize/resource/bootanimation.zip 两处的文件 重新启动成功刷完2.0、2.1系统的开机第二画面
刷第一个开机画面软件使用教程:
先打开机子的fastboot模式
1:先找好图片(适合自己分辨率的图片)放在工具里(最好是PNG格式,其他格式容易失真)
2:点开 G2开机画面制作工具
3:点OPEN打开图片
4:点convert生成第一个开机画面文件
5:刷开机画面(系统C:\WINDOWS\system32里面必须有Adb那2个文件)
刷第二屏开机画面比较麻烦
下面分析一下2.0、2.1系统开机画面的构成
文件名为bootanimation.zip 一定是这个不能修改
里面包含part1 part2文件夹 和desc.txt(另一种就是android文件夹+desc.txt,这样设置就可以改系统开机几秒的音乐了)
part 文件夹里面放的是动画拆分的图片 格式为png 大家可以自己制作
desc.txt里面是播放的设置
格式是这样的
480 800 15
p 1 0 part1
p 0 0 part2
480 800是指显示的分辨率 宽 高
15是一秒的帧数
p后面的数字是指播放次数 0为循环
后面那位数字 一般为0 pause If pause = 10, it will show the last frame and then sleep 10/fps seconds before continuing with the animation.这是外国人写的 没有很大影响
part0 为文件夹名
为什么要用两个文件夹呢 其实一个也可以的
按照我的设置
part1是播放一遍的
part2是循环播放直到开机
这里看懂了 就可以开始制作了 按照上面的格式搞好之后用 zip软件打包(最好把原来的bootanimation.zip备份一份)
注意文件名不能错一定为bootanimation.zip
制作bootanimation.zip
首先从里面的图片说起 图片一定要转换成PNG格式,建议找到的图片要和自己机子的分辨率一样,如果不是也可以的 有可能变形 注意图片的大小要统一(如果不会做连接的图片组 直接找个适合自己分辨率的动态图片分解出PNG格式的静态图片,用ImageReady可以批量导出)
建立part1 part2或android文件夹 放进一组连接的图片组
开始压缩成ZIP格式 名字一定要bootanimation.zip 压缩方式一定是存储 压缩完了看下大小一般最大的2MB左右 太大了用JPEG Imager压缩下 压缩图片很好的
开始写desc.txt (文件每节后面有个黑色符号不知道是什么 最好写的时候看下我传的样本)
desc.txt 格式(解释看上面)
有2个文件夹 part1、part2 (此种没开机声音)
代码:
320 480 15
p 1 1 part1
p 0 0 part2
有1个文件夹 android (有声音 声音文件下面讲解)
320 480 15
p 1 1 android
保存后拖入bootanimation.zip 里面OK
android文件夹的声音文件制作
把一个体积很小的MP3文件改成android_audio.mp3 放到system/media/ 和system/customize/resource/
刷的时候直接用ES或Root explorer打开system读写权限R/O 直接用ES、Root explorer或91助手(用 91的时候也要用ES或Root explorer打开system读写权限R/O)替换system/media/bootanimation.zip 和system/customize/resource/bootanimation.zip 两处的文件 重新启动成功刷完2.0、2.1系统的开机第二画面
最新技术文章: