小编Sya*_*m S的帖子

不推荐使用MultipartEntity类型

文档说org.apache.http.entity.mime.MultipartEntity 该类已被弃用.有人可以建议我另类吗?

我在我的代码中使用这个:

entity.addPart("params", new StringBody("{\"auth\":{\"key\":\""
            + authKey + "\"},\"template_id\":\"" + templateId + "\"}"));
entity.addPart("my_file", new FileBody(image));
httppost.setEntity(entity);
Run Code Online (Sandbox Code Playgroud)

java apache

43
推荐指数
2
解决办法
5万
查看次数

使用Picasso设置背景资源

我知道毕加索是一个很棒的图书馆.

Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView);
Run Code Online (Sandbox Code Playgroud)

使用此代码,我可以将图像加载到图像视图.

但是可以使用Picasso设置后台资源吗?

android picasso

8
推荐指数
1
解决办法
1万
查看次数

获取公共推文Twitter API 1.1

我是Twitter API的第一次

我正在浏览 https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline

我需要从https://twitter.com/twitterapi获取公开推文

api 1.1链接说 -

身份验证 - 必需

我找到了类似的东西 - AuthTool

我无法连接所有这些东西,因为没有可用的初学者教程.

我的基本疑问 - 需要身份验证意味着 - 使用我的应用程序的最终用户应该有一个Twitter帐户来获取这些推文吗?(我正在计划一个移动应用程序(android),以显示一些名人的公开推文)

  • 我在哪里可以找到一些基本的教程?

  • 我是否需要一些令牌来传递请求?怎么弄那些?

twitter android

6
推荐指数
1
解决办法
6824
查看次数

BigTextStyle通知未从FirebaseMessagingService扩展

我写了下面的方法来显示我的Android 5.1设备上的FCM通知.当我在FirebaseMessagingService中运行代码时,它只是提供单行通知,如果我在Activity中运行相同的代码,则会发出可扩展通知.

我基本上需要我的长FCM文本通知来扩展通知而不是显示部分通知文本.

任何线索?

private void showNotif(String messageBody){

     Intent intent = new Intent(this, MainActivity.class);
     intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
     PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_ONE_SHOT);

     // Constructs the Builder object.
     NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(getApplicationContext())
         .setSmallIcon(R.drawable.ic_launcher)
         .setContentTitle(getString(R.string.app_name))
         .setContentText(messageBody)
         .setDefaults(Notification.DEFAULT_ALL) // requires VIBRATE permission
         .setAutoCancel(true)
         .setContentIntent(pendingIntent)
         /*
          * Sets the big view "big text" style and supplies the
          * text (the user's reminder message) that will be displayed
          * in the detail area of the expanded notification.
          * These calls are ignored by the …
Run Code Online (Sandbox Code Playgroud)

android android-notifications firebase firebase-notifications

6
推荐指数
1
解决办法
1222
查看次数

警告:库类android.net.http.AndroidHttpClient扩展或实现程序类org.apache.http.client.HttpClient

我在导出Android应用程序时从proguard得到这些奇怪的错误.我编辑了配置文件.但我找不到剩下的错误.

我添加了外部Jars,配置-dontwarn,现在我找不到剩下的问题.

[2013-11-22 17:13:31 - MyProject] Note: there were 1267 duplicate class definitions.
[2013-11-22 17:13:31 - MyProject] Warning: library class android.net.http.AndroidHttpClient extends or implements program class org.apache.http.client.HttpClient
[2013-11-22 17:13:31 - MyProject]       You should check if you need to specify additional program jars.
[2013-11-22 17:13:31 - MyProject] Warning: there were 1 instances of library classes depending on program classes.
[2013-11-22 17:13:31 - MyProject]          You must avoid such dependencies, since the program classes will
[2013-11-22 17:13:31 - MyProject]          be processed, while the …
Run Code Online (Sandbox Code Playgroud)

android

5
推荐指数
1
解决办法
6139
查看次数

Android Image下载程序/缓存管理器

Masters,我正在开发一个Google plus类似于android的应用程序.这将从服务器呈现提要.我正在使用自定义列表视图并填充它.之间,我有要在每个列表项中显示的图像.

我使用下面的代码下载图像并放入视图.

我从这里得到它.,和其他很多地方我见过相同的代码.

这里的问题是

  1. 缓存没有发生.我记录了电话,发现每次新下载图像时.
  2. 我需要一个解决方案,我需要存储一些图像,当请求URL到来时,它应检查现有的缓存并提供图像.没有让它再次从网上下载.

任何人都可以建议我做任何好的库,或任何简单的修复下面的代码.

请注意,我不是专家:)

/*
 * Copyright (C) 2010 The Android 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 …
Run Code Online (Sandbox Code Playgroud)

android caching

2
推荐指数
2
解决办法
6677
查看次数