Xubuntu, the Xfce-based flavor of Xubuntu, is presently evaluating the use of Canonical’s Mir display server via the XMir X11 transition layer. For helping in the process and testing, the Ubuntu derivative has made public some Xubuntu XMir images…
OpenMP 4.0 Majorly Advances Parallel Programming
The OpenMP 4.0 specification has been unveiled as a major new specification for programming of accelerators, SIMD programming, and better optimization using thread affinity…
Reverse PRIME Committed To AMD X.Org Driver
For those concerned about the Reverse PRIME and multi-screen Reverse Optimus enablement for the AMD open-source X.Org driver, the support is now present in its Git tree…
GNOME 3.10 to be Offered for Wayland Beside X
The GNOME project announced plans for supporting Wayland quite a while ago and progress has been reported incrementally for months. Wayland was supported in GNOME 3.95 for the particularly crafty, but starting with 3.10, binaries will be offered for Wayland right beside X. Matthias Clasen posted of this and other decisions made today at Guadec.
In today’s post, Clasen said developers are planning “to have a tech preview of GNOME shell as a Wayland compositor in 3.10.” Wayland can offer benefits such as transparent hardware overlays, direct rendering, smooth transitions, and decreased lag and flicker.
Clasen then states that GNOME 3.10 be be available in “two binaries, for the X and Wayland compositor.” Further, the “display configuration will work” and in 3.10 developers “will keep input methods working as before, with client-side IBus. We will switch to using the Wayland text protocol and server-side IBus next cycle.”
More details are at the Port GNOME to Waylandwiki features entry.
![]()
Linux Top 3: Linux 3.10 Goes Long, Linux 3.11 Advances as LXDE Merges
Big week for Linux news with major kernel news and a reshaping of the Linux desktop space.
When Did You Start Using Linux?
Here’s another poll — and no, I’m not in this one — that is somewhat interesting brought to us by our friends at linuxquestions.org.
It’s a simple question: In what year did you start using Linux?
I’m always curious about when people started. I know many greybeards and gurus who were there at the start. It’s one of those perks that come with living close enough to the Silicon Valley to be able to drive a half-hour and be at the center of the digital universe, or so it seems sometimes.
I also know folks who just started as late as a month ago — they’re members of the Felton LUG who have happened upon Ubuntu and have just installed it to dual-boot for now, and hopefully later on they’ll drop Windows and keep using a FOSS-based operating system.
Development Release: Zentyal 3.1-2 (Beta)
José Antonio Calvo has announced the availability of the second and final beta version of the upcoming Zentyal 3.2 stable release, a full-featured Linux server distribution for small and medium businesses: “Zentyal 3.1-2 is a development version and will become Zentyal 3.2 (next stable release) in September 2013…..
Android App Development: Handling Extra Camera Capabilities
In previous tutorials we looked at writing code to access the onboard camera, preview the display, and save an image in an Android application. That’s the basics; but modern smartphones often have quite complicated cameras with a whole array of features – flash, white balance, a variety of scene modes, different Instagram-style photo effects, even face recognition (handled only in the most recent Android release and not covered in this tutorial). Check out the Camera.Parameters API docs for the full lowdown on the features you may be able to play with. The Camera.Parameters API also allows you to find out what
features are supported by the hardware your app happens to be running on. Once you know what parameters/features you have available, they’re all dealt with in a fairly similar way. Read on to find out how to handle them.
Handling Flash
Let’s start off by looking at the flash, which is probably the most-used camera feature. We’ll create a chooseFlash() method to set up the flash choice options:
private void chooseFlash() {
final Camera.Parameters params = camera.getParameters();
final List<String> flashModeList = params.getSupportedFlashModes();
if (flashModeList == null) {
// no flash!
return;
}
final CharSequence[] flashText = flashModeList.toArray(
new CharSequence[flashModeList.size()]);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Choose flash type");
builder.setSingleChoiceItems(flashText, -1,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
params.setFlashMode(flashModeList.get(which));
camera.setParameters(params);
dialog.dismiss();
}
});
final AlertDialog alert = builder.create();
alert.show();
}
Before doing anything else, we need to check whether there are any supported flash modes at all, with getSupportedFlashModes(). If the list is empty, there’s no flash, and we return without doing anything.
If there are flash modes, we want the user to pick one. Here, we use an AlertDialog to handle that, but you could use another option. We turn the list of flash modes (in string form) into a CharSequence array, to pass into AlertDialog.Builder, then use the Builder methods to set the title and to create a radio button choice (setSingleChoiceItems(); you can also create checkboxes, or use setItems() for a selectable list without radio buttons).
After the user selects their preferred flash mode, we use the dialog’s OnClickListener to identify the index of the selected item, and pull that item out of the String list flashModeList to set the parameter. Because we’ve translated flashModeList directly into the CharSequence array used in the AlertDialog builder, the index of the item chosen in the AlertDialog will be the same as the index of that item in flashModeList.
You must call camera.setParameters() after params.setFlashMode() to make the change actually take effect. We then finish the onClick() method by dismissing the dialog and returning to the main screen. Finally, having built the dialog, we create and show it.
Dynamic layouts
The next issue is how to show this to the user. We could just run it automatically on app startup, but that’s not particularly user-friendly. We could add some XML in the static layout, but then that would be shown even if the device doesn’t have a flash, which is a big waste of screen space and very user-unfriendly. Instead, we can use dynamic layout – layout which is managed depending on what happens in the program.
To do this, let’s add this code at the end of the chooseFlash() method, replacing the alert.show() line so that we only show the select flash type list if the button is clicked.
LinearLayout lin = (LinearLayout) findViewById(R.id.linearlayout);
Button flashButton = new Button(this);
flashButton.setText("Flash");
flashButton.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
lin.addView(flashButton);
flashButton.setOnClickListener(
new View.OnClickListener() {
public void onClick(View v) {
alert.show();
}
}
);
You’ll also need to add an ID value to the parent LinearLayout in your XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearlayout"
... >
The code grabs a reference to the parent LinearLayout, creates a ‘Flash’ button, and adds it to the layout, then shows the AlertDialog once the button is pressed. As you can see here, you can set the height and width of a button programmatically, using setLayoutParams(). (These are ViewGroup.LayoutParams.) A couple of constructors are available; this one takes width and height. (You can use one of the subclasses of LayoutParams to get more specific when constructing a layout.) All the other attributes of a button can also be set programmatically. You might, for example, want to set the button to show an image rather than text, using setBackgroundDrawable() instead of setText() (or use an ImageButton and setImageResource() instead).
Finally, we hook this into our setUpLayout() method:
private void setUpLayout() {
// ... as before
chooseFlash();
}
Compile and run on your hardware to test it out.
Scene setting
There are a bunch of other camera effects available in Android, although hardware availability of course varies with each handset. These include zoom, antibanding, scene mode, focus mode, and so on. Check out the Camera Parameter docs for a full list. They’re all set and handled in much the same way, though, so let’s have a quick look at another example, setting scene mode. Modes include Party, Portait, Landscape, Night, etc – see the getSceneMode() docs for more possibilities. The actual list available will vary with your camera type.
private void chooseSceneMode() {
final Camera.Parameters params = camera.getParameters();
final List<String> sceneModeList = params.getSupportedSceneModes();
if (sceneModeList == null) {
// no scene mode available!
return;
}
final CharSequence[] sceneModeText = sceneModeList.toArray(
new CharSequence[sceneModeList.size()]);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Choose scene mode");
builder.setSingleChoiceItems(sceneModeText, -1,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
params.setSceneMode(sceneModeList.get(which));
camera.setParameters(params);
dialog.dismiss();
}
});
final AlertDialog alert = builder.create();
LinearLayout lin = (LinearLayout) findViewById(R.id.linearlayout);
Button sceneModeButton = new Button(this);
sceneModeButton.setText("Scene Mode");
sceneModeButton.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
lin.addView(sceneModeButton);
sceneModeButton.setOnClickListener(
new View.OnClickListener() {
public void onClick(View v) {
alert.show();
}
}
);
}
As you can see, this is basically identical to chooseFlash(). (So much so, in fact, that it would be a good idea to factor it out into a chooseEffect() method and pass in the type of effect you are setting as a parameter. Try that out as a useful exercise and see what other effects you can plug into it.)
You’d probably also want to look at improving the layout, which is currently not visually appealing, and would get less so with more buttons and effects added. You might, for example, want to have a sliding menu, or arrange the buttons in a row. In future tutorials, we’ll look in more detail at both static and dynamic layouts, and at menus and options which appear only in certain circumstances or when requested by the user.
Open Odroid SBC Steps Up to Samsung Exynos Octa
Hardkernel and its community Odroid project opened $149 pre-orders on an updated version of the open platform Odroid single board computer, featuring Samsung’s eight-core Exynos 5410 Octa SoC. The Odroid-XU runs Android, Ubuntu, and other Linux OSes, and offers features including an eMMC socket, two USB 3.0 and four USB 2.0 ports, HDMI video, 100Mbit […]
Candy Chang’s Lessons on Community and Collaboration Through Collective Art
The word ‘community’ has many definitions, especially in the world of open source software and Linux. Urban planner, artist and TED fellow Candy Chang has her own understanding of community, cultivated through collective art projects in her hometown of New Orleans. Her “Before I Die” project, for example, transformed an abandoned house in her neighborhood into an interactive wall for people to share their hopes and dreams — a project The Atlantic called “one of the most creative community projects ever.”
Chang will share her insights on community and collaboration in her keynote at LinuxCon North America in New Orleans, Sept. 16-18, 2013. Here she gives us a sneak peek at the talk.
Can you tell us what you’ve learned about community since creating the “Before I Die” project?
Candy Chang: Anonymity can nurture community. It can free us to be completely honest and vulnerable before we’ve developed understanding and trust. And that honesty and vulnerability can lead to understanding and trust. The last time I made a wall with students, one of the responses was, “Before I die I want to overcome depression.” It really touched me. I went though a period of depression. We all talked about it and began removing our guards. We’re all trying to make sense of our lives and there’s great comfort in knowing you’re not alone.
From your experience, what motivates people to come together in collaboration to advance a collective mission? Why is that important?
Chang: Belief in the bigger mission. Then you’re passionate enough to overcome the obstacles along the way. You’re full of hope and curiosity and reminded of what you’re working towards. Fear is a strong motivator too, but that’s much less fun.
How do you think your work and art can apply to the open source software and Linux communities?
Chang: Since its earliest days, the internet was considered a kind of public space, and Lee Felsenstein envisioned it as an “information commons.” Linux is a great example of the possibilities. I’ve experimented to see if our physical public spaces can continue to advance and become an information commons as well. There are benefits and limitations to both analog and digital tools. The contexts are different, but there’s a lot we can learn from one another.
Can you give a sneak snapshot of what we might get to see from you in New Orleans in September?
Chang: You’ll see a sincere and personal talk from me about public space and community, the aftermath of some of my projects, how I think it applies to Linux, how I got here, what I learned along the way, and some questions currently on my mind. I’ve been reading a lot of philosophy and psychology. Carl Jung may show up in the mix. And it will be full of pictures. Lots of pretty pictures.
Editor’s note: Don’t miss Candy Chang’s keynote at LinuxCon. Register now!