Apologies
Apologies for the disappearance. I’m occupied by both my job and another project with a May deadline. Expect things to pick up later.

JVL
Keni

ellievsbear
almost home
sheepfilms

if i look back, i am lost
Three Goblin Art
Stranger Things

祝日 / Permanent Vacation
styofa doing anything
i don't do bad sauce passes
Mike Driver

No title available

blake kathryn
2025 on Tumblr: Trends That Defined the Year

tannertan36
Peter Solarz
Cosmic Funnies
NASA
todays bird
seen from United States
seen from Singapore

seen from Türkiye

seen from United States
seen from Australia
seen from Netherlands

seen from Germany
seen from Singapore
seen from United States
seen from United States

seen from Malaysia

seen from South Korea
seen from United States

seen from United States

seen from Malaysia

seen from Australia
seen from United States

seen from United Kingdom

seen from United States

seen from United Kingdom
@paralleltide-blog
Apologies
Apologies for the disappearance. I’m occupied by both my job and another project with a May deadline. Expect things to pick up later.
More touch thoughts
Not too much work today, I've just been considering the logic for handling dragging and two-finger touch. Clearly, any of the timers set in my last post about this would be reset if a) a finger moves more than a certain distance from where it went down, say 5 pixels, or b) a second finger goes down. From this point on, we just listen to the position(s) of the fingers on screen. . At least, I think that'd work.
Soon I'll get to putting all this into code.
Ahem
Apologies for the lack of work this week, a few things taking my attention *cough*Minecraft*cough*.
I'm away again this weekend too, so expect updates again on Mon/Tue
Back, and TouchListening.
I return after that small break.
Not too much to report today, just considering how to handle touch input the BoardView object. Here's some simple logic for one finger without movement:
On one finger down: Begin a timer for a held press.
On one finger up: If a timer for held-press is running, stop it. If a timer for double-clicking is running: Stop that timer and trigger a double-click event. Else: Start the double-click timer. Trigger a single-click event.
One the held-press timer triggering: Trigger a held-press event.
The only glitch of this is that a double-click triggers a single click too. Though I can think of a few ways around this:
Leave as is, and recommend that single clicks are used for selecting only.
Wait to see if the user double-clicks. However this will make clicking seem laggy.
Undo the last click if double-click occurs. The user will still see the item get selected then deselected, which might not be aesthetically pleasing.
Of course, this isn't gospel, and will get more complicated when I start to factor in movement and extra fingers...
Brief Hiatus
I'm going away this weekend, so there's going to be a break until about Tuesday, at which point I'll pick up.
BoardView: Onward
So I've begun work on BoardView, just simple steps for now.
I've created some shell classes, with just variables and accessors for now, which will both most certainly be expanded upon. I'm aiming for a Listener model pretty similar to that already found in Java.
BoardView - The main class for this project, extending android's View class. This will have flags for whether a view is pannable, zoomable, etc, and will have defined dimensions and padding values.
BoardViewElement - The class for items that will be displayed within the BoardView. This class will have an image, listeners, and coordinates.
BoardViewException - Exception class for BoardView specific exceptions.
BoardViewListener - A listener interface. A BoardViewElement will have one, none, or may of these listeners, which will be triggered when the element is selected, double-clicked, etc...
BoardViewEvent - Event class passed to listeners, providing detail about what happened.
Some points already come to mind, that I must consider later on:
For a BoardView with a large number of items, the initial code for detecting what has been clicked on will be, if anything, will iterate a lot of those items needlessly. At a later date, I'll probably need to implement something to get around this; a QuadTree comes to mind.
Also, I'll need some way of filtering what elements are to be drawn when a redraw is called. Don't need to constantly update the whole board, especially if it's many times the size of the screen.
Some games might require a BoardView that extends in a particular direction, a growing board if you will. I'll need to see which is the best way to implement this.
Plan of action
I've studied Views and the Canvas class of Android, and have decided to write my own implementation for my desired pannable and zoomable area. My plan of action is as follows:
Create a class that can contain clickables and other interactive elements. I'll be calling this a 'BoardView' for now, since It'll be like a game board, and probably be used for turn based board-like games. This class will be an extension of the android view class, and will optionally be zoomable, pannable and possibly even rotatable, within given constraints.
The second objective I have is to implement a simple board game using this class. This will be a implementation of the board game 'Twixt' http://en.wikipedia.org/wiki/TwixT a variation of the connect lines game. On a whim, with no in-depth thought, I'll give the game a tron-like styling and call it 'Night Lines'; Twixt moves are like a Knight in chess... maybe.. get it? Thought not.
Anyway, I'm hoping to have a crack at this tomorrow, during which time I'll be posting here as I work.
More zooming and panning
So my plan is to ask around a forum or two as to what's the best approach for this. I'm pretty sure someone somewhere must have done something like this.
Though I can see how I can write my own method. Have some sort of drawable-clickable interface objects stored in an extension of imageview, and adjust the bitmap image and matrix as required. All easier said than done, mind.
To be Panning and Zooming
I've had a bit more of a tinker with the layouts. There's a fair amount of selection in the available components there.
But, I'm most definitely going to need to write my own view. I can't see any immediate way to have a zoomable and pannable area, much like google maps. Even for a simple board game, I'd like such an area; a great example is in the iOS carcassonne app. So, over the weekend, I'm going to have a dabble in writing my own such zoomable/pannable basic image viewer.
Offtopic: Although Ubuntu has come quite a way since my first tinker in version 4.10, I'm not a fan of the new notification area. Two scenarios come to mind:
On this development box, I have no interest in setting up e-mail, or other social features. So why do I have to have that mail icon next to the volume control? Remove one, and the other goes. It's just cluttering things up.
And on the other hand, I tried to use Ubuntu 10.04 as my main social OS, which didn't go down well at all. The volume of mail, twitter and IM traffic means that the mail icon is always lit up, leaving me with no on-screen notification of where I've got new notifications.
Case anyone is interested, most of my social activity goes on on a HP 110, running ArchLinux/Openbox. Quick, snappy and uncluttered. And Windows 7 for gaming.
So today, I've just had a quick dabble in the layout system in Android. Surprisingly simple, so far. I've used a simple text editor for this though, the android layout editor in Eclipse is far from WYSIWYG; for example this image appears as I expected, but in the Eclipse editor, both the fields are equally sized...
Though I do wonder how I'm going to manage a zoomable, pannable canvas. Which is something I can see myself needing later down the line...
For now though, I'm going to have a think on what small project I'm going to undertake to break myself in. Some sort of abstract board game sounds like a good bet...
Hello World!
And I'm done for today.
Android prep
Following on from the extraction of the android sdk base and eclipse, I install the android ADT tools for eclipse, following http://developer.android.com/sdk/eclipse-adt.html.
And while that is going on, I run my android shortcut and set it off downloading the platform-tools, documentation, a few SDKs (2.3, 2.2 and 1.6), and the samples.
With all this done, I configure the ADT to point to my 'android-sdk-linux_86' directory sitting on my desktop, create a new project and AVM, and fire away the hello world application...
Here's the desktop, following installation of the basic tools, and the set-up of launchers.
Strewn across his desk...
Out of the four things I've downloaded, two are handled by synaptic, which does it's business...
Meanwhile the android starter package, and eclipse, are both in .tar.gz files, which I've extracted to my Desktop for ease of access. Not really the linux way, but it'll work.
In order to get things neatly accessible, I've created a 'bin' folder in my home directory, which ubuntu nicely picks up on and adds it to my path (when I next log in). In this bin directory I've created a couple of quick scripts to run the android tool and eclipse in their own directories...
#!/bin/bash
cd ~/Desktop/eclipse
./eclipse
#!/bin/bash
cd ~/android-sdk-linux_86/tools
./android
And have plopped gnome-launchers to these on my desktop too. Randomly digging out an android icon from the net. Image to follow.
Grab grab grab
So with a freshly updated ubuntu, I grab the things I know I'm going to need:
The android SDK, from http://developer.android.com
The latest eclipse build, the basic Java dev edition for now, from http://www.eclipse.org/downloads/
Build essential tools, via 'sudo apt-get install build-essential'. I suppose these are not essential just at the moment, but you never know; I might need to dabble in native code.
And finally a java jdk, by enabling partner repositories in synaptic and installing sun-java6-jdk, sun-java6-fonts, sun-java6-demo and sun-java6-plugin. I suspect that all bar the first of these are optional for the purposes of android development/
And finally, not related to the development in any way, Dropbox. Just so I can keep things accessible from every computer I use.
Environment Setup
So, it transpires that the ArchLinux net install cd has just the right kernel that my wireless card (Tenda u322w aka Ralink2780) does not work due to some gaffe which has been built into the kernel. Shame that.
Seeing as it's a bit too much effort to ferry across build-essential and the wireless drivers, I've gone with Ubuntu 10.10 since I have a disk handy. The wireless still seems distinctly flaky though, dropping a lot unlike Windows 7 does on this machine, something I'll look into. Nevertheless, I'm impressed that compositing and a resolution of 1980x1080 is working out of the box.