如何在Andr oid中展 示idea 新建包 树状显示结构的数据

Googl瞬99彩平台e Nexus各 One手动升级Andr分oid 2.3.6步骤教程
核心提示:Google Nexus One手动升级Android 2.3.6步骤教程日前Google 已经通过OTA 推出了 Android2.3.6更新,适用于 Android 2.3.4 GRJ22
Google Nexus One手动升级Android 2.3.6步骤教程日前Google 已经通过OTA 推出了 Android2.3.6更新,适用于 Android 2.3.4 GRJ22 系统,档案大小为 5.28MB,这次更新主要用于修复若干bug和系统安全性方面的讨论。如果你等不及OTA升级,也可以手动为N1升级 Android 2.3.6。方法如下: 1. 先下载升级文件(GRJ22 & GRK39F) 下载地址:http://goo.gl/zhTgZ。 2. 将下载回来的 zip 文件改名为 update.zip (文件名称必须是 update.zip ,而不是 update.zip.zip),然后复制至 MicroSD 卡中。 3. 按电源制把 Nexus One 关上。 4. 按下 「音量减小」键以及电源键直到 Nexus One 再次启动。 5. 开机后,画面会显示系统正在搜寻档案中,这时可滚动至末端(利用「音量 +/-」上下移动),选择 Recovery 及按下电源制。 6. 接着画面会出现一个有感叹号的三角形,这时要同一时间按下电源键及「音量增加」键。如果这一步不成功的话,可试试同时按下「音量 +/-」键及电源键 7. 再选择 Apply sdcard:update.zip,用轨迹球确定。 8. 等一回儿,画面会显示 &install from sdcard complete&,代表更新已完成,最后再按 &reboot system now&,Nexus One 会重新启动。你的N1已经运行Android2.3.6系统了。原文: http://www.androidsphere.net//google-release-android-2-3-6-ota-updat-for-n1/#ixzz1Z7EQTTHm更多信息请访问:
/ ,编ngqasn发布wfqzee 了解详情。百万Andr??oid固件恶意软件在增长 你的手机安全
00:15:36&&&&来源:本文章来源于网络
  智东西(公众号:zhidxcom)
  文 | 四月
  智东西(公众号:zhidxcom)9月3日消息,据德国杀毒软件公司G DATA(歌德塔)近日发表的一份新的报告显示,在2015年的第二季度里有超过一万个新的Andr oid恶意软件系列被发现,重要的是不是被入侵的的设备都会受到攻击和影响。
  该报告还指出,恶意软件指向最多的设备是中国制造的智能手机设备,如华 为,小米和联想,通过预装间谍软件骇客们嵌入到用户的固件数据。此外,G DATA还明确表示,他们相信间谍软件/恶意软件是第三方分销商所致,与制造商本身无关。
  (编者注:固件代码不同于应用层的软件,缺陷隐藏较深,检测难度大;同时由于固件病毒是集成在硬件设备的主控芯片中的,所以采用重装系统、刷机、简单的杀毒软件都无法彻底清除固件病毒。)
  据相关数据显示,全球每天有25亿人在使用智能手机或平板电脑上网进行聊天、上网和购物,而与此同时,手机恶意软件的应用程序的数量在过去三年中大幅上升。“许多固件级间谍软件和恶意软件在过去的一年中,通过访问互联网,阅读和发送短信,安装应用程序,访问联系人列表,获取位置数据等方式而传播,它们可能采取各种的有害的和未知的行动”。Geschkat(G DATA移动解决方案产品经理)表示。
  第三方分销商可能通过修改固件并使用跟踪软件的方式获取用户数据而取得广告渠道的收入。在某些情况下,甚至有恶意软件被设计为盗取用户数据和个人信息。换句话说,通过第三方平台购买的安卓手机及其它数码产品,存在可能被篡改固件的风险,虽不会直接攻击用户手机,但可能在不知情的情况下盗取访问者信息、短信、联系人、方位等个人数据。
  G DATA方面估计,直到2015年年底将生长出超过200万的Andr oid恶意软件。
  (编者注:G DATA,中文译名歌德塔,是德国一家具有30余年历史的杀毒软件公司,在互联网安全及病毒防御领域具有一定权威性。)Andr累oid 5.0的人99彩票脸在解锁终于能开用了
核心提示:Android 5.0的人脸解锁终于能用了Android 4.0 开始就引入了人脸识别解锁功能,但说实话真的不怎么好用,识别速度慢、精度差,只
Android 5.0的人脸解锁终于能用了Android 4.0 开始就引入了人脸识别解锁功能,但说实话真的不怎么好用,识别速度慢、精度差,只是看起来很好玩而已,相信不会有多少人真的一直用它。现在,Android 5.0 引入了&trusted face&,总算是能让人接受了。一如既往,开启人脸解锁模式后,需要你盯住手机前置摄像头几秒钟,然后在锁屏界面的底部,你会看到一个小人圆形标记,这就代表手机看到了你的脸,但是不再需要像以前那样,将整个大脸显示在屏幕上来判断了。手机认出你之后,就会自动解锁&&不对,等等。最关键的区别就在这里,人脸解锁现在其实不能完全解锁了,它只是一道额外的安全措施,识别通过之后,就会面临传统的滑动解锁、密码解锁、图案解锁界面&&具体取决于你的安全设置。这是因为,Google 认为人脸识别解锁的安全性较差,比不上传统方式,因此不能完全作为安全锁定方式,只能是个辅助而已。但好在如今 Android 5.0 的人脸识别大大改进了,几乎从各个角度都能在不到 1 秒钟的时间内识别出来。更多信息请访问:
,编khmjvt发布vvtacb 了解详情。I have big problem with understanding multi threading in my application and because of that finding a bug. I've checked I think all possibilities and still I am getting various (sometimes unexpected) errors.
Maybe someone here will be able to advice me, what I should do.
In my project I am using two external libraries:
- provides views for graph drawing
- provides interface for easy communication between app components
As for the app it has the structure like this:
MainActivity
(ProcessThread)
(GraphFragment)
The idea is that ProcessThread computes data and provides constant stream of values to GraphFragment throught EventBus. In GraphFragment I have one Series required by GraphView.
To update graphs in real time according to the
I need to make a new Runnable so I did one:
private class PlotsRun implements Runnable{
public void run() {
mSeries1.appendData(new DataPoint(counter, getRandom()), true, 100);
counter++;
mHandler.post(this);
and when I start it from fragment's onResume() method everything is working like a charm.
Unfortunately as I've mentioned I am using external data from another thread. To get it inGraphFragment I am using (according to the ) onEventMainThread() method.
And in here no matter what I'll do I can't pass data to update my graph in PlotsRun object. So far I've tried:
using Queue - add value in onEventMainThread and get in PlotsRun. It turned out that runnable is reading faster than method is able to update queue.
creating various buffers - the result is quite this same as with Queue.
calling mSeries1.appendData(new DataPoint(counter, getRandom()), true, 100); directly from onEventMainThread - at some point it gets freez.
creating onEvent() method inside my runnable and call from there mHandler.post() - it is blocking UI and updates looks like snapshots.
using everything mentioned with or without synchronized() block.
What is quite difficult for me to understand is this runnable which is working correctly (at some point).
on official Android blog you can't update UI from non UI thread. This is why I can't use another thread inside GraphFragment. But when I've checked my runnable it is running on main thread (UI). This is why I can't create infinite while loop there instead have to call mHandler.post(this).
And still it behaves like another thread because it is faster (called more frequently) then onEventMainThread method.
What can I do to be able to update my graphs (or where I should look) using data from ProcessThread?
Answering on @Matt Wolfe request I am including what I think is the most important part of a code for this problem with all required variable shown how they are declared. It is very simplified example:
MainActivity:
private ProcessThread testThread = new ProcessThread();
protected void onResume() {
super.onResume();
testThread.start();
private class ProcessThread extends Thread{
private float value = 0f;
private ReadingsUpdateData updater = new ReadingsUpdateData(values);
public void run() {
while(true) {
value = getRandom();
updater.setData(value);
EventBus.getDefault().post(updater);
GraphFragment:
private LineGraphSeries&DataPoint& mSeries1;
long counter = 0;
private Queue&ReadingsUpdateData&
public void onResume() {
super.onResume();
mTimer2.run();
public void onEventMainThread(ReadingsUpdateData data){
synchronized(queue){
queue.add(data);
private class PlotsRun implements Runnable{
public void run() {
if (queue.size()&0) {
mSeries1.appendData(new DataPoint(counter, queue.poll()), true, 100);
counter++;
mHandler.post(this);
The if in runnable is added for protection because of this to fast reading problem. But it shouldn't be here because there should always be something (at least I expect that).
One more thing to add - when I put simple Log.d and counting variable inside onEventMainThread it was updating and displaying it's value correctly, but unfortunately logcat
isn't main UI.
This is mainly response for @MattWolfe
The mHandler is just variable declared and created in GrapgFragment:
private final Handler mHandler = new Handler();
private Runnable mTimer2;
Yes, that is right I am using mHandler.post() without any delay. I'll try using some delay to see if there is any difference.
What I didn't mention earlier is that the ProcessThread is providing also data to other fragments - don't worry they don't interfere with each other or share any resources. This is why I am using EventBus.
This a code that I've used as my another idea with another thread in GraphFragment and runOnMainThread method:
private MyThread thread = new MyThread();
private class MyThread extends Thread {
Queue&ReadingsUpdateData& inputL
ReadingsUpdateD
public MyThread() {
inputList = new LinkedList&&();
public void run() {
while(true) {
msg = inputList.poll();
} catch(NoSuchElementException nse){
if (msg == null) {
getActivity().runOnUiThread(new Runnable() {
public void run() {
mSeries1.appendData(new DataPoint(counter, getRandom()), true, 100);
counter++;
public void onEvent(ReadingsUpdateData data){
inputList.add(data);
Unfortunately, it isn't working neither.
解决方案 First of All,
The runnable part in your followed example is just for the sake of animating realtime data updating, You can choose to call appendData() without creating a new runnable. You need to call appendData() from main thread though.
You can call the appendData() function directly from your onEventMainThread function, but as you pointed out that this approach sometimes hangs the UI, One possible reason for this behaviour is that you are probably posting events too frequently, Updating UI too frequently would ultimately hang the UI at some point. You can do the following to avoid this:
Updating UI too frequently might also hang the UI,
Here's a Solution:
Put some logic in ProcessThread to save last sent event time and compare it before sending a new one and if the difference is less than 1 second than save it for sending later and when the next computation is done, compare the time again, if it is greater than 1 second now, than send the events in array or may be send just the latest event, as the latest computation can represent the latest state of graph right?
Hope that helps!
Edit: (in response to Comment 1 & 2)
I am not sure what you tried may be posting your updated code would give a better idea. but I think you tried to implement time check functionality in onEventMainThread or in PlotsRun runnable, is that correct? If yes than I am afraid that wouldn't be of much of help for you. What you need to do instead is to implement this time checking check inside ProcessThread and only post new event if threshold time is reached. For following reasons:
1- EventBus on the backend automatically creates a new runnable and calls onEventMainThread in it. So, handling time check inside ProcessThread would spawn less unwanted runnables into the memory which would result in less memory consumption.
2- Also no need to maintain queue and spawn new runnables, just update the data in onEventMainThread.
Below is a bare minimum code to provide proof of concept only, You would need to update it according to your needs:
ProcessThread class:
private class ProcessThread extends Thread{
private static final long TIME_THRESHOLD = 100; //100 MS but can change as desired
private long lastSentTime = 0;
private float value = 0f;
private ReadingsUpdateData updater = new ReadingsUpdateData(values);
public void run() {
while(true) {
if (System.currentTimeMillis() - lastSentTime & TIME_THRESHOLD) {
Thread.sleep(TIME_THRESHOLD - (System.currentTimeMillis() - lastSentTime));
} catch (InterruptedException e) {}
value = getRandom();
updater.setData(value);
EventBus.getDefault().post(updater);
lastSentTime = System.currentTimeMillis();
onEventMainThread method:
public void onEventMainThread(ReadingsUpdateData data){
mSeries1.appendData(new DataPoint(counter, data), true, 100);
counter++;
本文地址: &
我有我的应用程序,并因为要找到一个错误的理解多线程大问题。我检查,我认为所有的可能性,仍然我得到不同的(有时会有意想不到的)错误。也许有人在这里将能够指点我,我应该做的。在我的项目,我用两个外部库:
- 提供意见绘制图形
- 提供接口的应用程序组件之间容易沟通对于应用它具有结构是这样的:
MainActivity
(ProcessThread)(GraphFragment) 的想法是, ProcessThread 计算数据和 GraphFragment
EventBus 。在 GraphFragment 我有一个系列所要求 GraphView 。要根据我需要实时更新图一个新的的Runnable 所以我做了一: 私有类PlotsRun实现Runnable {
公共无效的run(){
mSeries1.appendData(新数据点(计数器,getRandom()),真实,100);
mHandler.post(本);
}} 和,当我从片段的 onResume()方法,一切都开始它正在像一个魅力。不幸的是,因为我已经提到过我使用从另一个线程外部数据。为了得到它在 GraphFragment 我使用(根据的) onEventMainThread()方法。和这里无论什么我会尽我不能通过数据来更新我的图PlotsRun 对象。到目前为止,我已经试过:使用队列
- 在 onEventMainThread 增加价值并获得 PlotsRun 。原来,这是可运行比阅读速度的方法是能够更新队列中。创建各种缓冲 - 结果是相当同样与队列 。调用 mSeries1.appendData(新数据点(计数器,getRandom()),真实,100); 直接从 onEventMainThread
- 在某些时候它会FREEZ 。里面创建可运行我的的onEvent()方法,并从那里调用 mHandler.post()
- 它是阻塞UI和更新看起来像快照。与使用或提及的一切,而不同步()块。什么是相当困难的,我理解是这样的可运行哪些工作正常(在某种程度上)。由于它是在Android官方博客,你可以从非UI线程“T更新UI。这就是为什么我不能用在 GraphFragment 另一个线程。但是,当我检查我可以运行它是在主线程(UI)上运行。这就是为什么我不能创造无限的 while循环,而不是有必须调用 mHandler.post(本)。和它仍然表现得像另一个线程,因为它更快(称为更频繁),那么 onEventMainThread 方法。我能做些什么才能够更新我的图形(或者我应该看看)利用 ProcessThread
EDIT1: 在回答有关@马特·沃尔夫要求我包括我认为是一个code这个问题,显示它们是如何声明的所有必需的变量中最重要的组成部分。这是非常简单的例子:
MainActivity : 私人ProcessThread testThread =新ProcessThread(); @覆盖
保护无效onResume(){
super.onResume();
testThread.start();
私有类ProcessThread继承Thread {
私人浮点值= 0F;
私人ReadingsUpdateData更新=新ReadingsUpdateData(值);
公共无效的run(){
值= getRandom();
updater.setData(值);
EventBus.getDefault()后(更新)。
GraphFragment : 私人LineGraphSeries<&数据点GT; mSeries1;
专用队列< ReadingsUpdateData>队列;
公共无效onResume(){
super.onResume();
mTimer2.run();
公共无效onEventMainThread(ReadingsUpdateData数据){
同步(队列){
queue.add(数据);
私有类PlotsRun实现Runnable {
公共无效的run(){
如果(queue.size()大于0){
mSeries1.appendData(新数据点(计数器,queue.poll()),真实,100);
mHandler.post(本);
} 如果在可运行添加的保护,因为这对快速阅读的问题。但它不应该在这里,因为应该总是一些(至少我希望)。还有一点要补充 - 当我把简单的 Log.d 和里面的 onEventMainThread 这是更新计数变量并显示它的值正确,但遗憾的是logcat的不是主界面。
EDIT2: 这主要是响应了@MattWolfe comment该mHandler只是变量声明和GrapgFragment创建: 私人最终处理程序mHandler =新的处理程序();私人的Runnable mTimer2; 是的,这是正确的,我使用 mHandler.post()没有任何延迟。我会尝试使用一些延迟,看看是否有任何区别。我没有提到早前的是, ProcessThread 也提供数据到其他片段 - 不要担心他们不互相干扰或共享任何资源。这就是为什么我使用 EventBus 。
EDIT3: 这一个code,我已经在 GraphFragment 作为我的另一个想法与另一个线程和 runOnMainThread 方法: 私人MyThread的线程=新MyThread的();
私有类MyThread的继承Thread {
问答LT; ReadingsUpdateData> inputL
ReadingsUpdateData味精;
公共MyThread的(){
inputList =新的LinkedList<>();
公共无效的run(){
味精= inputList.poll();
}赶上(NSE NoSuchElementException异常){
如果(MSG == NULL){
getActivity()。runOnUiThread(新的Runnable(){
公共无效的run(){
mSeries1.appendData(新数据点(计数器,getRandom()),真实,100);
公共无效的onEvent(ReadingsUpdateData数据){
inputList.add(数据);
} 不幸的是,它不工作既不解决方案
所有首先, 在后面的例子可运行的部分仅仅是动画的实时数据更新的缘故,你可以选择调用 appendData(),而无需创建一个新的可运行。你需要调用 appendData()从主线程虽然。 二, 您可以从 onEventMainThread 函数直接调用 appendData()的功能,但正如你指出,这方法有时会挂起的用户界面,一个可能的原因这种行为,你很可能发布事件的过于频繁,UI更新过于频繁地在某些时候将最终挂UI。你可以做到以下几点,以避免这种情况: 更新UI过于频繁也可能会挂起的UI,这里有一个解决方案: 把一些逻辑 ProcessThread 去年发送的事件都保存和发送一个新的前比较,如果差值小于1秒比保存以后发送并且在下一计算完成后,再次进行比较时,如果是大于1秒现在,比发送事件阵列,或者可以是发送只是最新事件,作为最新的计算可以重新present最新状态图中的吧?希望帮助! 编辑:(响应注释1和2)我不知道你试过可能会发布更新后的code会给一个更好的想法是什么。但我认为你试过 onEventMainThread 实施时间检查功能,或者在 PlotsRun 可运行的,是正确的?如果是的话比我恐怕不会有多少对你的帮助。你需要做的,而不是什么是贯彻落实这次检查内部ProcessThread检查,如果达到阈值时间只有后新的事件。对于原因如下: 1 EventBus在后台自动创建一个新的可运行和电话 onEventMainThread 。因此,处理内部 ProcessThread 时检查会催生少不必要的可运行到这将导致内存消耗更少的内存。 2
- 也没必要维持队列中,产生新的可运行,只需更新 onEventMainThread 数据。下面是一个最低限度code 以提供概念验证而已,您需要根据您的需要来更新它:
ProcessThread 类: 私有类ProcessThread继承Thread {
私有静态最后长TIME_THRESHOLD = 100; // 100的MS,但根据需要可以改变
私人长期lastSentTime = 0;
私人浮点值= 0F;
私人ReadingsUpdateData更新=新ReadingsUpdateData(值);
公共无效的run(){
如果(System.currentTimeMillis的() -
lastSentTime&下; TIME_THRESHOLD){
视频下载(TIME_THRESHOLD
- (System.currentTimeMillis的() -
lastSentTime));
}赶上(InterruptedException的E){}
值= getRandom();
updater.setData(值);
EventBus.getDefault()后(更新)。
lastSentTime = System.currentTimeMillis的();
onEventMainThread 方法: 公共无效onEventMainThread(ReadingsUpdateData数据){
mSeries1.appendData(新数据点(计数器,数据),真实,100);
本文地址: &
扫一扫关注官方微信}

我要回帖

更多关于 表格显示树状层级 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信