ID:205953

日月星辰

一般职工

  • 公司信息:
  • 工作经验:
  • 1年
  • 兼职日薪:
  • 500元/8小时
  • 兼职时间:
  • 可工作日远程
  • 所在区域:
  • 山东
  • 全区

技术能力

会使用C语言,Java语言,Python语言,C++语言,PHP语言,Android语言。使用过MySQL数据库。web前端开发。手机app开发。ThinkPHP框架。JavaScript语言与PHP语言交互。

项目经验

public static String newsPath_url = "http://192.168.13.83:8080/itheima74/servlet/GerNewsServlet";
//封装新闻的假数据到list中返回
public static ArrayList<NewsBean> getAllNewsForNetWork(Context context){
ArrayList<NewsBean> arrayList = newArrayList<NewsBean>();
try{
//1.请求服务器获取新闻数据
//获取一个url对象,通过url对象得到一个urlconnection对象
URL url = new URL(newsPath_url);
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
//设置连接的方式和超时时间
connection.setRequestMethod("GET");
connection.setConnectTimeout(10*1000);
//获取请求响应码
int code = connection.getResponseCode();
if(code == 200){
//获取请求到的流信息
lnputStream inputStream = connection.getlnputStream();
String result = StreamUtils.streamToString(inputStream);
//2.解析获取的新闻数据到List集合中
JSONObject root_json = new JSONObject(result);//将一个字符串封装成一个json对象
JSONArray jsonArray = root_json.getJSONArray("newss");//获取root_json中的newss作为jsonArray对象
for(int i = 0;i<jsonArray.length();i++){//循环遍历jsobArray
JSONObject news_json = jsonArray.getJSONObject(i);//获取一条新闻的json
NewsBean newsBean = new NewsBean();
newsBean.id = news_json.getlnt("id");
newsBean.comment = news_json.getlnt("comment");
newsBean.type = news_json.getlnt("type");//新闻的类型,0:头条,1:娱乐,2:体育
newsBean.time = news ison.getString("time");
newsBean.des = news ison.getString("des");
newsBean.title = news ison.getString("title");
newsBean.news_url = news ison.getString("news_url");
newsBean.icon_url = news ison.getString("icon_url");
arrayList.add(newsBean);
}
//3.清除数据库中旧的数据,将新的数据缓存到数据库中
new NewsDaoUtils(context).delete();
new NewsDaoUtils(context).saveNews(arrayList);
}
}catch(Exception e){
e.printStackTrace();
}
return arrayList;
}

信用行为

  • 接单
    0
  • 评价
    0
  • 收藏
    0
微信扫码,建群沟通

发布任务

企业点击发布任务,工程师会在任务下报名,招聘专员也会在1小时内与您联系,1小时内精准确定人才

微信接收人才推送

关注猿急送微信平台,接收实时人才推送

接收人才推送
联系聘用方端客服
联系聘用方端客服