-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Enrique Diaz
committed
Jul 7, 2011
1 parent
230c65c
commit 7b064d2
Showing
36 changed files
with
258 additions
and
73 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
.metadata/.plugins/org.eclipse.core.resources/.history/62/70b679ed7da800101d5dd4f6ef0922ba
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.androidtitlan.itam.simpledownload; | ||
|
||
import java.io.IOException; | ||
import org.apache.http.HttpEntity; | ||
import org.apache.http.HttpResponse; | ||
import org.apache.http.StatusLine; | ||
import org.apache.http.client.ResponseHandler; | ||
import org.apache.http.client.HttpResponseException; | ||
import org.apache.http.util.EntityUtils; | ||
|
||
public class ByteArrayResponseHandler implements ResponseHandler<byte[]> { | ||
public byte[] handleResponse(final HttpResponse response) | ||
throws IOException, HttpResponseException { | ||
StatusLine statusLine=response.getStatusLine(); | ||
|
||
if (statusLine.getStatusCode()>=300) { | ||
throw new HttpResponseException(statusLine.getStatusCode(), | ||
statusLine.getReasonPhrase()); | ||
} | ||
|
||
HttpEntity entity=response.getEntity(); | ||
|
||
if (entity==null) { | ||
return(null); | ||
} | ||
|
||
return(EntityUtils.toByteArray(entity)); | ||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
.metadata/.plugins/org.eclipse.core.resources/.history/c5/6076ec4382a800101d5dd4f6ef0922ba
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package org.androidtitlan.itam.simpledownload; | ||
|
||
import android.app.Activity; | ||
import android.app.IntentService; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.os.Environment; | ||
import android.os.Message; | ||
import android.os.Messenger; | ||
import android.util.Log; | ||
import java.io.File; | ||
import java.io.FileOutputStream; | ||
import java.io.IOException; | ||
import org.apache.http.client.ResponseHandler; | ||
import org.apache.http.client.HttpClient; | ||
import org.apache.http.client.methods.HttpGet; | ||
import org.apache.http.impl.client.BasicResponseHandler; | ||
import org.apache.http.impl.client.DefaultHttpClient; | ||
|
||
public class Downloader extends IntentService { | ||
public static final String EXTRA_MESSENGER="com.commonsware.android.downloader.EXTRA_MESSENGER"; | ||
private HttpClient client=null; | ||
|
||
public Downloader() { | ||
super("Downloader"); | ||
} | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
client=new DefaultHttpClient(); | ||
} | ||
|
||
@Override | ||
public void onDestroy() { | ||
super.onDestroy(); | ||
client.getConnectionManager().shutdown(); | ||
} | ||
|
||
@Override | ||
public void onHandleIntent(Intent i) { | ||
HttpGet getMethod=new HttpGet(i.getData().toString()); | ||
int result=Activity.RESULT_CANCELED; | ||
|
||
try { | ||
ResponseHandler<byte[]> responseHandler=new ByteArrayResponseHandler(); | ||
byte[] responseBody=client.execute(getMethod, responseHandler); | ||
File output=new File(Environment.getExternalStorageDirectory(), | ||
i.getData().getLastPathSegment()); | ||
|
||
if (output.exists()) { | ||
output.delete(); | ||
} | ||
|
||
FileOutputStream fos=new FileOutputStream(output.getPath()); | ||
|
||
fos.write(responseBody); | ||
fos.close(); | ||
result=Activity.RESULT_OK; | ||
} | ||
catch (IOException e2) { | ||
Log.e(getClass().getName(), "Exception in download", e2); | ||
} | ||
|
||
Bundle extras=i.getExtras(); | ||
|
||
if (extras!=null) { | ||
Messenger messenger=(Messenger)extras.get(EXTRA_MESSENGER); | ||
Message msg=Message.obtain(); | ||
|
||
msg.arg1=result; | ||
|
||
try { | ||
messenger.send(msg); | ||
} | ||
catch (android.os.RemoteException e1) { | ||
Log.w(getClass().getName(), "Exception sending message", e1); | ||
} | ||
} | ||
} | ||
} |
Binary file modified
BIN
+32 Bytes
(110%)
.metadata/.plugins/org.eclipse.core.resources/.projects/HolaAndroid/.markers.snap
Binary file not shown.
Binary file modified
BIN
+32 Bytes
(170%)
.metadata/.plugins/org.eclipse.core.resources/.projects/HolaAndroid/.syncinfo.snap
Binary file not shown.
Binary file modified
BIN
+893 Bytes
(120%)
.metadata/.plugins/org.eclipse.core.resources/.projects/SimpleDownload/.markers.snap
Binary file not shown.
Binary file modified
BIN
+32 Bytes
(150%)
.metadata/.plugins/org.eclipse.core.resources/.projects/SimpleDownload/.syncinfo.snap
Binary file not shown.
Binary file modified
BIN
+32 Bytes
(100%)
.metadata/.plugins/org.eclipse.core.resources/.projects/SimpleService/.markers.snap
Binary file not shown.
Binary file modified
BIN
+32 Bytes
(150%)
.metadata/.plugins/org.eclipse.core.resources/.projects/SimpleService/.syncinfo.snap
Binary file not shown.
Binary file modified
BIN
+32 Bytes
(100%)
.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap
Binary file not shown.
Binary file modified
BIN
+1.2 KB
(100%)
.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions
4
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.browser.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#Thu Jul 07 04:16:46 CDT 2011 | ||
#Thu Jul 07 05:15:11 CDT 2011 | ||
eclipse.preferences.version=1 | ||
internalWebBrowserHistory=http\://commonsware.com/Android/excerpt.pdf|*| | ||
internalWebBrowserHistory=file\:/Users/spy/Android%20Development/android-sdk-mac/docs/reference/android/os/Message.html|*|http\://commonsware.com/Android/excerpt.pdf|*| |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
2011-07-07 05:42:06,529 TRACE [pool-1-thread-1] c.m.a.AndroDemon [AndroDemon.java:124] initBridge | ||
2011-07-07 05:42:06,565 TRACE [pool-1-thread-1] c.m.a.AndroDemon [AndroDemon.java:126] create bridge | ||
2011-07-07 05:42:06,882 TRACE [pool-1-thread-1] c.m.a.AndroDemon [AndroDemon.java:129] bridge is created | ||
2011-07-07 05:42:06,902 INFO [Device List Monitor] c.m.a.AndroDemon [AndroDemon.java:135] deviceConnected: 0403889903011014 | ||
2011-07-07 05:42:06,993 TRACE [Device List Monitor] c.m.a.AndroDemon [AndroDemon.java:147] deviceChanged: 0403889903011014 - 4 | ||
2011-07-07 05:42:14,156 DEBUG [AWT-EventQueue-0] c.m.a.Mediator [Mediator.java:171] Full screen: true | ||
2011-07-07 05:42:33,302 DEBUG [AWT-EventQueue-0] c.m.a.Mediator [Mediator.java:171] Full screen: false |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
=================================================== | ||
Android Screenshots and Screen Capture 1.1 | ||
=================================================== | ||
|
||
Before you begin, please make sure you have installed: | ||
|
||
- JDK | ||
http://www.oracle.com/technetwork/java/javase/downloads/index.html | ||
|
||
- Android SDK | ||
http://developer.android.com/sdk/index.html | ||
|
||
Remark: it is enough to complete "Prepare your development computer" | ||
and "Download and install the SDK starter package" steps | ||
from Android SDK Quick Start. | ||
|
||
- (Windows Only): Install USB driver | ||
http://developer.android.com/sdk/win-usb.html | ||
|
||
=================================================== | ||
Launching application | ||
=================================================== | ||
|
||
To start taking screenshots of your Android phone launch the | ||
following file which can be found in the same folder as this | ||
readme file: | ||
|
||
AShot-1.0.jar | ||
|
||
and provide the path to Android SDK in File -> Android SDK path... | ||
|
||
You are all set! | ||
|
||
For more details please visit: | ||
|
||
http://www.mightypocket.com/2010/08/android-screenshots-screen-capture-screen-cast/ |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
SimpleDownload/bin/org/androidtitlan/itam/simpledownload/Downloader.class
Binary file not shown.
Binary file modified
BIN
+3 Bytes
(100%)
SimpleDownload/bin/org/androidtitlan/itam/simpledownload/SimpleDownload.class
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.