Below you will find pages that utilize the taxonomy term “Android”
Install android sdk and eclipse in Ubuntu 12.04
Download and unpack the Android SDK, move it to your home folder. I prefer to set a point in front of the directory folder to make it be hidden so that my home directoy still looks tidy: .android-sdk-linux
. Then add this to your path:
export PATH=${PATH}:~/.android-sdk-linux/tools:~/.android-sdk-linux/platform-tools
.android-sdk-tools is for running android
command, and .android-sdk-tools/platform-tools is for running adb
command And add it to your .bashrc-file so that this path is loaded automatically when you log on.
Android: Asynchronously download images
In the Malmöfestivalen for Android where I participate we wanted to show thumbnails of events in lists. We have urls of thumbnails from Malmofestivalen API. This information is stored in a sqlite database and a SimpleCursorAdapter is used for getting the events from the database. It is possible to bind the urls to ImageView objects (by downloading the stream: 1, 2, 3). The problem is in a listactivity with many images it will freeze. So it must be an AsyncTask, and it should be some kind of local cache to avoid loading same images over and over again. Fortunately there is already ImageDownloader class provided in the android blog post: Multithreading For Performance . The next step is to create custom adapter and extend from SimpleCursorAdapter: EventCursorAdapter, like described on Android-er and and SP-Technolab: [sourcecode language=“java”]public class EventCursorAdapter extends SimpleCursorAdapter { private final ImageDownloader imageDownloader = new ImageDownloader(); public EventCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to) { super(context, layout, c, from, to); imageDownloader.setMode(ImageDownloader.Mode.NO_DOWNLOADED_DRAWABLE); } @Override public View getView(int position, View convertView, ViewGroup parent) { View row = super.getView(position, convertView, parent); Cursor cursor = getCursor(); cursor.moveToPosition(position); ImageView iv = (ImageView) row.findViewById(R.id.eventitemrowimage); String url = cursor.getString(cursor.getColumnIndex(EventProvider.EVENT_KEY_URISMALLIIMAGE)); if (url.length() > 0) { imageDownloader.download(url, iv); } String start = cursor.getString(cursor.getColumnIndex(EventProvider.EVENT_KEY_STARTDATE)); String end = cursor.getString(cursor.getColumnIndex(EventProvider.EVENT_KEY_ENDDATE)); String dateString = DateHelper.createShortDateResume(start, end); TextView tv = (TextView) row.findViewById(R.id.eventitemrowtimeresume); tv.setText(dateString); return row; } }[/sourcecode] In this code the view is created by the super class and then it is modified, the alternative is to “inflate the view” completely self. The result is an event list which opens directly and loads thumbnails asynchronously: listactivity with images
ResxCrunch: Localization tool
If your solution has two or more languages to support, I can recommend an open source tool ResxCrunch. Btw, you can even use ResxCrunch for localization of Android applications.
Publish upgrade on Market - checklist
Here comes my checklist about what has to be done in order to publish an upgrade on Market.
- get all code from github (git pull origin master)
- Test the application
- Change version number in AndroidManifest.xml
- Commit “version x.x.” and push
- (Change google map api key in res/layout/main.xml to the prod key)
- In Eclipse: Project → Clean
- Right-click on project → Android tools → Export signed… (~/Skrivbord/LUSites-unaligned.apk)
- Zipalign (e.g.: zipalign -v 4 LUSites-unaligned.apk LUSites-v0.2.7.apk)
- Publish upgrade on market
- Save the apk to the archive
LUSites now available for lower API levels
If your smartphone runs Android 2.1 or lower, now you can find LUSites on Market, too. When I created LUSites I developed for Froyo (Android 2.2). But LUSites does nothing that hasn’t existed in previous Android releases (API levels). So I set API level 3 as minimal SDK version. I hope it works on your android phones. If not, please leave a comment here.
Bläddra i Sharepoint från Android
Det finns en app som heter Quick Browser för Android från SPElements. Med den kan man bläddra i olika bibliotek och listor i en sharepoint direkt från mobilen. Mycket smidigt. Den aktuella versionen är 0.2.8. Den uppdateras rätt så ofta och blir bättre och bättre. Den enda nackdelen jag tycker är att man får alla element i ett bibliotek bara som en lista. Om det är image library så måste man long-klicka på ett element för att “download and view”. Mycket smidigare hade det varit om bilder visades i en Gallery.