Auto- matisierung mit Android und Locale

By , November 8, 2012 5:51 pm

Ich benutze mein Android-Tablet unter anderem auch als Navi im Auto. Aus Bequemlichkeitsgründen wollte ich, dass sofort automatisch meine OBD2-App gestartet wird, sobald ich das Auto betrete und ebenso automatisch beendet, wenn ich es wieder verlasse. Das Gleiche funktioniert prinzipiell auch mit jeder anderen App, z.B. der Navi-Software wie Sygic, Navigon TomTom oder GoPal Navigator. Lediglich die Befehle müssen angepasst werden.

Vielen Dank an Ian Hawkins, dem Autoren von Torque für seine Unterstützung.

Was brauche ich ?

  • Ein Android-Smartphone oder Tablet mit Bluetooth
  • Ein Bluetooth-Device im Auto, z.B. Freisprecheinrichtung oder OBD2-Adapter
  • Eine beliebige App, die gestartet werden soll
  • Die Locale-App oder Tasker (kostenpflichtig)
  • Locale BlueTooth-Plugin
  • Die App “Manual Intent Shortcuts” Continue reading 'Auto- matisierung mit Android und Locale'»
GD Star Rating
loading...

Emptying SharePoint-List the (quite) fast way

By , August 10, 2012 7:30 am

I already offered a solution to empty a SharePoint list at light speed

But this solution hast two big disadvantages:

  1. You cannot empty a list that has more entries thatn the allowed list view threshold (default is 5000)
  2. All Lookups will be lost

This solution has non of those drawbacks. It is much slower than that solution but also much faster than “normal” deletion of SPListItems or using a Caml-Query to do that.

Just be asure that this is not thread-safe. So make sure noone is writing into that list in the same time or that lines might not be deleted.

[c]
private int _rest;
public static void TruncateList(Guid listId, int limit)</pre>
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite site = new SPSite(SPContext.Current.Site.ID))
{
using (SPWeb web = SPContext.Current.Web)
{
try
{
_rest = limit;
web.AllowUnsafeUpdates = true;
SPList listCopy = web.Lists[listId];

ContentIterator iterator = new ContentIterator();
iterator.ProcessListItems(listCopy, ProcessItem, ProcessError);

web.Update();
web.AllowUnsafeUpdates = false;
}
catch (Exception ex)
{
if (!ex.Message.Contains("Limit reached"))
{
Debug.WriteLine(ex);
}

}
}
}
}
);
}

public static bool ProcessError(SPListItem item, Exception ex)
{
if (!ex.Message.Contains("Limit reached"))
{
Debug.WriteLine(ex);
}

return true;
}

public static void ProcessItem(SPListItem item)
{
if (_rest<=0)
{
Debug.WriteLine("Limit reached");
throw new Exception("Limit reached");
return;
}
item.Delete();
_rest–;

}
<pre>
[/c]

GD Star Rating
loading...

Emptying SharePoint lists the ultra fast way

By , August 9, 2012 8:23 am

SharePoint is damn slow when deleting lines from lists. Each entry can take up to some seconds which isn’t nice when you have to delete thousands of lines.

Also no Trunc-Methode is available.

Other solutions found on the net creating xml-files to bulk delete aren’t very fast either.

That’s why I decided to write my own fast truncate-method for SharePoint-Lists.

All content of that list will be deleted. Use at your own risk!

What it does:

First a template of that list is being created. After that the list is deleted completely. Than a new list using that template is being created and at the end that template is being deleted.

Works damn fast (just a few seconds even on big lists). IF anything goes wrong you can use the template to create a list manually.

[c]

public void TruncateList(Guid listID)
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite site = new SPSite(SPContext.Current.Site.ID))
{
using (SPWeb web = SPContext.Current.Web)
{
try
{
web.AllowUnsafeUpdates = true;
// alte Werte merken
SPList listCopy = web.Lists[listID];
string title = listCopy.Title;
string description = listCopy.Description;

string backupName = string.Format("BACKUP_{0}_{1:d} {1:HH}{1:mm}", title,DateTime.Now);

// als Template speichern:
listCopy.SaveAsTemplate(backupName, backupName, string.Empty, false);
SPListTemplate template = web.Site.GetCustomListTemplates(web)[backupName];

// Liste löschen:
listCopy.Delete();
web.Lists.Add(title, description, template);

// Template wieder entfernen:
SPList gallery = web.Lists["List Template Gallery"];
foreach (SPListItem item in gallery.Items.Cast<SPListItem>().Where(item => item.Title == backupName))
{
item.Delete();
break;
}

web.Update();
web.AllowUnsafeUpdates = false;
}
catch (Exception ex)
{
_log.Error(ex);
throw;
}
}
}
}
);
}[/c]

GD Star Rating
loading...

Play MadTV on your android tablet

By , August 7, 2012 9:04 pm

MadTV inGame on Android

DOS-Emulatoren exist since a while for android and they’re quite stable. What has always been important for me: When I want to play I want to play. No shell to be seen, please. It’s ok to see some technical details while installing a game, but not after that.

As an example I will describe here how to achieve that with MadTV, a popular DOS classic.

First you have to choose your DOS emulator. I took DosBox Turbo, which is *not* for free. But you are free to use any other emulator as they all work nearly the same. You can find this app on Google Play: DOSBox Turbo

If you decide to use DosBox Turbo you might want to install the (free) DosBox Manager as well. This is a nice launcher, helpfull, if you decide to run multiple DOS games: DOSBox Manager

Continue reading 'Play MadTV on your android tablet'»

GD Star Rating
loading...

MadTV auf dem Android-Tablet spielen

By , August 7, 2012 8:45 pm

MadTV inGame on Android

DOS-Emulatoren gibt es schon eine ganze Weile für Android, mittlerweile sind sie auch ziemlich stabil. Was für mich (auch bei Emulatoren) immer wichtig ist: Beim Spielen soll nichts nach einer Kommandozeile o.ä. aussehen. Zur Installation geht das noch in Ordnung, danach aber soll von der Maschine dahinter nichts mehr zu sehen sein.

Ich habe exemplarisch MadTV auf meinem Android-Tablet installiert, weil es hervorragend funktioniert und einfach Spaß macht.

Als erstes hat man die Qual der Wahl des richtigen DOS-Emulators. Ich habe mich für DosBox Turbo entschlossen, welches leider nicht kostenlos ist. Das Prinzip funktioniert aber auf allen DOS-Emulatoren gleich. Diesen (oder die anderen) Emulator findet man im Play Store: DOSBox Turbo

Wer DosBox Turbo verwenden möchte, sollte ggf.  auch den (kostenlosen) DosBox Manager installieren, ein Launcher, falls mehrere DOS-Titel gestartet werden sollen. DOSBox Manager

Continue reading 'MadTV auf dem Android-Tablet spielen'»

GD Star Rating
loading...

Panorama Theme by Themocracy