Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

first version

  • Loading branch information...
commit 531d5d41d467e8741366b1eb60fbeaac2d5a8a73 1 parent c077456
@Kaplux authored
View
32 AndroidManifest.xml
@@ -2,14 +2,30 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="fr.mildlyusefulsoftware.thecutest" android:versionCode="1" android:versionName="1.0-SNAPSHOT">
- <application android:icon="@drawable/icon" android:label="@string/app_name">
- <activity android:name=".HelloAndroidActivity">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- </application>
+ <uses-permission android:name="android.permission.INTERNET" />
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+
+ <uses-sdk
+ android:minSdkVersion="7"
+ android:targetSdkVersion="13" />
+
+ <application
+ android:icon="@drawable/icon"
+ android:label="@string/app_name"
+ android:theme="@android:style/Theme.Light" >
+
+ <activity
+ android:name="com.google.ads.AdActivity"
+ android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
+ <activity android:name=".activity.ViewPictureActivity">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+ </application>
</manifest>
View
BIN  assets/.DS_Store
Binary file not shown
View
BIN  assets/PICTURES.DB.zip
Binary file not shown
View
4 default.properties
@@ -1,3 +1,3 @@
-# File used by Eclipse to determine the target system
+android.library.reference.1=../ImageViewer
# Project target.
-target=android-10
+target=android-10
View
BIN  external_resources/icon_512x512.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
41 pom.xml
@@ -20,6 +20,12 @@
<version>${platform.version}</version>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>fr.mildlyusefulsoftware.imageviewer</groupId>
+ <artifactId>imageviewer</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
<build>
@@ -50,5 +56,40 @@
</configuration>
</plugin>
</plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>
+ com.jayway.maven.plugins.android.generation2
+ </groupId>
+ <artifactId>
+ android-maven-plugin
+ </artifactId>
+ <versionRange>
+ [3.1.1,)
+ </versionRange>
+ <goals>
+ <goal>proguard</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore></ignore>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
</build>
</project>
View
12 project.properties
@@ -0,0 +1,12 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-13
+android.library.reference.1=../ImageViewer
View
BIN  res/drawable-hdpi/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  res/drawable-ldpi/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  res/drawable-mdpi/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2  res/values/strings.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello">Hello thecutest!</string>
- <string name="app_name">thecutest</string>
+ <string name="app_name">The Cutest Pictures</string>
</resources>
View
25 src/main/java/fr/mildlyusefulsoftware/thecutest/HelloAndroidActivity.java
@@ -1,25 +0,0 @@
-package fr.mildlyusefulsoftware.thecutest;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.util.Log;
-
-public class HelloAndroidActivity extends Activity {
-
- private static String TAG = "thecutest";
-
- /**
- * Called when the activity is first created.
- * @param savedInstanceState If the activity is being re-initialized after
- * previously being shut down then this Bundle contains the data it most
- * recently supplied in onSaveInstanceState(Bundle). <b>Note: Otherwise it is null.</b>
- */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- Log.i(TAG, "onCreate");
- setContentView(R.layout.main);
- }
-
-}
-
View
53 src/main/java/fr/mildlyusefulsoftware/thecutest/activity/ViewPictureActivity.java
@@ -0,0 +1,53 @@
+package fr.mildlyusefulsoftware.thecutest.activity;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+
+import android.util.Log;
+import fr.mildlyusefulsoftware.imageviewer.service.DatabaseHelper;
+import fr.mildlyusefulsoftware.imageviewer.service.Picture;
+
+
+
+
+public class ViewPictureActivity extends fr.mildlyusefulsoftware.imageviewer.activity.ViewPictureActivity {
+
+ @Override
+ protected String getAdMobId() {
+ return "a14f805d0f7e457";
+ }
+
+ private void createPicDb(){
+ try {
+ Document doc = Jsoup.connect("http://thefunniest.info/top.html").data("query", "Java")
+ .userAgent("Mozilla").cookie("auth", "token")
+ .timeout(3000).post();
+ Elements elts = doc.select("li");
+ List<Picture> pictures=new ArrayList<Picture>();
+ int i=0;
+ for (Element elt : elts) {
+ String url = elt.select("img").first().attr("src");
+ Log.d("thecutest",url);
+ try{
+ Picture p =new Picture(i,url,Picture.getPictureThumbnail(url));
+ pictures.add(p);
+ }catch (Exception e) {
+ // TODO: handle exception
+ }
+ i++;
+ }
+
+ DatabaseHelper.connect(this).putPictures(pictures);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+}
Please sign in to comment.
Something went wrong with that request. Please try again.