الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

كيف أعمل إخفاء للتطبيق مثل برنامج الخاشع

مغلق
بدأه نور البدر في 9 ديسمبر 2007 · 6 رد · 1,372 مشاهدة · في JavaME
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

شباب ممكن معنتكم

في برنامج الخاشع

أعتقد أنهم يسشتخدمون خاصية إخفاء للتطبيق بحيث أنه يختفي ويكون شغــّال بحيث عند وقت معين يقوم بالأذان

وإيضاً خاصية أخرى وهي تشغيل البرنامج بشكل تلقائي عند تشغيل الموبايل

مثل autorun في الويندز

السؤال هو باختصار

ممكن شباب تدلوني على 3 أشياء :

1- كيف أعمل الإخفاء للتطبيق بحيث يشتغل في الباك قراوند

2- كيف أعمل timer أو pushregistry.alarm ما صارت معي

3- كيف اعمل تشغيل ذاتي أول ما يشتغل الجهاز النوكيا طبعاً

الرجاء أخواني الإجابة على الإسئلة إلا ما فيها ثقالة

نور البدر

#2

شباب أنا قمت بعمل الآتي

/*

* HelloMidlet.java

*

* Created on 09 ديسمبر, 2007, 11:49 ص

*/

package hello;

import javax.microedition.midlet.*;

import javax.microedition.lcdui.*;

import javax.microedition.io.PushRegistry;

import javax.microedition.io.ConnectionNotFoundException;

import java.util.Date;

/**

*

* @author user

*/

public class HelloMidlet extends MIDlet implements CommandListener {

/** Creates a new instance of HelloMidlet */

public HelloMidlet() {

}

private Form helloForm;

private StringItem helloStringItem;

private Command exitCommand;

/** This method initializes UI of the application.

*/

private void initialize() {

// Insert pre-init code here

getDisplay().setCurrent(get_helloForm());

// Insert post-init code here

}

/** Called by the system to indicate that a command has been invoked on a particular displayable.

* @param command the Command that ws invoked

* @param displayable the Displayable on which the command was invoked

*/

public void commandAction(Command command, Displayable displayable) {

// Insert global pre-action code here

if (displayable == helloForm) {

if (command == exitCommand) {

// Insert pre-action code here

try

{

scheduleMIDlet(200);

}

catch (Exception e)

{

e.printStackTrace();

}

exitMIDlet();

// Insert post-action code here

}

}

// Insert global post-action code here

}

/**

* This method should return an instance of the display.

*/

public Display getDisplay() {

return Display.getDisplay(this);

}

/**

* This method should exit the midlet.

*/

public void exitMIDlet() {

getDisplay().setCurrent(null);

destroyApp(true);

notifyDestroyed();

}

/** This method returns instance for helloForm component and should be called instead of accessing helloForm field directly.

* @return Instance for helloForm component

*/

public Form get_helloForm() {

if (helloForm == null) {

// Insert pre-init code here

helloForm = new Form(null, new Item[] {get_helloStringItem()});

helloForm.addCommand(get_exitCommand());

helloForm.setCommandListener(this);

// Insert post-init code here

}

return helloForm;

}

/** This method returns instance for helloStringItem component and should be called instead of accessing helloStringItem field directly.

* @return Instance for helloStringItem component

*/

public StringItem get_helloStringItem() {

if (helloStringItem == null) {

// Insert pre-init code here

helloStringItem = new StringItem("Hello", "Hello, World!");

// Insert post-init code here

}

return helloStringItem;

}

/** This method returns instance for exitCommand component and should be called instead of accessing exitCommand field directly.

* @return Instance for exitCommand component

*/

public Command get_exitCommand() {

if (exitCommand == null) {

// Insert pre-init code here

exitCommand = new Command("Exit", Command.EXIT, 1);

// Insert post-init code here

}

return exitCommand;

}

public void startApp() {

initialize();

}

public void pauseApp() {

}

public void destroyApp(boolean unconditional) {

}

/**

* Schedule this MIDlet's launch.

* @param deltatime the length of time in

* milliseconds before expiration.

*/

private void scheduleMIDlet(long deltatime)

throws ClassNotFoundException,ConnectionNotFoundException,SecurityException {

String cn = this.getClass().getName();

// Get the current time by calling Date.getTime()

Date alarm = new Date();

long t = PushRegistry.registerAlarm(cn,alarm.getTime()+deltatime);

}

}

بس تظهر رسالة تفيد

want to receive automatic updating from the

network . receiving updates may result in charges.

is it OK to receive automatic updates

NO Yes

#3

بالنسبه لاخفاء التطبيق يمكن ذلك عن طريق:

getDisplay().setCurrent(null);

تم تعديل هذه المشاركة بواسطة muqawem في 9 ديسمبر 2007 في 14:58

#4

مشكور على الرد الجميل والمختصر والرائع

طيب يأ أخي

بعد ذلك كيف يشتغل عند وقت معين

#5

مشكوريت شباب

جرّبت الإخفاء

وجربت البش رجستري كله شغـّال ما قصرتوا شباب ربي يجعل الجنة مثواكم

بس فيه ملاحضة عندما يعمل البرنامج بالبش رجستري بعد وقت معين تظهر رسالة تأكيدية

===================================

| السماح لتطبيق ....كذا.... بالبدء آلياً عند الحاجة |

| |

| لا نعم |

===================================

ممكن عملية عدم السؤال وتجاوز هذه النافذة

بليييز

#6

عفوا أخي نور البدر

بالنسبه للرساله التي ذكرتها فهي رساله security من الجافا ولا يمكن حذفها الا عن طريق تسجيل تطبيقك والحصول على شهاده لبرنامجك من احدى الشركات التي تقدم مثل هذه الشهادات.

#7

مشكور على الرد

طيب ممكن اعمل أكثر من بش رجستري في برنامج واحد

لأن المفكرة تكن فيها أكثر من بش رجستري

جربتها فلم تنفع

private void scheduleMIDlet1(long deltatime)

throws ClassNotFoundException,ConnectionNotFoundException,SecurityException {

//String cn="hello.VisualMidlet";

String cn = this.getClass().getName();

// Get the current time by calling Date.getTime()

Date alarm = new Date();

long t1 = PushRegistry.registerAlarm(cn,alarm.getTime()+deltatime);

}

private void scheduleMIDlet2(long deltatime)

throws ClassNotFoundException,ConnectionNotFoundException,SecurityException {

//String cn="hello.VisualMidlet";

String cn = this.getClass().getName();

// Get the current time by calling Date.getTime()

Date alarm = new Date();

long t2 = PushRegistry.registerAlarm(cn,alarm.getTime()+deltatime);

}

private void scheduleMIDlet3(long deltatime)

throws ClassNotFoundException,ConnectionNotFoundException,SecurityException {

//String cn="hello.VisualMidlet";

String cn = this.getClass().getName();

// Get the current time by calling Date.getTime()

Date alarm = new Date();

long t3 = PushRegistry.registerAlarm(cn,alarm.getTime()+deltatime);

}

private void scheduleMIDlet4(long deltatime)

throws ClassNotFoundException,ConnectionNotFoundException,SecurityException {

//String cn="hello.VisualMidlet";

String cn = this.getClass().getName();

// Get the current time by calling Date.getTime()

Date alarm = new Date();

long t4 = PushRegistry.registerAlarm(cn,alarm.getTime()+deltatime);

}

private void scheduleMIDlet5(long deltatime)

throws ClassNotFoundException,ConnectionNotFoundException,SecurityException {

//String cn="hello.VisualMidlet";

String cn = this.getClass().getName();

// Get the current time by calling Date.getTime()

Date alarm = new Date();

long t5 = PushRegistry.registerAlarm(cn,alarm.getTime()+deltatime);

}

واستخدمتها بالشكل التالي

scheduleMIDlet1(1000*60);

scheduleMIDlet2(1000*60*2);

scheduleMIDlet3(1000*60*3);

scheduleMIDlet4(1000*60*4);

scheduleMIDlet5(1000*60*5);

لم يشتغل أي شي

ممكن من الأخوان التوضيح لماذا

وكيف أعملها كالمفكرة

هذا الموضوع مغلق.

مواضيع مشابهة