• PUDN用户
    了解作者
  • Java
    开发工具
  • 1.1MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 2
    下载次数
  • 2016-06-04 11:27
    上传日期
这个微博客户端中用到得一些知识点。 1:sqllite数据库的应用 2:SharedPreferences结合sqllite保存默认登录用户 3:圆角背景,圆角头像,.9.png格式在android中的应用 4:布局方面的当然是最常用的ReleativeLayout,LinearLayout,FrameLayout,include,merge的应用 5:Menu菜单的使用 6:弹出菜单的使用,简单的弹出框,包含list的弹出框. 7:webview嵌入腾讯第三方授权页面的使用 8:最常用的ListView的使用 9:Tab布局的应用 10:listView的分页。 11:万能适配器BaseAdapter以及ArrayAdapter等适配器的使用 12:android美化方面关于selector的使用
wbkhd.zip
内容介绍
/* * Copyright (C) 2009 The Undried 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.superdeskclock; import static android.os.BatteryManager.BATTERY_STATUS_CHARGING; import static android.os.BatteryManager.BATTERY_STATUS_FULL; import static android.os.BatteryManager.BATTERY_STATUS_UNKNOWN; import java.util.Calendar; import java.util.Date; import java.util.Random; import android.app.Activity; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.content.res.Resources; import android.database.ContentObserver; import android.database.Cursor; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.provider.Settings; import android.text.TextUtils; import android.text.format.DateFormat; import android.util.DisplayMetrics; import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; import android.view.Window; import android.view.WindowManager; import android.view.animation.AnimationUtils; import android.widget.AbsoluteLayout; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; /** * DeskClock clock view for desk docks. */ @SuppressWarnings("deprecation") public class DeskClock extends Activity { private static final boolean DEBUG = false; private static final String LOG_TAG = "DeskClock"; // Alarm action for midnight (so we can update the date display). private static final String ACTION_MIDNIGHT = "com.android.superdeskclock.MIDNIGHT"; // Interval between forced polls of the weather widget. private final long QUERY_WEATHER_DELAY = 60 * 60 * 1000; // 1 hr // Intent to broadcast for dock settings. private static final String DOCK_SETTINGS_ACTION = "com.android.settings.DOCK_SETTINGS"; // Delay before engaging the burn-in protection mode (green-on-black). private final long SCREEN_SAVER_TIMEOUT = 5 * 60 * 1000; // 5 min // Repositioning delay in screen saver. private final long SCREEN_SAVER_MOVE_DELAY = 60 * 1000; // 1 min // Color to use for text & graphics in screen saver mode. private final int SCREEN_SAVER_COLOR = 0xFF308030; private final int SCREEN_SAVER_COLOR_DIM = 0xFF183018; // Opacity of black layer between clock display and wallpaper. private final float DIM_BEHIND_AMOUNT_NORMAL = 0.4f; private final float DIM_BEHIND_AMOUNT_DIMMED = 0.8f; // higher contrast when display dimmed // Internal message IDs. private final int QUERY_WEATHER_DATA_MSG = 0x1000; private final int UPDATE_WEATHER_DISPLAY_MSG = 0x1001; private final int SCREEN_SAVER_TIMEOUT_MSG = 0x2000; private final int SCREEN_SAVER_MOVE_MSG = 0x2001; // Weather widget query information. private static final String GENIE_PACKAGE_ID = "com.google.android.apps.genie.geniewidget"; private static final String WEATHER_CONTENT_AUTHORITY = GENIE_PACKAGE_ID + ".weather"; private static final String WEATHER_CONTENT_PATH = "/weather/current"; private static final String[] WEATHER_CONTENT_COLUMNS = new String[] { "location", "timestamp", "temperature", "highTemperature", "lowTemperature", "iconUrl", "iconResId", "description", }; private static final String ACTION_GENIE_REFRESH = "com.google.android.apps.genie.REFRESH"; // State variables follow. private DigitalClock mTime; private TextView mDate; private TextView mNextAlarm = null; private TextView mBatteryDisplay; private TextView mWeatherCurrentTemperature; private TextView mWeatherHighTemperature; private TextView mWeatherLowTemperature; private TextView mWeatherLocation; private ImageView mWeatherIcon; private String mWeatherCurrentTemperatureString; private String mWeatherHighTemperatureString; private String mWeatherLowTemperatureString; private String mWeatherLocationString; private Drawable mWeatherIconDrawable; private Resources mGenieResources = null; private boolean mDimmed = false; private boolean mScreenSaverMode = false; private String mDateFormat; private int mBatteryLevel = -1; private boolean mPluggedIn = false; private boolean mLaunchedFromDock = false; private Random mRNG; private PendingIntent mMidnightIntent; private final BroadcastReceiver mIntentReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { final String action = intent.getAction(); if (DEBUG) Log.d(LOG_TAG, "mIntentReceiver.onReceive: action=" + action + ", intent=" + intent); if (Intent.ACTION_DATE_CHANGED.equals(action) || ACTION_MIDNIGHT.equals(action)) { refreshDate(); } else if (Intent.ACTION_BATTERY_CHANGED.equals(action)) { handleBatteryUpdate( intent.getIntExtra("status", BATTERY_STATUS_UNKNOWN), intent.getIntExtra("level", 0)); } // else if (UiModeManager.ACTION_EXIT_DESK_MODE.equals(action)) { // if (mLaunchedFromDock) { // // moveTaskToBack(false); // finish(); // } // mLaunchedFromDock = false; // } } }; private final Handler mHandy = new Handler() { @Override public void handleMessage(Message m) { if (m.what == QUERY_WEATHER_DATA_MSG) { new Thread() { public void run() { queryWeatherData(); } }.start(); scheduleWeatherQueryDelayed(QUERY_WEATHER_DELAY); } else if (m.what == UPDATE_WEATHER_DISPLAY_MSG) { updateWeatherDisplay(); } else if (m.what == SCREEN_SAVER_TIMEOUT_MSG) { saveScreen(); } else if (m.what == SCREEN_SAVER_MOVE_MSG) { moveScreenSaver(); } } }; private final ContentObserver mContentObserver = new ContentObserver(mHandy) { @Override public void onChange(boolean selfChange) { if (DEBUG) Log.d(LOG_TAG, "content observer notified that weather changed"); refreshWeather(); } }; private void moveScreenSaver() { moveScreenSaverTo(-1,-1); } private void moveScreenSaverTo(int x, int y) { if (!mScreenSaverMode) return; final View saver_view = findViewById(R.id.saver_view); DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); if (x < 0 ||
评论
    相关推荐
    • testSQLite9.rar
      Android初学者用SQLlite数据库,显示数据表格用例
    • Android 多线程下载实例
      android多线程下载,可暂停,退出程序后再次启动程序时能自动开始下载。采用sqllite存储,代码写的不是很好。希望有写修改之后最完美的版本再放出来
    • Android 数据库操作源码(SqlLite
      Android上的SQLite分页读取,实现并封装一个SQL分页表格控件,不仅支持分页还是以表格的形式展示数据。 包括: 1、创建数据库 2、插入示例数据 3、关闭数据库 4、数据分页查看
    • ZxingDemo.rar
      android上使用ZXing识别条形码和二维码,代码简单易懂,相信能帮助读者迅速掌握相关的开发
    • android-order-system.rar
      基于Java的android点餐系统--android手机点餐系统,实现基本点菜功能,供大家参考学习
    • MTK-MT6235-USB-driver-2009082823351054.rar
      MTK 6235 USB driver for Nokia N97
    • Mine.zip
      Android 扫雷游戏源代码,代码中附加了详细的注释,另附加Ophone游戏开发文档,有详细搭建开发环境过程,与开发Android类似
    • J2ME_(chinese)api.rar
      J2ME 中文api以及应用 J2ME 中文api以及应用
    • Gallery3D.rar
      安卓系统原生的3D图片浏览器源代码,有兴趣的可以研究一下
    • wpctsc.rar
      wpctsc.exe for windows mobile 可以使WM手机远程登入PC