رفتن به مطلب
بیسیک فور ایکس

samannnn

کاربر عادی
  • تعداد ارسال ها

    1
  • تاریخ عضویت

  • آخرین بازدید

درباره samannnn

  • تاریخ تولد تعیین نشده
  1. samannnn

    اشغال زیاد رم

    دوستان سلام من برنامه ام میزان بالایی از رم حدود 100 مگ اشفال میکنه میخواستم بدونم مشکل چیه نمونه کد ها رو پایین ضمیمه میکنم: Sub Process_Globals End Sub Sub Globals Dim btnEducation1 As ImageView Dim text2 As ImageView End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("layout1") btnEducation1.Initialize("btnEducation1") btnEducation1.Bitmap=LoadBitmap(File.DirAssets,"icon1.png") btnEducation1.Gravity=Gravity.FILL Activity.AddView(btnEducation1, 30%x,50%y,25%x,25%x) text1.Initialize("text1") text1.Bitmap=LoadBitmap(File.DirAssets,"text1.png") text1.Gravity=Gravity.FILL Activity.AddView(text1 ,55%x,55%y,30%x,15%x) End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Sub btnEducation1_click Activity.Finish StartActivity("FirstPage") End Sub Sub btnEducation2_click Activity.Finish StartActivity("soundplay") End Sub Sub text1_click Activity.Finish StartActivity("FirstPage") End Sub Sub text2_click Activity.Finish StartActivity("soundplay") End Sub Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event If KeyCode = KeyCodes.KEYCODE_BACK Then Log(KeyCodes.KEYCODE_BACK) Log (KeyCode) ExitApplication End If Return True End Sub #Region Activity Attributes #FullScreen: False #IncludeTitle: false #End Region Sub Process_Globals 'These global variables will be declared once when the application starts. 'These variables can be accessed from all modules. End Sub Sub Globals 'These global variables will be redeclared each time the activity is created. 'These variables can only be accessed from this module. Dim contain As AHPageContainer Dim page As AHViewPager Dim p(14) As Panel Dim SoundGav, SoundFeel, SoundGhorbaghe, SoundGorbe, SoundSag, SoundGosfand, SoundKhok, SoundMorgh, SoundJoghd, SoundBooz, SoundKhargosh ,SoundAsb, SoundShir As MediaPlayer Dim MpGav, MpCow, MpFeel, MpElephen, MpGhorbaghe, MpFrog, MpGorbe, MpCat, MpSag, MpDog, MpGosfand, MpSheep, MpZarafe, MpGiraffe, MpKhok, MpPig, MpMorgh, MpHen, MpJoghd, MpOwl, MpBooz, MpGoat, MpKhargosh, MpRabbit, MpAsb, MpHorse, MpShir, MpLion As MediaPlayer Dim BtnGav, BtnCow ,BtnFeel, BtnElephen, BtnGhorbaghe, BtnFrog, BtnGorbe, BtnCat, BtnSag, BtnDog, BtnGosfand, BtnSheep, BtnZarafe, BtnGiraffe, BtnKhok, BtnPig, BtnMorgh, BtnHen, BtnJoghd, BtnOwl, BtnBooz, BtnGoat, BtnKhargosh, BtnRabbit, BtnAsb, BtnHorse, BtnShir, BtnLion As Button End Sub Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: 'Activity.LoadLayout("Layout1") Adad 'مربوط به تبلیغ عدد Activity.SetBackgroundImage(LoadBitmap(File.DirAssets,"asemon.jpg")) ToastMessageShow("برای شنیدن صدای حیوانات روی تصویر مورد نظر کلیک کنید", False) contain.Initialize Dim img0, img1, img2 ,img3, img4, img5, img6, img7, img8, img9, img10, img11, img12, img13 As ImageView For i = 0 To 13 p(i).Initialize("") Select i Case 0 img0.Initialize("img0") img0.Gravity=Gravity.FILL img0.Bitmap=LoadBitmap(File.DirAssets,"cow.png") p(i).AddView(img0,12%x,20%y,75%x,45%y) BtnGav.Initialize("BtnGav") BtnGav.text="گاو" BtnGav.Typeface=Typeface.DEFAULT_BOLD p(i).AddView(BtnGav,15%x,65%y,33%x,10%y) BtnCow.Initialize("BtnCow") BtnCow.Text="Cow" BtnCow.Typeface=Typeface.DEFAULT_BOLD p(i).AddView(BtnCow,50%x,65%y,33%x,10%y) Case 1 img1.Initialize("img1") img1.Gravity=Gravity.FILL img1.Bitmap=LoadBitmap(File.DirAssets,"phil.png") p(i).AddView(img1,15%x,20%y,75%x,45%y) BtnFeel.Initialize("BtnFeel") BtnFeel.Text="فیل" BtnFeel.Typeface=Typeface.DEFAULT_BOLD p(i).AddView(BtnFeel,15%x,65%y,33%x,10%y) BtnElephen.Initialize("BtnElephen") BtnElephen.Text="Elephen" BtnElephen.Typeface=Typeface.DEFAULT_BOLD p(i).AddView(BtnElephen,50%x,65%y,33%x,10%y) Case 2 img2.Initialize("img2") img2.Gravity=Gravity.FILL img2.Bitmap=LoadBitmap(File.DirAssets,"frog.png") p(i).AddView(img2,15%x,20%y,65%x,45%y) BtnGhorbaghe.Initialize("BtnGhorbaghe") BtnGhorbaghe.Text="غورباقه" BtnGhorbaghe.Typeface=Typeface.DEFAULT_BOLD p(i).AddView(BtnGhorbaghe,15%x,65%y,30%x,10%y) BtnFrog.Initialize("BtnFrog") BtnFrog.Text="Frog" BtnFrog.Typeface=Typeface.DEFAULT_BOLD p(i).AddView(BtnFrog,50%x,65%y,30%x,10%y) . . . . Case 10 img10.Initialize("img10") img10.Gravity=Gravity.FILL img10.Bitmap=LoadBitmap(File.DirAssets,"booz.png") p(i).AddView(img10,15%x,20%y,75%x,45%y) BtnBooz.Initialize("BtnBooz") BtnBooz.Text="بز" BtnBooz.Typeface=Typeface.DEFAULT_BOLD p(i).AddView(BtnBooz,15%x,65%y,33%x,10%y) BtnGoat.Initialize("BtnGoat") BtnGoat.Text="Goat" BtnGoat.Typeface=Typeface.DEFAULT_BOLD p(i).AddView(BtnGoat,50%x,65%y,33%x,10%y) Case 11 img11.Initialize("img11") img11.Gravity=Gravity.FILL img11.Bitmap=LoadBitmap(File.DirAssets,"rabbit.png") p(i).AddView(img11,15%x,20%y,75%x,45%y) BtnKhargosh.Initialize("BtnKhargosh") BtnKhargosh.Text="خرگوش" BtnKhargosh.Typeface=Typeface.DEFAULT_BOLD p(i).AddView(BtnKhargosh,15%x,65%y,33%x,10%y) BtnRabbit.Initialize("BtnRabbit") BtnRabbit.Text="Rabbit" BtnRabbit.Typeface=Typeface.DEFAULT_BOLD p(i).AddView(BtnRabbit,50%x,65%y,33%x,10%y) ' Case 12 img12.Initialize("img12") img12.Gravity=Gravity.FILL img12.Bitmap=LoadBitmap(File.DirAssets,"horse.png") p(i).AddView(img12,15%x,20%y,75%x,45%y) BtnAsb.Initialize("BtnAsb") BtnAsb.Text="اسب" BtnAsb.Typeface=Typeface.DEFAULT_BOLD p(i).AddView(BtnAsb,15%x,65%y,33%x,10%y) BtnHorse.Initialize("BtnHorse") BtnHorse.Text="Horse" BtnHorse.Typeface=Typeface.DEFAULT_BOLD p(i).AddView(BtnHorse,50%x,65%y,33%x,10%y) Case 13 img13.Initialize("img13") img13.Gravity=Gravity.FILL img13.Bitmap=LoadBitmap(File.DirAssets,"lion.png") p(i).AddView(img13,15%x,20%y,75%x,45%y) BtnShir.Initialize("BtnShir") BtnShir.Text="شیر" BtnShir.Typeface=Typeface.DEFAULT_BOLD p(i).AddView(BtnShir,15%x,65%y,33%x,10%y) BtnLion.Initialize("BtnLion") BtnLion.Text="Lion" BtnLion.Typeface=Typeface.DEFAULT_BOLD p(i).AddView(BtnLion,50%x,65%y,33%x,10%y) End Select contain.AddPage(p(i),"Page " & i) Next page.Initialize(contain,"page") Activity.AddView(page,5dip,70dip,100%x - 5dip,100%y - 70dip) SoundGav.Initialize2("SoundGav") SoundGav.Load(File.DirAssets,"soundgav.mp3") SoundFeel.Initialize2("SoundFeel") SoundFeel.Load(File.DirAssets,"soundfeel.mp3") MpGav.Initialize2("MpGav") MpGav.Load(File.DirAssets,"btngav.mp3") MpCow.Initialize2("MpCow") MpCow.Load(File.DirAssets, "btncow.mp3") MpFeel.Initialize2("MpFeel") MpFeel.Load(File.DirAssets,"btnfeel.mp3") MpElephen.Initialize2("MpElephen") MpElephen.Load(File.DirAssets, "btnelephen.mp3") MpGhorbaghe.Initialize2("MpGhorbaghe") MpGhorbaghe.Load(File.DirAssets,"btnghorbaghe.mp3") MpFrog.Initialize2("MpFrog") MpFrog.Load(File.DirAssets, "btnfrog.mp3") MpGorbe.Initialize2("MpGorbe") MpGorbe.Load(File.DirAssets,"btngorbe.mp3") MpCat.Initialize2("MpCat") MpCat.Load(File.DirAssets, "btncat.mp3") MpSag.Initialize2("MpSag") MpSag.Load(File.DirAssets,"btnsag.mp3") End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub End Sub Sub img0_click SoundGav.Play End Sub Sub img5_click SoundGosfand.Play End Sub End Sub
×