

package com.blogspot.android_er.androidlistclient;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
public class MainActivity extends AppCompatActivity {
Button btnRead;
TextView textResult;
ListView listViewNode;
ArrayList<Node> listNote;
ArrayAdapter<Node> adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnRead = (Button)findViewById(R.id.readclient);
textResult = (TextView)findViewById(R.id.result);
listViewNode = (ListView)findViewById(R.id.nodelist);
listNote = new ArrayList<>();
ArrayAdapter<Node> adapter =
new ArrayAdapter<Node>(
MainActivity.this,
android.R.layout.simple_list_item_1,
listNote);
listViewNode.setAdapter(adapter);
btnRead.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new TaskReadAddresses(listNote, listViewNode).execute();
}
});
}
class Node {
String ip;
String mac;
String CanonicalHostName;
String HostName;
String LocalHostCanonicalHostName;
String LocalHostHostName;
String remark;
boolean isReachable;
Node(String ip, String mac){
this.ip = ip;
this.mac = mac;
queryHost();
}
@Override
public String toString() {
return "IP: " + ip + " " +
"MAC: " + mac + " " +
"CanonicalHostName: " + CanonicalHostName + " " +
"HostName: " + HostName + " " +
"getLocalHost().getCanonicalHostName(): " + LocalHostCanonicalHostName + " " +
"getLocalHost().getHostName(): " + LocalHostHostName + " " +
"isReachable: " + isReachable +
" " + remark;
}
private void queryHost(){
try {
InetAddress inetAddress = InetAddress.getByName(ip);
CanonicalHostName = inetAddress.getCanonicalHostName();
HostName = inetAddress.getHostName();
LocalHostCanonicalHostName = inetAddress.getLocalHost().getCanonicalHostName();
LocalHostHostName = inetAddress.getLocalHost().getHostName();
isReachable = inetAddress.isReachable(3000);
} catch (UnknownHostException e) {
e.printStackTrace();
remark = e.getMessage();
} catch (IOException e) {
e.printStackTrace();
remark = e.getMessage();
}
}
}
private class TaskReadAddresses extends AsyncTask<Void, Node, Void> {
ArrayList<Node> array;
ListView listView;
TaskReadAddresses(ArrayList<Node> array, ListView v){
listView = v;
this.array = array;
array.clear();
textResult.setText("querying...");
}
@Override
protected Void doInBackground(Void... params) {
readAddresses();
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
textResult.setText("Done");
}
@Override
protected void onProgressUpdate(Node... values) {
listNote.add(values[0]);
((ArrayAdapter)(listView.getAdapter())).notifyDataSetChanged();
}
private void readAddresses() {
BufferedReader bufferedReader = null;
try {
bufferedReader = new BufferedReader(new FileReader("/proc/net/arp"));
String line;
while ((line = bufferedReader.readLine()) != null) {
String[] splitted = line.split(" +");
if (splitted != null && splitted.length >= 4) {
String ip = splitted[0];
String mac = splitted[3];
if (mac.matches("..:..:..:..:..:..")) {
Node thisNode = new Node(ip, mac);
publishProgress(thisNode);
}
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally{
try {
bufferedReader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
"container":"GOOGLE_DRIVE"
with
container: [GOOGLE_DRIVE, DOMAIN_INSTALLABLE]
Discontinued API | Replacement API |
Documents List API | Drive API |
Admin Audit | Admin SDK Reports API |
Google Apps Profiles | Admin SDK Directory API |
Provisioning | Admin SDK Directory API |
Reporting | Admin SDK Reports API |
Email Migration API v1 | Email Migration API v2 |
Reporting Visualization | No replacement available |
![]() |
HTC Sense 7.0 (left) vs HTC Sense 7.0 "G" (right) |
![]() |
HTC Sense 7.0 (left) vs HTC Sense 7.0 "G" (right) |
![]() |
HTC Sense 7.0 (left) vs HTC Sense 7.0 "G" (right) |
![]() |
HTC Sense 7.0 (left) vs HTC Sense 7.0 "G" (right) |
![]() |
HTC Sense 7.0 (left) vs HTC Sense 7.0 "G" (right) |
![]() |
HTC Sense 7.0 (left) vs HTC Sense 7.0 "G" (right) |
![]() |
HTC Sense 7.0 (left) vs HTC Sense 7.0 "G" (right) |
![]() |
HTC Sense 7.0 (left) vs HTC Sense 7.0 "G" (right) |
![]() |
HTC Sense 7.0 (left) vs HTC Sense 7.0 "G" (right) |
![]() |
HTC Sense 7.0 (left) vs HTC Sense 7.0 "G" (right) |
![]() |
HTC Sense 7.0 (left) vs HTC Sense 7.0 "G" (right) |
![]() |
HTC Sense 7.0 (left) vs HTC Sense 7.0 "G" (right) |
![]() |
HTC Sense 7.0 (left) vs HTC Sense 7.0 "G" (right) |
Posted by Ankur Kotwal, Software Engineer
The holiday spirit is about giving and though were early into April, were still in that spirit. Today, were announcing that Googles Santa Tracker is now open source on GitHub at google/santa-tracker-web and google/santa-tracker-android. Now you can see how weve used many of our developer products to build a fun and engaging experience that runs across the web and Android.
Santa Tracker isnt just about watching Santas progress as he delivers presents on December 24. Visitors can also have fun with the winter-inspired games and an interactive North Pole village while Santa prepares for his big journey throughout the holidays.
Below is a summary of what weve released as open source.
Now that the source code is also available, developers can see many of the parts that come together to make Santa Tracker. We hope that developers are inspired to make their own magical experiences.
Posted by Bill Luan, Greater China Regional Lead, Google Developer Relations
Today, the Google Developer Platform team is launching a Chinese language and captioned YouTube channel, aiming to make it easier for the developers in China to learn more about Google services and technologies around mobile, web and the cloud. The channel includes original content in Chinese (Mandarin speaking), and curates content from the English version of the Google Developers channel with Simplified Chinese captions.
A special thank you to the volunteers in Google Developers Group community in the city of Nanyang (Nanyang GDG) in China, for their effort and contribution in adding the Chinese language translations to the English language Google Developer Channel videos on YouTube. Over time, we will produce more Chinese language original content, as well as continue leveraging GDG volunteers in China to add more Chinese captioned English videos from Google Developer Channel, to serve the learning needs from developers.
Posted by Greg Wilson, Head of Developer Advocacy for Google Cloud Platform
Originally posted to the Google Cloud Platform blog
From popular mobile apps (Foursquare) to acclaimed indie films (The Grand Budapest Hotel), some of the worlds most creative ideas have debuted at the annual SxSW Festival in Austin, Texas. For over 25 years, SxSWs goal has been to bring together the most creative people and companies to meet and share ideas. We think one of those next great ideas could be yours, and wed like to help it be a part of SxSW.
Do you have an idea for a new app that you think is SxSW worthy? Enter it in the Google Cloud Platform Build-Off. Winners will receive up to $5,000 in cash. First prize also includes $100,000 in Google Cloud Platform credit and 24/7 support, and select winners will have the chance to present their app to 200 tech enthusiasts during the Build-Off awards ceremony at SxSW.
Heres how it works:
Visit the official Build-Off website to see the full list of rules and FAQs and follow us at #GCPBuildOff on G+ and Twitter for more updates. We cannot wait to see what innovation your creativity leads to next.
Copyright © 2009 For Sharing. Powered by Blogger..
Blogger Templates created by Deluxe Templates