deb:Debian软件包格式的文件扩展名。debian和ubuntu等采用。
rpm:Red Hat Package Manager的缩写,是Red Hat贡献出来的软件包管理。Fedora、Redhat、SuSE等采用。
一般而言,Linux版本软件发布时,第一会根据32位机和64位机分类,第二会根据是否是deb分类。例如sun提供的OOo下载版
rpm格式的OOo安装
在官方网站下载安装包,是tar格式的,解压后,有一下三个文件夹licenses、readmes、RPMS。将整个文件拷贝到linux下,然后进行安装
步骤一:卸载已有的OOo2.4:sudo apt-get autoremove openoffice.org*
;
步骤二:解压OOo3.1并进入到RPMS目录;rpm -ivh *.rpm(安装所有rpm文件);
步骤四:进入到desktop-integration目录;安装openoffice.org-redhat-menus-2.0.2-3.noarch.rpm
deb格式的OOo安装
步骤一:卸载已有的OOo2.4:sudo apt-get autoremove openoffice.org*
;
步骤二:解压OOo3.1并进入到RPMS目录;sudo dpkg -i *.deb
(安装所有deb文件);此时已安装好OOo;
步骤三:添加OOo3到系统菜单:进入到desktop-integration
目录;安装openoffice.org3.1-debian-menus_3.1-9393_all.deb
步骤二结束后,OOo3已安装成功,但并没有把OpenOffice3添加到系统菜单中的Application中去。如果要添加的话,必须先卸载掉OOo2。然后进入desktop-integration
目录,执行
sudo dpkg -i *.deb。
前天刚入手了一个Android的G4手机,这里记下一点心得:
1.中文操作系统
需要安装一个custom local的应用。
2.中文输入法
安装一个搜狗的Android版本的输入法
3.如何选择输入法
长按输入框即可进行选择
4.设置彩信和移动的GPRS网络
首先是彩信的设定:
待机情况下-菜单-设置-无线控件-移动网络设置-接入点名称
进去以后,按MENU "新APN"
彩信设置
1.名称:中国移动彩信设置 (这个可以自定义名字)
2.APN:cmwap (联通的为uniwap,WCDMA的为3gwap)
3.代理:10.0.0.172
4.端口:80
5.用户名:(空着)
6.密码:(空着)
7.服务器:(空着)
8.MMSC: http://mmsc.monternet.com (联通是htp://mmsc.myuni.com.cn)
9.彩信代理:010.000.000.172
10.彩信端口:80
11.彩信协议:WAP 2.0
12.MCC:460
13.MNC:移动是00或02,联通的是01
14.身份验证:默认
15.APN类型:mms (如果保存后接入点消失,可以尝试先设置wap接入)
编辑完以后,按MENU 选择 “保存”
二、NET 接入点:待机情况下-菜单-设置-无线控件-移动网络设置-接入点名称
进去以后,按MENU "新APN"
上网设置
1.名称:cmnet (名称可任意)
2.APN:cmnet (联通是uninet,WCDMA是3gnet)
3.代理:
4.端口:
5.用户名:(空着)
6.密码:(空着)
7.服务器:(空着)
8.MMSC:
9.彩信代理:
10.彩信端口:
11.彩信协议:WAP 2.0
12.MCC:460
13.MNC:移动是00或02,联通的是01
14.身份验证:默认
15.APN类型:不用修改,默认即可
编辑完以后,按MENU 选择 “保存”
三、WAP接入点:待机情况下-菜单-设置-无线控件-移动网络设置-接入点名称
进去以后,按MENU "新APN"
1.名称:中国移动WAP设置 (这个可以自定义名字)
2.APN:cmwap (联通的为uniwap,WCDMA的为3gwap)
3.代理:10.0.0.172
4.端口:80
5.用户名:(空着)
6.密码:(空着)
7.服务器:(空着)
8.MMSC:
9.彩信代理:
10.彩信端口:
11.彩信协议:WAP 2.0
12.MCC:460
13.MNC:移动是00或02,联通的是01
14.身份验证:默认
15.APN类型:不用修改,默认即可
编辑完以后,按MENU 选择 “保存”
还是用不了的朋友你们去拨号面板输入 *#*#4636#*#*
进去手机信息-------设置首选的网络类型------GSM ONLY。
<uses-library android:name="com.google.android.maps" /> </application> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-sdk android:minSdkVersion="3" /> </manifest>
mapview.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <com.google.android.maps.MapView android:id="@+id/mapview_mv" android:layout_width="fill_parent" android:layout_height="fill_parent" android:enabled="true" android:clickable="true" android:apiKey="0HYDh8uGZ3WWc58LxmauEVsNWqAGP_HSGFRzixQ" /> <LinearLayout android:id="@+id/mapview_llayout_zoom" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" /> <RelativeLayout android:id="@+id/mapview_rlayout_search" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:background="@color/darkgray" android:visibility="invisible" android:paddingTop="8dip" android:paddingBottom="4dip" android:paddingLeft="8dip" android:paddingRight="8dip"> <AutoCompleteTextView android:id="@+id/mapview_autotxtview_search" android:layout_width="245dip" android:layout_height="wrap_content" android:text="@string/edt_search_default" android:textColor="@color/darkgray" android:layout_marginRight="6dip" /> <ImageButton android:id="@+id/mapview_imgbtn_search" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="/blog_article/@android_drawable/ic_search_category_default/index.html" android:layout_toRightOf="@id/mapview_autotxtview_search" android:layout_alignBottom="@id/mapview_autotxtview_search" /> </RelativeLayout> </RelativeLayout>
public class ActivityMap extends MapActivity { private MapView mMapView; private GeoPoint gp; private LocationManager mLocMgr; public static Location mLoc; private String strLocInfo; private final LocationListener mLocListener = new LocationListener() { public void onLocationChanged(Location location) { refreshMapView(location); } public void onProviderDisabled(String provider) { } public void onProviderEnabled(String provider) { } public void onStatusChanged(String provider, int status, Bundle extras) { } }; protected void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.mapview); mMapView = (MapView) findViewById(R.id.mapview_mv); mLocMgr = (LocationManager) getSystemService(Context.LOCATION_SERVICE); updateLocation(mLocMgr); refreshMapView(mLoc); // mLocMgr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2000, 10, mLocListener); mLocMgr.requestLocationUpdates(strLocInfo, 2000, 10, mLocListener); // zoom widget LinearLayout zoomLayout = (LinearLayout) findViewById(R.id.mapview_llayout_zoom); View zoomView = mMapView.getZoomControls(); zoomLayout.addView(zoomView, new LinearLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); // mMapView.displayZoomControls(true); // mMapView.setBuiltInZoomControls(true); // mMapView.displayZoomControls(false); } private void refreshMapView(Location location) { updateGeoPoint(location); MapController mMapController = mMapView.getController(); mMapController.animateTo(gp); mMapController.setZoom(mMapView.getZoomLevel()); try { Log.e("************", getAddress(gp)); } catch (IOException e) { e.printStackTrace(); } } private void updateLocation(LocationManager lm) { Criteria mCriteria = new Criteria(); mCriteria.setAccuracy(Criteria.ACCURACY_FINE); // 经纬度是否精确提供 mCriteria.setAltitudeRequired(false); // 是否提供高度信息 mCriteria.setBearingRequired(false); // 是否提供航向信息 mCriteria.setCostAllowed(true); // 费用 mCriteria.setPowerRequirement(Criteria.POWER_LOW); strLocInfo = lm.getBestProvider(mCriteria, true); mLoc = lm.getLastKnownLocation(strLocInfo); if (mLoc == null) { mLoc = new Location(strLocInfo); mLoc.setLatitude(31.183333); mLoc.setLongitude(121.483333); } } private void updateGeoPoint(Location location) { double dLatitude = location.getLatitude() * 1E6; double dLongitude = location.getLongitude() * 1E6; gp = new GeoPoint( (int) (dLatitude), (int) (dLongitude) ); } private String getAddress(GeoPoint gp) throws IOException { double dLatitude = gp.getLatitudeE6() / 1E6; double dLongitude = gp.getLongitudeE6() / 1E6; //自经纬度取得地址 StringBuilder sb = new StringBuilder(); Geocoder gc = new Geocoder(ActivityMap.this, Locale.getDefault()); List<Address> lstAddr = gc.getFromLocation(dLatitude, dLongitude, 1); if (lstAddr.size() > 0) { Address addr = lstAddr.get(0); for (int i = 0; i < addr.getMaxAddressLineIndex(); i++) { sb.append(addr.getAddressLine(i)).append("\n"); } sb.append(addr.getLocality()).append("\n"); //所在地 sb.append(addr.getPostalCode()).append("\n"); //邮编 sb.append(addr.getCountryName()); } return sb.toString(); } public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.optionsmenu, menu); return super.onCreateOptionsMenu(menu); } public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.optionsmenu_search: Intent intent = new Intent(); intent.setClass(ActivityMap.this, ActivitySearch.class); startActivity(intent); break; case R.id.optionsmenu_directions: break; case R.id.optionsmenu_mapmode: break; case R.id.optionsmenu_mapmode_map: mMapView.setStreetView(true); mMapView.setSatellite(false); mMapView.setTraffic(false); break; case R.id.optionsmenu_mapmode_satellite: mMapView.setStreetView(false); mMapView.setSatellite(true); mMapView.setTraffic(false); break; case R.id.optionsmenu_mapmode_traffic: mMapView.setStreetView(false); mMapView.setSatellite(false); mMapView.setTraffic(true); break; case R.id.optionsmenu_myloc: MapOverlay mMapOverlay = new MapOverlay(); List<Overlay> listOfOverlay = mMapView.getOverlays(); listOfOverlay.clear(); listOfOverlay.add(mMapOverlay); mMapView.invalidate(); updateLocation(mLocMgr); refreshMapView(mLoc); break; } return super.onOptionsItemSelected(item); } protected boolean isRouteDisplayed() { return false; } private class MapOverlay extends com.google.android.maps.Overlay { public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); // translate the GeoPoint to screen pixels Point screenPts = new Point(); mapView.getProjection().toPixels(gp, screenPts); // add the marker Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher_android); canvas.drawBitmap(bmp, screenPts.x, screenPts.y, null); return true; } } }
public class ActivitySearch extends MapActivity { private MapView mMapView; public static int screen_width, screen_height; protected void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.mapview); screen_width = getWindowManager().getDefaultDisplay().getWidth(); screen_height = getWindowManager().getDefaultDisplay().getHeight(); mMapView = (MapView) findViewById(R.id.mapview_mv); MapOverlay mMapOverlay = new MapOverlay(); List<Overlay> listOfOverlay = mMapView.getOverlays(); listOfOverlay.clear(); listOfOverlay.add(mMapOverlay); mMapView.invalidate(); RelativeLayout rLayout = (RelativeLayout) findViewById(R.id.mapview_rlayout_search); rLayout.setVisibility(View.VISIBLE); ImageButton btn_search = (ImageButton) findViewById(R.id.mapview_imgbtn_search); btn_search.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { } }); mMapView.setEnabled(false); } protected boolean isRouteDisplayed() { return false; } private class MapOverlay extends com.google.android.maps.Overlay { public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { super.draw(canvas, mapView, shadow); Paint innerPaint = new Paint(); Paint borderPaint = new Paint(); innerPaint.setARGB(75, 80, 80, 80); // darkgray borderPaint.setARGB(255, 255, 255, 255); // white borderPaint.setAntiAlias(true); // 抗锯齿 borderPaint.setStyle(Style.STROKE); //描边,和Style.Fill相对 borderPaint.setStrokeWidth(2); RectF drawRect = new RectF(); drawRect.set(0,0, screen_width, screen_height); canvas.drawRoundRect(drawRect, 5, 5, innerPaint); canvas.drawRoundRect(drawRect, 5, 5, borderPaint); return true; } } }
22