[Q] Complicated Calendar Code Help - Zooper Widget General

Hi, I am attempting to make my calendar events not show the start time in the code below. Ordinarily, I could do this with $#C0D#=1?:[insert start time]$. However, with this string of code which tells my widget to show today, tomorrow, day of the week, or date after one week out, I cannot seem to figure out how to get the COD code to show up correctly. It ends up showing today, tomorrow, and the week day. Any help would be much appreciated!
[c=#C0COLOR#]$#C0SddMM#=?No appointments$$#C0SddMM#=#DddMM#?Today at #C0Sh\:mm# [tl]#C0Sp#[/tl] -$$ #C0SddMM#=#W1DddMM#?Tomorrow at #C0Sh\:mm# [tl]#C0Sp#[/tl] -$$[#C0SddMM#!=#W1DddMM#] && [#C0SddMM#!=#DddMM#] && [#C0STd#<6]?#C0SEEEE# at #C0Sh\:mm# [tl]#C0Sp#[/tl] -$$[#C0SddMM#!=#W1DddMM#] && [#C0SddMM#!=#DddMM#] && [#C0STd#>=6]? #C0SEEE#, #C0SMMM# [no]#C0Sd#[/no] at #C0Sh\:mm#$ #C0TITLE#[/c]

I think you're trying to hide the "at h:mm am/pm" for all day events, is this correct?
You can do that by rearranging your conditionals do the today/tomorrow/wednesday stuff first, then test C0D to say whether to include the "at .."
$C0day = today?Today$$C0day = tomorrow?Tomorrow$$C0day>tomorrow && c0day < 6 days ?c0day$...
$#C0D#=1?: at #C0Sh\:mm# [tl]#C0Sp#[/tl]$
- #C0TITLE

Works!
ewcrider said:
I think you're trying to hide the "at h:mm am/pm" for all day events, is this correct?
You can do that by rearranging your conditionals do the today/tomorrow/wednesday stuff first, then test C0D to say whether to include the "at .."
$C0day = today?Today$$C0day = tomorrow?Tomorrow$$C0day>tomorrow && c0day < 6 days ?c0day$...
$#C0D#=1?: at #C0Sh\:mm# [tl]#C0Sp#[/tl]$
- #C0TITLE
Click to expand...
Click to collapse
Hi, I played around with it based on your answer and figured it out. It took me a couple of go arounds to figure out what you meant. I think I was thinking too hard to realize how simple it actually was!! Thanks for your help!
[c=#C0COLOR#]$#C0SddMM#=?No appointments$$#C0SddMM#=#DddMM#?Today$$#C0SddMM#=#W1DddMM#?Tomorrow$$[#C0SddMM#!=#W1DddMM#] && [#C0SddMM#!=#DddMM#] && [#C0STd#<6]?#C0SEEEE#$$[#C0SddMM#!=#W1DddMM#] && [#C0SddMM#!=#DddMM#] && [#C0STd#>=6]? #C0SEEE#, #C0SMMM# [no]#C0Sd#[/no]$$#C0D#=1?: at #C0Sh\:mm#$ - #C0TITLE#[/c]

Related

[Solved] Help starting B&N standard Reader from Android Launcher

Hi, I am trying to start B&N Reader app from ADW (or any other launcher...).
I found the 'am' command that should be able to send an intent to an app but, being an absolute beginner with Android coding and its inner working I am not able to use it as I want.
What I am doing is:
Code:
# am start -a android.intent.action.VIEW -n com.bn.nook.reader.activities/.ReaderActivity
but, while it doesn't give any error, it doesn't do anything ...
As I told before, I am an absolute beginner with this stuff, so I could have totally misunderstood everything.
Any hints?
If you look into the AndroidManifest.xml the answer is simple enough
Code:
am start -a android.intent.action.VIEW -d file:///media/Digital\ Editions/George_R_R_Martin_-_A_Dance_Wit.epub -t application/epub -n com.bn.nook.reader.activities/.ReaderActivity
ros87 said:
If you look into the AndroidManifest.xml the answer is simple enough
Code:
am start -a android.intent.action.VIEW -d file:///media/Digital\ Editions/George_R_R_Martin_-_A_Dance_Wit.epub -t application/epub -n com.bn.nook.reader.activities/.ReaderActivity
Click to expand...
Click to collapse
If you know how to read it, yes It was the second/third AndroidManifest I look at...
Any hope to launch it without an explicit book and make it open the last one, as it does when you tap on the "reading now "icon in the status bar?
...lol. I'm spending so much time just with the hacking that I haven't gotten around to reading ADWD
met67 said:
Any hope to launch it without an explicit book and make it open the last one, as it does when you tap on the "reading now "icon in the status bar?
Click to expand...
Click to collapse
No, not directly in Reader, but you can do it like this:
Code:
am broadcast -a com.bn.nook.launch.LAST_BOOK -n com.bn.nook.home/.HomeBroadcastReceiver
ros87 said:
No, not directly in Reader, but you can do it like this:
Code:
am broadcast -a com.bn.nook.launch.LAST_BOOK -n com.bn.nook.home/.HomeBroadcastReceiver
Click to expand...
Click to collapse
NICE! It works, thank you so much!
Now, any suggestion for a GScript alternative to launch this command with less flickering?
met67 said:
NICE! It works, thank you so much!
Now, any suggestion for a GScript alternative to launch this command with less flickering?
Click to expand...
Click to collapse
Why GScript? What are you trying to do?
met67 said:
Hi, I am trying to start B&N Reader app from ADW (or any other launcher...).
I found the 'am' command that should be able to send an intent to an app but, being an absolute beginner with Android coding and its inner working I am not able to use it as I want.
What I am doing is:
Code:
# am start -a android.intent.action.VIEW -n com.bn.nook.reader.activities/.ReaderActivity
but, while it doesn't give any error, it doesn't do anything ...
As I told before, I am an absolute beginner with this stuff, so I could have totally misunderstood everything.
Any hints?
Click to expand...
Click to collapse
I can build you an app that will send broadcast.
Sent from my SAMSUNG-SGH-I777 using xda premium
ros87 said:
Why GScript? What are you trying to do?
Click to expand...
Click to collapse
I want a button/widget/big icon in adw home that launches the last book, Ala the Reading Now box in B&N home.
I found Manual Intent Shortcuts, will try it tomorrow ...
XorZone said:
I can build you an app that will send broadcast.
Sent from my SAMSUNG-SGH-I777 using xda premium
Click to expand...
Click to collapse
Thank you for your offer, but Manual Intent Shortcuts works just fine
Actually I'm trying to out together a poor man's implementation of your dedicated launcher
met67 said:
Thank you for your offer, but Manual Intent Shortcuts works just fine
Actually I'm trying to out together a poor man's implementation of your dedicated launcher
Click to expand...
Click to collapse
Oh well, I had already written the app (shortcut)
http://www.multiupload.com/I2SW3LSI4B
Feel free to use it as you want.
---------- Post added at 10:52 PM ---------- Previous post was at 10:07 PM ----------
Also forgot the source:
Code:
package com.bitloom.nst.readingnow;
import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
public class ReadingNowActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent broadcastIntent = new Intent();
broadcastIntent.setAction("com.bn.nook.launch.LAST_BOOK");
sendBroadcast(broadcastIntent);
finish();
}
}

[Q] Colouring a progress bar (many conditions)

Hi. I have the following working code to colour a progress bar:
Code:
[cf]$#BLEVN#<20?ffec1818$$#BLEVN#>=20 && #BLEVN#<50?ffdfec1c$$#BLEVN#>=50?ff36e057$[/cf]
And I am trying to add another condition (priority):
Code:
#BSTATN#=2:ff50e4ff
But I can't put an if inside of another, I've tried many ways (apparently all wrong).
Would you give me a hand?
The objective is: colour if charging. if not charging, colour according to the bat level.
teteu86 said:
Hi. I have the following working code to colour a progress bar:
Code:
[cf]$#BLEVN#<20?ffec1818$$#BLEVN#>=20 && #BLEVN#<50?ffdfec1c$$#BLEVN#>=50?ff36e057$[/cf]
And I am trying to add another condition (priority):
Code:
#BSTATN#=2:ff50e4ff
But I can't put an if inside of another, I've tried many ways (apparently all wrong).
Would you give me a hand?
The objective is: colour if charging. if not charging, colour according to the bat level.
Click to expand...
Click to collapse
I did something similar for another user here. That was about text display but the general idea on how to combine two different conditions is the same. You should be able to adapt the code posted in the linked post to your situation without much of a problem
kwerdenker said:
I did something similar for another user here. That was about text display but the general idea on how to combine two different conditions is the same. You should be able to adapt the code posted in the linked post to your situation without much of a problem
Click to expand...
Click to collapse
Thank you. I leave the code in the case someone searches for it.
Code:
[cf]$#BSTATN#=2?ff50e4ff$$#BLEVN#<20 && #BSTATN#!=2?ffec1818$$#BLEVN#>=20 && #BLEVN#<50 && #BSTATN#!=2?ffdfec1c$$#BLEVN#>=50 && #BSTATN#!=2?ff36e057$[/cf]

[Q] Dewpoint

I am trying to figure out how to calculate dewpoint from temperature and humidity. The formula is ridiculously long, but there is a simple formula that gives an approximation, which is good enough for my purposes.
Td = T - ((100 - RH)/5).
Td = Dewpoint in degrees Celcius
T = Temperature in degrees Celcius
RH = Humidity
Since my phone is in degrees F. I had to convert to degrees C. This is what I did, but it doesn't work, I think because of the % symbol attached to the humidity variable: $int((#WCTEMP#-32)*5/9))-(100-#WCHUM#)/5)$. The problem is, it just displays exactly what I typed, it doesn't do the math. Can anyone point a noob in the right direction? It is probably obvious, but I am still trying to figure out zooper.
I have seen other requests for a dewpoint variable on the forums, so there is a demand out there. Any help would be appreciated, thanks!
Do you own Tasker?
You could do an https get on yahoo weather api and get all the info from there.
Its not to terribly difficult. Probably on the intermediate level.
Sent from my Nexus 5 using Tapatalk
I was just considering purchasing that tonight. I will give that a shot! Thanks Mr Biggzz
MrBiggzz said:
Do you own Tasker?
You could do an https get on yahoo weather api and get all the info from there.
Its not to terribly difficult. Probably on the intermediate level.
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
Its a great app!
Sent from my Nexus 5 using Tapatalk
@robgross how are you making out?
MrBiggzz said:
@robgross how are you making out?
Click to expand...
Click to collapse
I downloaded Tasker but haven't had time to learn it yet...but I will! I do know that ZW sees #WCHUM# as text, so it will not formulate it. I tried using #WCHUMN# to see if it would dispay the value as a number, as #WCTEMPN# does...but that didnt work. Thanks for following up!
Christmas in May!
Dave Handler shares a file with you, please click the link to download: http://dl.dropboxusercontent.com/1/view/qqiv1skjchq7ifu/Tasker Projects/Yahoo_Weather.prj.xml
In it are two tasks Input Zip code which uses a scene to well, get the zip!
The other task is Get Yahoo Weather. That uses a variable that gets set when you set the zip code.
Set your zip and the run the weather task and then check the variables tabs. You'll see every thing that is supplied including the five day forecast.
You'll have to figure what you want and pass it on to Zooper. Every variable for weather is global!
Enjoy!
p.s. everything is in standard units. Fahrenheit, mph and inches. This only thing I didn't do is give you an indicator if the barometric pressure is falling, stable or rising. If you need it I can put it in there!
Sent from my Nexus 5 using Tapatalk
Mr. Biggs, thanks for this, but I can't seem to open this link, it says it's not valid both in Tasker and a browser.
MrBiggzz said:
@robgross how are you making out?
Click to expand...
Click to collapse
MrBiggzz, I figured out how to use Tasker! It's a lot easier to use than I thought, and the possibilities are endless. Thanks for the tip!
I know its an old thread and i was seaching in this thread too; and now i solved by myself. I post here the solution for tasker if someone needs it:
You need to set up or read out from web 2 variables (%temp = temperature and %hum = humidity), once you have set the 2 variables you need to add a code java scriplet to the task to calculate dewpoint and absolute humidity:
function taupunkt() {
if ( (temp == null || temp == 0) ||
(hum == null || hum == 0) ) {
return;
}
var a1=7.45;
var b1=235;
tp=temp;
fw=hum;
tp=tp*1;
fw=fw*1;
x1=(a1*tp)/(b1+tp);
e1=6.1*Math.exp(x1*2.3025851);
e2=e1*fw/100;
x2=e2/6.1;
x3=0.434292289*Math.log(x2);
taux=(235*x3)/(7.45-x3)*100;
taux=Math.floor(taux)/100;
feux=(216.7*e2)/(273.15+tp)*100;
feux=Math.round(feux)/100;
var TAUX = taux;
setGlobal("TAUX", TAUX );
var FEUX = feux;
setGlobal("FEUX", FEUX );
exit ();
}
taupunkt()
The java scriplet calculate the dewpoint and the absolute humdity and stores it in the variable %TAUX (dewpoint) and %FEUX (absolute humidity). Now you can make a popup alert or whatever you want and display the dewpoint calling %TAUX and the absolute humidity %FEUX

[Q] Random Bitmap display In Widget

I have a widget with a few items in it. 1 is a bitmap.
What I would like to do is know if I can randomly show a different one, based on a set timeframe (or even time of day)
I have see the following in advanced parameters, however, it does not seem to change the bitmap... so I'm not sure what to do...
Maybe if you can explain some of the params in it, it would help:
Code:
[ b ]/sdcard/walls/$#Dm#>0?(int((random())*10))$.jpg[ /b ]
I get the math part of it... but I guess what I'm wondering is, what is #Dm#, and what is ? mean...
Does it mean, that every 1 minute, the next random .jpg in the series will show?
kevp75 said:
I have a widget with a few items in it. 1 is a bitmap.
What I would like to do is know if I can randomly show a different one, based on a set timeframe (or even time of day)
I have see the following in advanced parameters, however, it does not seem to change the bitmap... so I'm not sure what to do...
Maybe if you can explain some of the params in it, it would help:
Code:
[ b ]/sdcard/walls/$#Dm#>0?(int((random())*10))$.jpg[ /b ]
I get the math part of it... but I guess what I'm wondering is, what is #Dm#, and what is ? mean...
Does it mean, that every 1 minute, the next random .jpg in the series will show?
Click to expand...
Click to collapse
I have changed the code to be:
Code:
[ b ]/sdcard/walls/$#Dm#%30>0?(int((random())*10))$.jpg[ /b ]
and have verified that there are 1 - 10.jpg's in the location specified, but everytime I unlock the screen the image changes... and a popup happens... stating "No wallpapers added"
I think I can figure out the "No wallpapers" part, but why does the image change on every unlock? I can't sit and watch my screen for an hour to verify that they change every 30 minutes... but I assume that they would...

Humidity

Hello, I am new at using Zooper, but am wanting to create a conditional formula that basically would be something like this...
If Humidity > 50% < 70 % = "Comfortable", > 70% = "Sweltering"
Is this even possible to do with Zooper and if so, how.....please help
Zooper doesn't allow nested conditionals, but you don't have anything for a humidity value under 50% so it shouldn't matter.
$#WCHUMN#<70?Comfortable:Sweltering$
$#WCHUMN#<70?Comfortable:Sweltering$ Outside Today
That worked great but what i am trying to accomplish is this...
What I want to do is something like if humidity between 0 and 25 "Beautiful" between 26 and 50 "Comfortable" between 51 and 75 "Uncomfortable" else "Sweltering"
It's kicking my butt trying to figure out the required formula....Please help if you can....
Not sure if that's possible, unfortunately
Changed it to this and seems to work fine........
$[#WCHUMN#>=0] && [#WCHUMN#<25]?Beautiful out today$
$[#WCHUMN#>=26] && [#WCHUMN#<50]?Comfortable out today$
$[#WCHUMN#>=51] && [#WCHUMN#<75]?Uncomfortable out today$
$[#WCHUMN#>76] && [#WCHUMN#<100]?Sweltering out today$

Categories

Resources