AppInventor: HOW TO: Turn your AI2 app into a Voice Activated App (Google Now)

Leading on from my initial enquiry here:

Using Google Now on your Android phone you can start several “Google” apps with voice commands.
It is possible to convert your AI2 app for the same thing. For the purposes of this howto:
The apk filename is  MyVoiceApp.apk
The appname is “My Voice App”   << what you see in the App Name on Screen 1 Designer
1. What you will need:
  • A PC
  • apktool (Windows/Linux) or AppToMarket (Windows)
  • Your apk file
2. Decode your apk using your preferred decoder/encoder
3. Browse to the res folder in the decoded apk and create a new folder called xml
 
4. Browse into the xml folder you have just created and create a new text file called searchable.xml
 
5. Open up searchable.xml and copy and paste this into it:

 

whilst replacing “My Voice App” with the appname of your app

Save searchable.xml.
6. In the root folder of your expanded apk, find the file “AndroidManifest.xml” and open it with your preferred text editor.
It may look something like this:  (the apkfilename and the appname should be correct in this file and match that of your apk)

 

7. You now need to add a new intent filter section and some configuration lines. Do this just above the <intent-filter> line

This is what you should add:
           

 

and your resultant AndroidManifest.xml file should then look like this:

 

Once this is done, save AndroidManifest.xml, and your work on editing the apk is done!

8. Now re-encode your apk using your preferred encoder/decoder, deal with the signing and zip aligning of apk as needed.
Sideload you new apk onto your device
Get Google Now running and ask it to: “run ‘My Voice App'” or “start ‘My Voice App'”  (both seem to work for different things???)
Your app should open up from closed or in the background.
If you need help with how to use apktool, just ask.
Tim
Credits due to the original poster on techrepublic here

Incron gotchas

Of which there are three:

  1. Make life simple and do all your incron as root. I know you shouldn’t but it helps to avoid all sorts of permissions issues. You may need to create an allow file “/etc/incron.allow” and put either root or your sudo name in it.
  2. Ensure that you only have one “SPACE” (not a TAB) between the three elements on an incron job: e.g.

    /etc/samba/smb.conf IN_MODIFY /etc/init.d/samba restart

  3. incron, like cron, requires full paths for just about everything, so if you are calling a script, use the full path to it, and use the full path to all programs inside the script.

Google Sites (Classic) – Embed Live (working) Google Sheet “Range”

This one has been annoying me for a while but I finally arrived at a solution. It is especially usefeul when working inside a G Suite domain, and you wish to share information on a spreadsheet with some selectable cells (e.g. with drop downs) via a classic googlesites page, so for people with the right permissions they can use the functionality of the sheet without causing damage to the underlying data.

The default options and gadgets for presenting a spreadsheet offer too much of the sheet for my liking.

The way to sort this out is to create a web App that can be displayed on the page. The apps script is created on the website (Manage Site > Apps Script), and once the two parts are created inside a project, the app can be deployed and will then show up when added to you page.

So here is what you need to put in your code.gs Continue reading

Digital Slideshow and Clock – Conky / Lua

conkyluaimg1

It is a disgrace really! I have has this running on an ancient laptop for over three years non stop, and not written it up, even failed to write it up on #! Crunchbang forums, where I got all the help from mrpeachy, Sector11, dk75 and others. Time to put that to rights. What is different about this “one”, you ask? Well, we have two conkys running, they are both in the background, so you still have a fully functional PC if you want to use it, you get sexy rounded corners on your image and a nice big digital purple clock.
Continue reading

Thunar Custom Action – Add Filepath to Clipboard

This should be fairly straight-forward, but it isn’t.

We are going to use xclip as this takes the bash output and makes it available for X applications

There are also two variants depending upon which clipboard (there are 3!) you want

For the SECONDARY clipboard (the one that works with CTRL+C/CTRL+V or Right-Click and Paste)
enter the following in the command box for your custom action:

echo -n %f | xclip -selection c

For the PRIMARY clipboard (the one that only works if you Middle-Click your mouse)
enter the following in the command box for your custom action:

echo -n %f | xclip -i

Virtualbox Fullscreen Greyed

Every now and then I have a problem after installing a new OS in virtualbox. All goes well until I head for fullscreen (RCTL+F)

It goes fullscreen, it works but the screen is greyed over, to @ half the brightness. Others have reported a black screen.

Solution:

Go in to the Settings > User Interface section of your VM from the Virtualbox main screen

Untick Mini Toolbar and Save

Fullscreen should now work :)

W7 to W10 – virtually ;)

Note: Valid at 01/08/2015

When I first got my new desktop machine a couple of years ago, I was a little wary of Windows 8, so I did a dual install of Windows 7 Pro (OEM) as well. Given Xubuntu is my weapon of choice, I had a triple booting machine in the end. Once I sorted Windows 8 out I never went near my Windows 7 install. With the arrival of Windows 10 a few days ago, and with the offer of a free upgrade from Windows 7, it didn’t make much sense to have two installs of the same OS running directly, I therefore looked into virtualising my Windows 7, to then upgrade it to Windows 10, which I could then access directly from within Xubuntu, should I need it. Continue reading