ATTN: ADMiN and other htm editors / users ; ADD CLOCK.HTML to web page! - General Topics

Hello all,
Here's a nice code to add a live clock into a web page;
Code:
<!-- The following file is an HTML Wallpaper for use with Microsoft -->
<!-- Internet Explorer 4.0. -->
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Notepad++v5.6.8">
<meta name="Clock http://forum.xda-developers.com" content="With courtesy of German magazine PC-WELT http://www.pcwelt.de"
<title></title>
</head>
<body scroll="no"
style="background: rgb(255, 255, 204); margin: 0; font: 8pt Verdana">
<div id=Clock align=center style="font-family:
Verdana; font-size: 60; color:#000000"> </div>
<script>
function tick() {
var hours, minutes, seconds;
var intHours, intMinutes, intSeconds;
var today;
today = new Date();
intHours = today.getHours(); intMinutes = today.getMinutes();
intSeconds = today.getSeconds(); hours=intHours+":";
if (intMinutes < 10) {minutes = "0"+intMinutes+":";}
else {minutes = intMinutes+":";}
if (intSeconds < 10) {seconds = "0"+intSeconds+" ";}
else {seconds = intSeconds+" ";}
timeString = hours+minutes+seconds+"Hour"; Clock.innerHTML = timeString;
window.setTimeout("tick();", 100);}
window.onload = tick;
</script>
</body>
</html>
Copy and paste the above code into Notepad and save it as makeUPaName.html then double click the file to see what'll happen
IMHO It would be nice to have a little clock in the upper bar
Senax

Related

Help for run program exe when rotate with script, manila control, m2d

Hello,
I need your help smile.gif
I explain
With this script ( mortscript ):
Code:
flag = Question ( "Do you want to launch TouchFLO?", "Startup", "YesNo" )
if ( flag = 0 )
RotAngle = -1
endif
While (RotAngle > -1)
RotAngle = RegRead ("HKLM", "\system\GDI\Rotation", "Angle" )
if ( RotAngle <> PrevAngle )
if ( RotAngle > 0 )
flag = ProcExists ("Manila2d.exe")
if ( flag eq TRUE )
Kill ("Manila2d.exe")
endif
Sleep (10)
else
mywindow = ActiveWindow ()
if ( mywindow eq "Desktop" )
if ( ProcExists ("Manila2d.exe") ne TRUE )
Run "\windows\Manila2d.exe"
endif
Sleep (20)
endif
endif
else
if ( RotAngle = 0 )
mywindow = ActiveWindow ()
if ( mywindow eq "Desktop" )
if ( ProcExists ("Manila2d.exe") ne TRUE )
Run "\windows\Manila2d.exe"
endif
Sleep (20)
endif
endif
endif
PrevAngle = RotAngle
Sleep (10)
endwhile
When i rotate my screen, TouchFlo Disable
But
I want when rotate my screen, TouchFlo Reduce
I can do it with Manila Control ( MastSogo_MC_WWE ) and the M2D_Ctrl file's !
Can you help me please ?

Hold a button to start a program

Hello, i want to custom the HTC'Button
I don't know how to do that, but i know it's in Base register
For ComManager i know it's
Code:
HKLM\Microsoft\Shell\Keys\40C6
default = \Window\CommManagerLink.exe (pour l'exemple) (String Value)
Flags = 0 (DWORD Value)
Icon = \windows\SendKeyIcon.exe, 0 (String Value)
Name = Send key(Hold) (String Value)
And it work
and now i want to start TaskManager with the windows button...
Please help me! Sorry about my English
Just use AE Button Plus.
The easiest and the best.

[Q]First application

Hi guys, i want to do a very simple app for WP7.
It's my first app, so i'm very noob
I put a butto, and i want that when i click on it, it opens a picture.
How i can do that?
There is a guide for noob like me?
you might probably wanna check the guide from Microsoft student..
Please try this out an see if it works. This is using a default empty silverlight project.
In the designer (MainPage.xaml), add a button and an Image element using the XAML:
<Button Name="testButton" Width="140" Height="100" VerticalAlignment="Top" Click="testButton_Click">Open</Button>
<Image Name="imageElement" Width="300" Height="300"></Image>
This should be added inside the Grid Element named "ContentPanel"
Next add the image to your project by right clicking your project in the solution explorer and selecting:
Add -> Existing Item -> And add an image called "test-image.png"
Click on the added image, in the Properties box, set Build Action -> Copy Always
In the code-behind file (MainPage.xaml.cs), add the reference to the library BitmapImage by adding "using System.Windows.Media.Imaging;" to the top of the file.
Add a click event handler for the button using the code:
private void testButton_Click(object sender, RoutedEventArgs e)
{
Uri imageUri = new Uri("/[ProjectName];component/test-image.png", UriKind.Relative);
BitmapImage testImageBitmap = new BitmapImage(imageUri);
this.imageElement.Source = testImageBitmap;
}
But make sure to replace [ProjectName] with the name of your windows phone project.

[Q] Simple translate animation, not working on Android 4.4.2

The following code, is a simple example of programmatically "WITHOUT XML" translate animation, that works perfect on all versión bellow Android 4.4.2, but does nothing on Android 4.4.2. It's really making me crazy!
Any ideas why?
Tested and working OK on: EMULATOR AVD with 4.1.2 (API 16), EMULATOR AVD with 4.2.2 (API 17), EMULATOR AVD with 4.3.1 (API 18), Galaxy Tab 3 (4.1.2), Surprice, surprice.....works on my Galaxy NOTE with Omnirom 4.4.4
Not Working on: EMULATOR AVD with 4.4.2 (API 19), Galaxy S4 (4.4.2), Galaxy Note 3 (4.4.2)
Code:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int myWidth = 1280;
int myHeight = 800;
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
boolean isPortrait = getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;
int frameBufferWidth = isPortrait ? myHeight : myWidth;
int frameBufferHeight = isPortrait ? myWidth : myHeight;
Bitmap frameBuffer = Bitmap.createBitmap(frameBufferWidth, frameBufferHeight, Config.RGB_565);
graphics = new AndroidGraphics(getAssets(), frameBuffer);
fl = new FrameLayout(this);
ImageView mons= new ImageView(this);
mons.setImageBitmap(graphics.newImage("mons/mons01.png", ImageFormat.ARGB8888).getBitmap());
mons.setX(400);
mons.setY(200);
TranslateAnimation aniTrans = new TranslateAnimation(0, 0, 0, -200);
aniTrans.setDuration(5000);
mons.setAnimation(aniTrans);
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT);
fl.addView(mons, params);
FrameLayout.LayoutParams flp = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
this.setContentView(fl, flp);
mons.startAnimation(aniTrans);
aniTrans.startNow();
}
Issue Found!
HAVE FOUND THE PROBLEM, but NEED HELP TO SOLVED IT!
(NOTE: This only occurs in full java code. It doesn’t happened using XML file, what is not the case)
Now I should call this topic like:
ANDROID 4.4.2 CREATES A BLACK MASK OUTSIDE VIEW OBJECT BOUNDARY, ONLY DURING FULL JAVA CODE ANIMATIONS?
Why?:
Take a look to this new example code:
Code:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
common = new Common(this, this);
FrameLayout.LayoutParams framelayoutparameter = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
/* I think that this is the line code (imageviewparamenter) were Android 4.4.2 FAILS during animation.*/
LayoutParams imageviewparamenter = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
/* No matter the size of the screen, Android 4.4.2 creates a black hole outside the image size,
* just during animation (see attached picture). Thats why animation dont show up, if the
* initial position (setX or setY) of the image, is outside the image boundary.*/
fl = new FrameLayout(this);
ImageView iv = new ImageView(this);
/* Image is located in the ASSET and is 100x100 pixels (non dpi dependable)
* "common" method use AssetManager to read the image file */
iv.setImageBitmap(common.newImage("iv_image.png", ImageFormat.RGB565).getBitmap());
iv.setX(50); // position show in the example
iv.setY(0);
fl.addView(iv, imageviewparamenter);
this.setContentView(fl, framelayoutparameter);
AlphaAnimation animation = new AlphaAnimation(0,1);
animation.setDuration(5000);
animation.setAnimationListener(this);
/* Also, "setAnimation(animation)" must be present, in order that
* Android 4.4.2 animates without skipping frames*/
iv.setAnimation(animation);
iv.startAnimation(animation);
}
Create a frame layout with a ImageView and alpha animation using pure java code. During animation, Android 4.4.2 (API19) is creating a black mask outside the ImageView size boundary, starting at x/y coordinates (0 + imageWidth / 0 + imageHeight), so if you initially place the image outside that coordinate, you don’t see any animation, just the original image at the end of the animation....
To recreate the issue, i have place the image in x = 50 . You would see that the half right side of the image is BLACK during Android 4.4.2 animation. You can recreate using emulator with any size of screen setup that you prefer. Using API 16,17,18, have no problem, but using API19, the black mask will make you crazy!
NOW, ANY IDEAS? or is a big bug on Android 4.4.2? or I just don’t see it?
Anyone?
SOLVED
! SOLVED !
For some reason, API19 programmatically pure java animations doesnt play very well with absolut settings, like setX() or setY(). Experts may take a look on this. API19 preffers to work with margins on the layout parameter side.
The following procedure, apply's to android 4.4.2. Of cource, it works on the others versions down and up, but you must change your way of thinking. You must place a imagen programmatically using layout parameters, so change:
Code:
iv.setX(50);
iv.setY(0);
to
Code:
lparam.setMargins(50, 0, 0, 0);
iv.setLayoutParams(lparam);
iv.requestLayout();
You must call "requestLayout()" to ensure that the new changes on the layout, will be commited when adding the view to the parent (fl).
Finnally, by mistake, I use "LayoutParams" instead of "FrameLayout.LayoutParams". This nothing have to do with the issue and was not affecting it, but is the correct way to define it, so change:
Code:
LayoutParams lparam = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
to
Code:
FrameLayout.LayoutParams lparam = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT);
The complete working code for any API is:
Code:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Common common = new Common(this, this);
FrameLayout fl = new FrameLayout(this);
ImageView iv = new ImageView(this);
FrameLayout.LayoutParams flparam = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
FrameLayout.LayoutParams lparam = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT);
iv.setImageBitmap(common.newImage("100x100.png", ImageFormat.RGB565).getBitmap());
lparam.setMargins(50, 0, 0, 0);
iv.setLayoutParams(lparam);
iv.requestLayout();
fl.addView(iv);
this.setContentView(fl, flparam);
AlphaAnimation animation = new AlphaAnimation(0, 1);
animation.setDuration(3000);
iv.setAnimation(animation);
iv.startAnimation(animation);
}

[Q] Chinese characters Showing as ?

I am using Coolreader as an epubviewer, and it is working fine till kitkat, but when i installed the same in Lollypop, chinese characters are showing as '?'. I went through the Sourcecode of the coolreader application and got this page
I cannot post that link here but i will post the code here
private boolean applyDefaultFont(Properties props, String propName, String defFontFace) {
String currentValue = props.getProperty(propName);
boolean changed = false;
if (currentValue == null) {
currentValue = defFontFace;
changed = true;
}
if (!isValidFontFace(currentValue)) {
if (isValidFontFace("Droid Sans"))
currentValue = "Droid Sans";
else if (isValidFontFace("Roboto"))
currentValue = "Roboto";
else if (isValidFontFace("Droid Serif"))
currentValue = "Droid Serif";
else if (isValidFontFace("Arial"))
currentValue = "Arial";
else if (isValidFontFace("Times New Roman"))
currentValue = "Times New Roman";
else if (isValidFontFace("Droid Sans Fallback"))
currentValue = "Droid Sans Fallback";
else {
String[] fontFaces = Engine.getFontFaceList();
if (fontFaces != null)
currentValue = fontFaces[0];
}
changed = true;
}
if (changed)
props.setProperty(propName, currentValue);
return changed;
}
public boolean fixFontSettings(Properties props) {
boolean res = false;
res = applyDefaultFont(props, ReaderView.PROP_FONT_FACE, DeviceInfo.DEF_FONT_FACE) || res;
res = applyDefaultFont(props, ReaderView.PROP_STATUS_FONT_FACE, DeviceInfo.DEF_FONT_FACE) || res;
res = applyDefaultFont(props, ReaderView.PROP_FALLBACK_FONT_FACE, "Droid Sans Fallback") || res;
return res;
}
in line 1403 to 1444' I found something related to fonts, they have hard coded 5 fonts and below they have set '"Droid Sans Fallback " as default fallback font. I inspected /system/fonts in my emulator working in 5.1 and found out even if there is "Droid Sans Fallback" and other fonts are there only these fonts are coming in the applications font selector
fonts in /systems/fonts in 5.1
cosmic gothic SC
comming soon
cutive mono
Dancing script
Droid sans mono
motoyalmaru
nanumgothic
noto sans myanmar
noto sans myanmar UI
noto serif
roboto
Roboto condensed
fonts 4.4.4 in systems/fonts
Droid Naskh Shift Alt
Droid Sans Fallback
Droid sans mono
droid serif
Motoyalmaru
NamumGothic
Padauk book
Roboto
Roboto Condensed
Now see my observations, in 4.4.4, I tried all the fonts and in all the fonts the chinese characters are loading correctly
In 5.1.0 I tried all the available fonts but chinese characters are not loading in any of it, always ?
Then i took a copy of Droid Sans Fallback from 4.4.4 and pasted it in system/fonts in 5.1 then the droid sans fallback font appeard in font list of Coolreader, before , even though it exixted in system/fonts of 5.1, it was not appearing in the fonts list of coolreader. Then i selected it and i could see chinese characters.
My question is in 4.4.4 all the fonts are loading chinese, but in 5.1.0, even though there are more fonts in the list none are loading chinese, So it must be something else which is causing the problem.
I tired another reader called fb reader and it is showing chinese the funny part is that it has got ont 3 fonts in its fontslist, Droid sans, droid serif and droid mono.
I almost created an app using cool reader and the same thing is haunting me please help
Is lollypop no compactable with chinese in epub reader
:crying::crying:
mukundzg said:
I am using Coolreader as an epubviewer, and it is working fine till kitkat, but when i installed the same in Lollypop, chinese characters are showing as '?'. I went through the Sourcecode of the coolreader application and got this page
I cannot post that link here but i will post the code here
private boolean applyDefaultFont(Properties props, String propName, String defFontFace) {
String currentValue = props.getProperty(propName);
boolean changed = false;
if (currentValue == null) {
currentValue = defFontFace;
changed = true;
}
if (!isValidFontFace(currentValue)) {
if (isValidFontFace("Droid Sans"))
currentValue = "Droid Sans";
else if (isValidFontFace("Roboto"))
currentValue = "Roboto";
else if (isValidFontFace("Droid Serif"))
currentValue = "Droid Serif";
else if (isValidFontFace("Arial"))
currentValue = "Arial";
else if (isValidFontFace("Times New Roman"))
currentValue = "Times New Roman";
else if (isValidFontFace("Droid Sans Fallback"))
currentValue = "Droid Sans Fallback";
else {
String[] fontFaces = Engine.getFontFaceList();
if (fontFaces != null)
currentValue = fontFaces[0];
}
changed = true;
}
if (changed)
props.setProperty(propName, currentValue);
return changed;
}
public boolean fixFontSettings(Properties props) {
boolean res = false;
res = applyDefaultFont(props, ReaderView.PROP_FONT_FACE, DeviceInfo.DEF_FONT_FACE) || res;
res = applyDefaultFont(props, ReaderView.PROP_STATUS_FONT_FACE, DeviceInfo.DEF_FONT_FACE) || res;
res = applyDefaultFont(props, ReaderView.PROP_FALLBACK_FONT_FACE, "Droid Sans Fallback") || res;
return res;
}
in line 1403 to 1444' I found something related to fonts, they have hard coded 5 fonts and below they have set '"Droid Sans Fallback " as default fallback font. I inspected /system/fonts in my emulator working in 5.1 and found out even if there is "Droid Sans Fallback" and other fonts are there only these fonts are coming in the applications font selector
fonts in /systems/fonts in 5.1
cosmic gothic SC
comming soon
cutive mono
Dancing script
Droid sans mono
motoyalmaru
nanumgothic
noto sans myanmar
noto sans myanmar UI
noto serif
roboto
Roboto condensed
fonts 4.4.4 in systems/fonts
Droid Naskh Shift Alt
Droid Sans Fallback
Droid sans mono
droid serif
Motoyalmaru
NamumGothic
Padauk book
Roboto
Roboto Condensed
Now see my observations, in 4.4.4, I tried all the fonts and in all the fonts the chinese characters are loading correctly
In 5.1.0 I tried all the available fonts but chinese characters are not loading in any of it, always ?
Then i took a copy of Droid Sans Fallback from 4.4.4 and pasted it in system/fonts in 5.1 then the droid sans fallback font appeard in font list of Coolreader, before , even though it exixted in system/fonts of 5.1, it was not appearing in the fonts list of coolreader. Then i selected it and i could see chinese characters.
My question is in 4.4.4 all the fonts are loading chinese, but in 5.1.0, even though there are more fonts in the list none are loading chinese, So it must be something else which is causing the problem.
I tired another reader called fb reader and it is showing chinese the funny part is that it has got ont 3 fonts in its fontslist, Droid sans, droid serif and droid mono.
I almost created an app using cool reader and the same thing is haunting me please help
Is lollypop no compactable with chinese in epub reader
:crying::crying:
Click to expand...
Click to collapse
It seems someone here: http://forum.xda-developers.com/google-nexus-5/help/japanese-fonts-android-5-0-lollipop-t2939463
had a similar problem and solved it. See if this helps
But it needs root privilages right?
GokulNC said:
It seems someone here: http://forum.xda-developers.com/google-nexus-5/help/japanese-fonts-android-5-0-lollipop-t2939463
had a similar problem and solved it. See if this helps
Click to expand...
Click to collapse
I need to fix the problem without rooting the device. Is there any way?
mukundzg said:
I need to fix the problem without rooting the device. Is there any way?
Click to expand...
Click to collapse
I guess there's no other way for the moment without rooting.
Why do you hesitate to root your phone?
Nothing wrong will happen until you do it right
I already did that
GokulNC said:
I guess there's no other way for the moment without rooting.
Why do you hesitate to root your phone?
Nothing wrong will happen until you do it right
Click to expand...
Click to collapse
Hi, I already did rooting, and what i did was I copied Droid Sans Fallback font in 4.4.4 to 5.1.0 to the /system/fonts folder after moving the original file in that folder. and problem got solved, I was looking for a solution other than this, perhaps in source code of the application

Categories

Resources