olcay 38
Üye
Tufkan- Kodlar var sen bir proje belirle yazmaya başla bende sana o işe yarayacak kodlar üreteyim .
OLCAY38- hata veren ne yani hangi program DroidScript mi ?
Geç cevap verdiğim için kusura bakma.Peki resimdeki verdiğim kodları deneyebileceğim bir program varmı link atarmısın?
artık Android için eclipse çok demode oldu ya. bence direkt Android Studio'ya yönelmek lazımEclipse dene kurulumu biraz gayret ve sabır gerektirir tabi kodlar Android java kodu ise
btn_OnTouch()
function btn_OnTouch()
{
//Lets have some fun!
layExp = app.CreateLayout( "linear", "VCenter,FillXY" );
imgBack = app.CreateImage( null, 1.0, 1.0 );
layExp.AddChild( imgBack );
app.AddLayout( layExp );
player = app.CreateMediaPlayer();
player.SetFile( "/Sys/Snd/Explode.mp3" );
Explode( 0 );
}
//Show an animated explosion.
function Explode( startFrame )
{
if( startFrame!=null ) explodeFrame = startFrame;
if( explodeFrame < 5 ) {
var file = "Explode" + (++explodeFrame) + ".png";
imgBack.SetImage( "/Sys/Img/" + file, 1 );
setTimeout( Explode, 100 );
}
else {
explodeFrame = 1;
app.DestroyLayout( layExp );
player.Release();
// setTimeout( "btn.SetVisibility( Show )", 1000 );
}
}
app.SetMenu("Exit,Full,popup,back");
function OnMenu(item)
{
if( item == "Exit" )
{
//ÇIKIŞ.
app.Exit();
}
else if( item == "Full" )
{
//TAM EKRAN.
app.SetScreenMode( "Full");
}
else if( item == "popup" )
{
//POPUP MESAJ.
app.ShowPopup( "Selam!" );
}
else if( item == "back" )
{
//UYGULAMAYI ARKAPLAN'A ATMA.
app.ToBack();
}
}
app.SetScreenMode( "fu ll");
//tam ekran.
function OnBack()
{
var yesNo = app.CreateYesNoDialog( "Çıkmak isterseniz Yes butonunu basınız..." );
yesNo.SetOnTouch( yesNo_OnTouch );
}
function yesNo_OnTouch( result )
{
if( result=="Yes" ) app.Exit();
}
SetOnTouch() dokundugunuzda calısacak kod dizisini tetikler parantez içine function adını yazın dokununca o fonksiyonu çagırır ..İyi günler, Yakın zamanda yazılım işine giriştim ve bu programı yeni farkettim. Bazı konularda yardıma ihtiyacım var.
Örneğin SetOnTouch komutunu calistiramiyorum yardim ederseniz sevinirim.
//Called when application is started.
function OnStart()
{
app.EnableBackKey( false );
//Create a layout with objects vertically centered.
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
layBar = app.CreateLayout( "Linear", "horizontal,fillx" );
layBar.SetBackColor( "#222222" );
txt = app.CreateText( "2in1" );
txt.SetTextColor("#dddddd");
txt.SetTextSize( 32 );
lay.AddChild( layBar );
layBar.AddChild( txt );
//Create a web control.
// web = app.CreateWebView( 1,0.95 );
// lay.AddChild( web );
//Create a web control.
web = app.CreateWebView( 1, 0.88);
web.SetOnProgress( web_OnProgess );
lay.AddChild( web );
app.ShowProgress("Sayfa Yüklenirken Bekleyin..");
var html = "<html><head>";
html += "<meta name'viewport' content='width=device-width'>";
html += "</head><body>Merhabalar. Droidscript ile yazılıp geliştirilmekte... Ayrıca bütün Maxicep.com ailesine teşekkürler.Alttaki qr kod ise flash isimli uygulamamın dır. Saolun<br> <br> <br> <br> Ayrıca @SeloSoft a minettarım... Tufan";
html += "<img src='/sdcard/Download/qr.jpeg'>";
html += "</body></html>";
web.LoadHtml( html, "file:///Sys/" );
//Create 'Local' button.
btnçıkış = app.CreateButton( "Çıkış" );
btnçıkış.SetOnTouch(çıkış);
layBar.AddChild( btnçıkış);
//Create 'Dynamic' button.
btnMaxicep = app.CreateButton( "Maxicep" );
btnMaxicep.SetOnTouch( btnMaxicep_OnTouch );
layBar.AddChild( btnMaxicep );
//Create 'Remote' button.
btnGoogle = app.CreateButton( "Google" );
btnGoogle.SetOnTouch( btnGoogle_OnTouch );
layBar.AddChild( btnGoogle );
//Add layout to app.
app.AddLayout( lay );
}
function web_OnProgess( progress )
{
app.Debug( "progress = " + progress );
if( progress==100 ) app.HideProgress();
}
//Called when user touches 'Dynamic' button.
function btnMaxicep_OnTouch(progress)
{
web.LoadUrl( "http:///www.maxicep.com/forum");
}
//Called when user touches 'Remote' button.
function btnGoogle_OnTouch()
{
web.LoadUrl( "http:///www.google.com" );
}
//Set action of Back key
function OnBack()
{
web.Back()
}
function çıkış()
{
var yesNo = app.CreateYesNoDialog( "Çıkış ?" );
yesNo.SetOnTouch( yesNo_OnTouch );
}
//Way out if normal Back key disabled
function yesNo_OnTouch( result ){
if( result=="Yes" )
app.Exit();
}
function OnStart()
{
//Create a layout with objects vertically centered.
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
//Create a webview and add it to layout.
web = app.CreateWebView( 1,0.8 );
//web.LoadUrl("file:///sdcard/Download/SJGanimlogo2.gif"); //bu kısma telefon hafızasından yüklenir.
web.LoadUrl("http://www.hizliresimyukle.com/images/2015/02/05/selo.gif");//works too
lay.AddChild( web );
//Add layout to app.
app.AddLayout( lay );
}
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?