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

[تنبيه - عدم تكرار المخالفة :]need help in a project

بدأه oussama.accouch في 27 يوليو 2010 · 7 رد · 596 مشاهدة · في JavaME
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

i made a project using svg menu it works perfectly in a phone with 240*320 screen resolution is there any way to make it run on other phone whitch has other screen resolution .

#3

الأخ الكريم/الأخت الكريمة

السلام عليكم ورحمة الله وبركاته.

مرحباً بكم في منتدى الفريق العربي للبرمجة

هذا الموضوع يشتمل على مخالفة أو أكثر لقواعد المشاركة.

الرجاء التنبه وعدم تكرار المخالفة في مواضيعك القادمة، وهذا بمثابة إشعار للأهمية.

وفي حال التكرار سيتعرض موضوعك للإغلاق والحذف!!!

قواعد المشاركة

/index.php?showtopic=29343

شاكرين لكم حُسن تعاونكم

#4
مهدي حجازي كتب:

الأخ الكريم/الأخت الكريمة

السلام عليكم ورحمة الله وبركاته.

مرحباً بكم في منتدى الفريق العربي للبرمجة

هذا الموضوع يشتمل على مخالفة أو أكثر لقواعد المشاركة.

الرجاء التنبه وعدم تكرار المخالفة في مواضيعك القادمة، وهذا بمثابة إشعار للأهمية.

وفي حال التكرار سيتعرض موضوعك للإغلاق والحذف!!!

قواعد المشاركة

/index.php?showtopic=29343

شاكرين لكم حُسن تعاونكم

المشروع عبارة عن برناج لموقع ثابت "وكالة اخبار" يحوي كل ما يحويه الموقع من اخبار جديدة وقديمة :

إني في خضم تسليم المشروع لقد استخدمت "netbean" و الikivo svg animator" ولكن تكمن المشكلة انني أنشأت الsvg file 240*320 فهل من الممكن جعل البرنامج ذو صيغة ديناميكية من حيث حجم الشاشة.

كما و أنه لدي مشكلة في محرك البحث الخاص بالموقع الأم بحيث ان البحث في الموقع لا يغير في الurl في الاعلى .

#5
oussama.accouch كتب:

المشروع عبارة عن برناج لموقع ثابت "وكالة اخبار" يحوي كل ما يحويه الموقع من اخبار جديدة وقديمة :

إني في خضم تسليم المشروع لقد استخدمت "netbean" و الikivo svg animator" ولكن تكمن المشكلة انني أنشأت الsvg file 240*320 فهل من الممكن جعل البرنامج ذو صيغة ديناميكية من حيث حجم الشاشة.

كما و أنه لدي مشكلة في محرك البحث الخاص بالموقع الأم بحيث ان البحث في الموقع لا يغير في الurl في الاعلى .

اعود واكرر طلب محمد بعرض الكود لاننا لن تستطيع تحديد سبب المشكله فمن المفترض ان SVG تكون قابله للتكبير تلقائيا وانها سوف تعمل على جميع الشاشات.

#6
مهدي حجازي كتب:

اعود واكرر طلب محمد بعرض الكود لاننا لن تستطيع تحديد سبب المشكله فمن المفترض ان SVG تكون قابله للتكبير تلقائيا وانها سوف تعمل على جميع الشاشات.

/*

* To change this template, choose Tools | Templates

* and open the template in the editor.

*/

package hello;

import javax.microedition.midlet.*;

import javax.microedition.lcdui.*;

import javax.microedition.m2g.SVGImage;

import org.netbeans.microedition.svg.SVGMenu;

/**

* @author ABOU TALEB

*/

public class HelloMIDlet extends MIDlet implements CommandListener {

private boolean midletPaused = false;

//<editor-fold defaultstate="collapsed" desc=" Generated Fields ">

private Command exitCommand;

private Form form;

private StringItem stringItem;

private SVGMenu svgMenu;

private SVGImage svgImage;

//</editor-fold>

/**

* The HelloMIDlet constructor.

*/

public HelloMIDlet() {

}

//<editor-fold defaultstate="collapsed" desc=" Generated Methods ">

//</editor-fold>

//<editor-fold defaultstate="collapsed" desc=" Generated Method: initialize ">

/**

* Initilizes the application.

* It is called only once when the MIDlet is started. The method is called before the <code>startMIDlet</code> method.

*/

private void initialize() {

// write pre-initialize user code here

// write post-initialize user code here

}

//</editor-fold>

//<editor-fold defaultstate="collapsed" desc=" Generated Method: startMIDlet ">

/**

* Performs an action assigned to the Mobile Device - MIDlet Started point.

*/

public void startMIDlet() {

// write pre-action user code here

switchDisplayable(null, getSvgMenu().getSvgCanvas());

// write post-action user code here

}

//</editor-fold>

//<editor-fold defaultstate="collapsed" desc=" Generated Method: resumeMIDlet ">

/**

* Performs an action assigned to the Mobile Device - MIDlet Resumed point.

*/

public void resumeMIDlet() {

// write pre-action user code here

// write post-action user code here

}

//</editor-fold>

//<editor-fold defaultstate="collapsed" desc=" Generated Method: switchDisplayable ">

/**

* Switches a current displayable in a display. The <code>display</code> instance is taken from <code>getDisplay</code> method. This method is used by all actions in the design for switching displayable.

* @param alert the Alert which is temporarily set to the display; if <code>null</code>, then <code>nextDisplayable</code> is set immediately

* @param nextDisplayable the Displayable to be set

*/

public void switchDisplayable(Alert alert, Displayable nextDisplayable) {

// write pre-switch user code here

Display display = getDisplay();

if (alert == null) {

display.setCurrent(nextDisplayable);

} else {

display.setCurrent(alert, nextDisplayable);

}

// write post-switch user code here

}

//</editor-fold>

//<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Displayables ">

/**

* Called by a system to indicated that a command has been invoked on a particular displayable.

* @param command the Command that was invoked

* @param displayable the Displayable where the command was invoked

*/

public void commandAction(Command command, Displayable displayable) {

// write pre-action user code here

if (displayable == form) {

if (command == exitCommand) {

// write pre-action user code here

exitMIDlet();

// write post-action user code here

}

} else if (displayable == svgMenu) {

if (command == SVGMenu.SELECT_COMMAND) {

// write pre-action user code here

svgMenuAction();

// write post-action user code here

}

}

// write post-action user code here

}

//</editor-fold>

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: exitCommand ">

/**

* Returns an initiliazed instance of exitCommand component.

* @return the initialized component instance

*/

public Command getExitCommand() {

if (exitCommand == null) {

// write pre-init user code here

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

// write post-init user code here

}

return exitCommand;

}

//</editor-fold>

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: form ">

/**

* Returns an initiliazed instance of form component.

* @return the initialized component instance

*/

public Form getForm() {

if (form == null) {

// write pre-init user code here

form = new Form("Welcome", new Item[] { getStringItem() });

form.addCommand(getExitCommand());

form.setCommandListener(this);

// write post-init user code here

}

return form;

}

//</editor-fold>

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem ">

/**

* Returns an initiliazed instance of stringItem component.

* @return the initialized component instance

*/

public StringItem getStringItem() {

if (stringItem == null) {

// write pre-init user code here

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

// write post-init user code here

}

return stringItem;

}

//</editor-fold>

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: svgMenu ">

/**

* Returns an initiliazed instance of svgMenu component.

* @return the initialized component instance

*/

public SVGMenu getSvgMenu() {

if (svgMenu == null) {

// write pre-init user code here

svgMenu = new SVGMenu(getSvgImage(), getDisplay());

svgMenu.setTitle("svgMenu");

svgMenu.addCommand(SVGMenu.SELECT_COMMAND);

svgMenu.setCommandListener(this);

svgMenu.addMenuElement("menuItem_1");

svgMenu.addMenuElement("menuItem_2");

// write post-init user code here

}

return svgMenu;

}

//</editor-fold>

//<editor-fold defaultstate="collapsed" desc=" Generated Method: svgMenuAction ">

/**

* Performs an action assigned to the selected SVG menu element in the svgMenu component.

*/

public void svgMenuAction() {

// enter pre-action user code here

String __selectedElement = getSvgMenu().getMenuElementID(getSvgMenu().getSelectedIndex());

if (__selectedElement != null) {

if (__selectedElement.equals("menuItem_1")) {

// write pre-action user code here

switchDisplayable(null, getForm());

// write post-action user code here

} else if (__selectedElement.equals("menuItem_2")) {

// write pre-action user code here

exitMIDlet();

// write post-action user code here

}

}

// enter post-action user code here

}

//</editor-fold>

//<editor-fold defaultstate="collapsed" desc=" Generated Getter: svgImage ">

/**

* Returns an initiliazed instance of svgImage component.

* @return the initialized component instance

*/

public SVGImage getSvgImage() {

if (svgImage == null) {

// write pre-init user code here

try {

svgImage = (SVGImage) SVGImage.createImage(getClass().getResourceAsStream("/hello/0000.svg"), null);

} catch (java.io.IOException e) {

e.printStackTrace();

}

// write post-init user code here

}

return svgImage;

}

//</editor-fold>

/**

* Returns a display instance.

* @return the display instance.

*/

public Display getDisplay () {

return Display.getDisplay(this);

}

/**

* Exits MIDlet.

*/

public void exitMIDlet() {

switchDisplayable (null, null);

destroyApp(true);

notifyDestroyed();

}

/**

* Called when MIDlet is started.

* Checks whether the MIDlet have been already started and initialize/starts or resumes the MIDlet.

*/

public void startApp() {

if (midletPaused) {

resumeMIDlet ();

} else {

initialize ();

startMIDlet ();

}

midletPaused = false;

}

/**

* Called when MIDlet is paused.

*/

public void pauseApp() {

midletPaused = true;

}

/**

* Called to signal the MIDlet to terminate.

* @param unconditional if true, then the MIDlet has to be unconditionally terminated and all resources has to be released.

*/

public void destroyApp(boolean unconditional) {

}

}

المشكلة تحديدا هي عند تشغيلها على NOKIA N97 تصبح غريبة الشكل و صغيرة اما على N95 فهي تعمل ملئ الشاشة مع العلم ان Svg هو بحجم 240*360

#7

لا أعلم ما مشكله الكود..جربته وهو يعمل على أكثر من emulator بأكثر من resolution. ربما هناك مشكله في ملف ال SVG تبعك. عموما سوف أحاول تجرتبه على هاتف N97 ان شاء الله.

#8

سلام بالنسبة للn97 فقد استغنيت عنها ولكن اليس هناك من طريقة لجعل البرنامج ياخذ resolution من الهاتف ويقوم بتحجيم الصورة لتعمل بملئءالشاشة بشكل اتوملتيكي

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