spring-attic / spring-android-samples Goto Github PK
View Code? Open in Web Editor NEWSpring for Android Sample Applications
Home Page: http://projects.spring.io/spring-android
License: Apache License 2.0
Spring for Android Sample Applications
Home Page: http://projects.spring.io/spring-android
License: Apache License 2.0
Hello Mr. Clarckson,
First of all thank you very much for your invaluable contributions to the open source Spring/Android communities.
RestTemplate API for Android is extremely useful to develop client-server communications in the Android platform. It would be great to have an excellent guide as: http://spring.io/guides/gs/consuming-rest-android/ oriented to WebSockets technology (http://spring.io/guides/gs/messaging-stomp-websocket/) for Android. Does Spring Roadmap contemplates the development of an equivalent API for STOMP over WebSockets?
Thank you very much for your attention,
Warren de León Ofalla http://warrendeleon.com
The dependencies on spring-android 1.0.0.BUILD-SNAPSHOT is at least not easily resolvable. Setting version to 1.0.0.M4 seem ok.
Just writing this here for any newcomers... not too sure if this is a issue (or rather me using incompatible versions.
To solve, use the 3.8 verison of android-maven-plugin.
Hi guys,
I'm working on integrating an API in an Android application and I want to use the framework provided by Spring for Android/Spring Social to do so.
I used the spring-android-twitter-client as an example to get my things up and running. The problem is that the my application must be able to get an access token based on the consumer key and consumer secret with a grant_type=client_credentials (http://tools.ietf.org/html/rfc6749#section-4.4).
This feature is available in the newest version of the spring-social-core (1.0.0.RELEASE) but it's not in the version used in the Twitter guide. So I did what I add to do and updated my application dependencies but I ran in a problem.
The newest version of the spring-social-core uses new features from the org.apache.httpclient librairies. I reproduced the error in your Twitter sample simply by updating the dependencies, When I run the application and try to connect to my account, I get the following runtime error:
01-13 14:33:27.941 24112-24178/org.springframework.android.twitterclient E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #1
Process: org.springframework.android.twitterclient, PID: 24112
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:300)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/protocol/HttpClientContext;
at org.springframework.social.support.ClientHttpRequestFactorySelector$HttpComponentsClientRequestFactoryCreator$1.createHttpContext(ClientHttpRequestFactorySelector.java:80)
at org.springframework.http.client.HttpComponentsClientHttpRequestFactory.createRequest(HttpComponentsClientHttpRequestFactory.java:133)
at org.springframework.http.client.support.HttpAccessor.createRequest(HttpAccessor.java:84)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:472)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:453)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:429)
at org.springframework.social.oauth1.OAuth1Template.exchangeForToken(OAuth1Template.java:187)
at org.springframework.social.oauth1.OAuth1Template.fetchRequestToken(OAuth1Template.java:115)
at org.springframework.android.twitterclient.TwitterWebOAuthActivity$TwitterPreConnectTask.doInBackground(TwitterWebOAuthActivity.java:136)
at org.springframework.android.twitterclient.TwitterWebOAuthActivity$TwitterPreConnectTask.doInBackground(TwitterWebOAuthActivity.java:126)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.client.protocol.HttpClientContext" on path: DexPathList[[zip file "/data/app/org.springframework.android.twitterclient-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at org.springframework.social.support.ClientHttpRequestFactorySelector$HttpComponentsClientRequestFactoryCreator$1.createHttpContext(ClientHttpRequestFactorySelector.java:80)
at org.springframework.http.client.HttpComponentsClientHttpRequestFactory.createRequest(HttpComponentsClientHttpRequestFactory.java:133)
at org.springframework.http.client.support.HttpAccessor.createRequest(HttpAccessor.java:84)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:472)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:453)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:429)
at org.springframework.social.oauth1.OAuth1Template.exchangeForToken(OAuth1Template.java:187)
at org.springframework.social.oauth1.OAuth1Template.fetchRequestToken(OAuth1Template.java:115)
at org.springframework.android.twitterclient.TwitterWebOAuthActivity$TwitterPreConnectTask.doInBackground(TwitterWebOAuthActivity.java:136)
at org.springframework.android.twitterclient.TwitterWebOAuthActivity$TwitterPreConnectTask.doInBackground(TwitterWebOAuthActivity.java:126)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Suppressed: java.lang.ClassNotFoundException: org.apache.http.client.protocol.HttpClientContext
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 17 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
The problem seems to be caused by the httpclient version that is shipped with Android which is older than the one required. If I try to add the dependencies of the HttpClient port for Android in my build, Gradle seems to exclude it to avoid conflict.
I'm on Linux, I use Android Studio 1.0.1 and I open Android projects with Gradle. What can be done?
First, thanks and congratulations for the project!
I'm trying to connect using an application created on my Twitter, but when the fetch request for the token is done my application opens the browser with the authentication token generated:
This because I had to register a valid URL in the "Callback URL" field. I saw that you registered the value "x-android-org-springsource-twitterclient://twitter-oauth-response", but could not registering something that pattern...
Could you help me please?
Caused by: java.lang.NoClassDefFoundError: org.springframework.util.LinkedCaseInsensitiveMap at org.springframework.http.HttpHeaders.(HttpHeaders.java:342)
MessageList class is missing:
[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.2:compile (default) on project spring-android-showcase-server: Compiler errors :
[ERROR] error at public @ResponseBody MessageList fetchMessagesXml() {
[ERROR] ^^^^^^^^^
[ERROR] /spring-android-samples/spring-android-showcase/server/src/main/java/org/springframework/android/showcase/HomeController.java:194:0::0 MessageList cannot be resolved to a type
[ERROR] error at MessageList messageList = new MessageList(messages);
[ERROR] ^^^^^^^^
[ERROR] /spring-android-samples/spring-android-showcase/server/src/main/java/org/springframework/android/showcase/HomeController.java:197:0::0 MessageList cannot be resolved to a type
[ERROR] error at MessageList messageList = new MessageList(messages);
[ERROR] ^^^^^^^^
[ERROR] /spring-android-samples/spring-android-showcase/server/src/main/java/org/springframework/android/showcase/HomeController.java:197:0::0 MessageList cannot be resolved to a type
First bad commit is aa74759:
git bisect log
git bisect start
# bad: [aa74759a83da81b8b6a179b0c24078920c5d0122] Updating dependencies
git bisect bad aa74759a83da81b8b6a179b0c24078920c5d0122
# good: [aa41c819206abdb77e290802c9882324cbdae2a6] Updated to Spring Social 1.0.0.RC2 and Jackson 1.8.4
git bisect good aa41c819206abdb77e290802c9882324cbdae2a6
# good: [aa41c819206abdb77e290802c9882324cbdae2a6] Updated to Spring Social 1.0.0.RC2 and Jackson 1.8.4
git bisect good aa41c819206abdb77e290802c9882324cbdae2a6
# good: [64dc2635a87a694d90311d8740d6e0d59884ea77] Updated to Jackson 1.8.4
git bisect good 64dc2635a87a694d90311d8740d6e0d59884ea77
Hi, would it be possible to update the twitter client example to use spring-social-twitter:1.1.0.RELEASE? I'm trying to update the version so I can use the 'getUnmodifiedText' method on Tweet, but I keep running in to dependency problems - it looks like the transitive dependencies for the latest version of spring-social-twitter are much more complex than they used to be, so I either end up with dex problems when spring-beans gets included, or if I fix that I get runtime exceptions for missing classes.
Thanks.
failure information:
[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:andr
oid-maven-plugin:3.9.0-rc.1:apk (default-apk) on project spring-android-showcase
-client: Error while processing transient dependencies: Failed to collect depend
encies at org.springframework.android:spring-android-rest-template:jar:2.0.0.M1
-> com.google.code.android-rome-feed-reader:android-rome-feed-reader:jar:1.0.0-r
2: Failed to read artifact descriptor for com.google.code.android-rome-feed-read
er:android-rome-feed-reader:jar:1.0.0-r2: Could not transfer artifact com.google
.code.android-rome-feed-reader:android-rome-feed-reader:pom:1.0.0-r2 from/to cen
tral (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorExc
eption: PKIX path building failed: sun.security.provider.certpath.SunCertPathBui
lderException: unable to find valid certification path to requested target -> [H
elp 1]
my maven environment:
Apache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-12T04:58:1
0+08:00)
Maven home: C:\tools\apache-maven-3.2.3\bin..
Java version: 1.7.0_21, vendor: Oracle Corporation
Java home: D:\Program Files\Java\jdk1.7.0_21\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
Hi,
I have downloaded the Spring for Android 1.0.0.RC1 and I couldn't find the following packages:
The packages that look similar that I have are:
Is this normal? Where can I find the rest?
Thanks!
I noticed that if you specify the targetSDKversion in AndroidManifest.xml file higher than 15, facebook client example does not work. Login process fails. I haven't tested it by with targetSdkVersion below 15 since I need to use latest target in my project.
Seems some redirection issue with httpclient/RESTemplate in higher version of SDK.
Just in case,I am using
facebook social version = 1.0.3.RELEASE
maven-compiler-version = 3.1
targetSdkVersion in AndroidManifest.xml = 17
After Facebook connection is disconnected, and the Connect option is shown, when the item option clicked, it automatically connect to Facebook without asking for user name and password, and to totally disconnect , we have to clear cache/data from app management.
It seems onPageStarted methed of FacebookOAuthWebViewClient class is called again and again until uriFragment is obtained. How can we disconnect totally?
How to use this project to upload image
Spring social-twitter dependency version need update to 1.0.5.RELEASE to accommodate twitter API 1.1 release
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-twitter</artifactId>
<version>1.0.5.RELEASE </version>
<exclusions>
<!-- Provided by Android -->
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
twitter example works fine following this update.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.