Here’s a short story about how Hootsuite modernized its URL shortener with Scala, the Play Framework, and Akka, and cut its number of required servers by 80%, while gaining an order of magnitude in load-handling ability.
If you’re working with an Android application, this source code seems to work to load an image from a file:
Bitmap bitmap = BitmapFactory.decodeFile(pathToPicture);
BitmapFactory classes are located in the android.graphics package:
import android.graphics.Bitmap; import android.graphics.BitmapFactory;
Assuming that your
pathToPicture is correct, you can then add this bitmap image to an
ImageView like this:
I can tell you from my own recent experience that if you don’t use the Sencha ExtJS Store load method properly, nothing will happen. After torturing myself twice by mishandling the load method, I thought maybe it would help if I wrote a quick blog post about how to properly use the load method.
The following links are a collection of Scala XML tutorials I've written. Most of them come from the Scala Cookbook, while the others were written before I wrote the Cookbook.
Without any further ado, here are the links:
Scala FAQ: How do I load an XML file in Scala? (How do I open and read an XML file in Scala?)
I demonstrated this in my earlier Scala XML - Searching XMLNS namespaces, XPath tutorial, but you can load an XML file in Scala like this:
I haven't used Android in a little while now, in particular with my new laptop, and the first time I tried running an Android app from inside Eclipse, the Android emulator wouldn't finish starting properly and run my app.
I remember I used to look under the "all apps" icon, and could sometimes find my app was actually loaded, but in this case, it wasn't loaded at all.
In an earlier Java Properties file example I showed how to load a Java Properties file and then access the elements in the Properties object, but for today, if you just need a method to read a Java Properties file, I hope the following source code will be helpful to you:
Here's the source code for a standalone Java application where I load a Spring application context file with the ClassPathXmlApplicationContext method. In other blogs I've shown how to load the application context for web applications, but I also wanted to show how to do this for a standalone program.
Here's a source code for my Java program that loads a Spring application context file from the typical
Here's an example
web.xml configuration file where I show how to configure the Spring Framework to properly load for a Java web application. I'm intentionally trying to keep this Spring example simple, so my
web.xml file has almost the bare minimum configuration.
I show how to load the Spring
ContextLoaderListener class with the
listener-class tag, and also show how to load multiple Spring application context files using the
param-value XML tags.
Spring application context FAQ: Can you provide an example of using a Spring application context file in a standalone Java application?