Initial
This commit is contained in:
commit
8b4aced4c5
83
build.xml
Normal file
83
build.xml
Normal file
@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- You may freely edit this file. See commented blocks below for -->
|
||||
<!-- some examples of how to customize the build. -->
|
||||
<!-- (If you delete it and reopen the project it will be recreated.) -->
|
||||
<project name="Praiser" default="jar" basedir=".">
|
||||
<description>Builds, tests, and runs the project .</description>
|
||||
<import file="nbproject/build-impl.xml"/>
|
||||
<!--
|
||||
|
||||
There exist several targets which are by default empty and which can be
|
||||
used for execution of your tasks. These targets are usually executed
|
||||
before and after some main targets. They are:
|
||||
|
||||
pre-init: called before initialization of project properties
|
||||
post-init: called after initialization of project properties
|
||||
pre-preprocess: called before text preprocessing of sources
|
||||
post-preprocess: called after text preprocessing of sources
|
||||
pre-compile: called before source compilation
|
||||
post-compile: called after source compilation
|
||||
pre-obfuscate: called before obfuscation
|
||||
post-obfuscate: called after obfuscation
|
||||
pre-preverify: called before preverification
|
||||
post-preverify: called after preverification
|
||||
pre-jar: called before jar building
|
||||
post-jar: called after jar building
|
||||
pre-build: called before final distribution building
|
||||
post-build: called after final distribution building
|
||||
pre-clean: called before cleaning build products
|
||||
post-clean: called after cleaning build products
|
||||
|
||||
Example of pluging a my-special-task after the compilation could look like
|
||||
|
||||
<target name="post-compile">
|
||||
<my-special-task>
|
||||
<fileset dir="${build.classes.dir}"/>
|
||||
</my-special-task>
|
||||
</target>
|
||||
|
||||
For list of available properties check the imported
|
||||
nbproject/build-impl.xml file.
|
||||
|
||||
Other way how to customize the build is by overriding existing main targets.
|
||||
The target of interest are:
|
||||
|
||||
preprocess: preprocessing
|
||||
extract-libs: extraction of libraries and resources
|
||||
compile: compilation
|
||||
create-jad: construction of jad and jar manifest source
|
||||
obfuscate: obfuscation
|
||||
preverify: preverification
|
||||
jar: jar archive building
|
||||
run: execution
|
||||
debug: execution in debug mode
|
||||
build: building of the final distribution
|
||||
javadoc: javadoc generation
|
||||
|
||||
Example of overriding the target for project execution could look like
|
||||
|
||||
<target name="run" depends="init,jar">
|
||||
<my-special-exec jadfile="${dist.dir}/${dist.jad}"/>
|
||||
</target>
|
||||
|
||||
Be careful about correct dependencies when overriding original target.
|
||||
Again, for list of available properties which you can use check the target
|
||||
you are overriding in nbproject/build-impl.xml file.
|
||||
|
||||
A special target for-all-configs can be used to run some specific targets for
|
||||
all project configurations in a sequence. File nbproject/build-impl.xml
|
||||
already contains some "for-all" targets:
|
||||
|
||||
jar-all
|
||||
javadoc-all
|
||||
clean-all
|
||||
|
||||
Example of definition of target iterating over all project configurations:
|
||||
|
||||
<target name="jar-all">
|
||||
<property name="target.to.call" value="jar"/>
|
||||
<antcall target="for-all-configs"/>
|
||||
</target>
|
||||
|
||||
-->
|
||||
</project>
|
1368
nbproject/build-impl.xml
Normal file
1368
nbproject/build-impl.xml
Normal file
File diff suppressed because it is too large
Load Diff
8
nbproject/genfiles.properties
Normal file
8
nbproject/genfiles.properties
Normal file
@ -0,0 +1,8 @@
|
||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||
build.xml.data.CRC32=1f1288af
|
||||
build.xml.script.CRC32=67d25359
|
||||
build.xml.stylesheet.CRC32=03eab09b
|
||||
nbproject/build-impl.xml.data.CRC32=1f1288af
|
||||
nbproject/build-impl.xml.script.CRC32=9aa6b4ea
|
||||
nbproject/build-impl.xml.stylesheet.CRC32=a4fc63f1
|
7
nbproject/private/private.properties
Normal file
7
nbproject/private/private.properties
Normal file
@ -0,0 +1,7 @@
|
||||
#Wed Jun 23 19:30:10 EEST 2010
|
||||
netbeans.user=C\:\\Users\\aNNiMON\\.netbeans\\6.9m1
|
||||
javadoc.preview=true
|
||||
deployment.counter=19
|
||||
config.active=
|
||||
deployment.number=0.0.18
|
||||
app-version.autoincrement=true
|
4
nbproject/private/private.xml
Normal file
4
nbproject/private/private.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
|
||||
</project-private>
|
140
nbproject/project.properties
Normal file
140
nbproject/project.properties
Normal file
@ -0,0 +1,140 @@
|
||||
abilities=MMAPI=1.1,SATSAJCRMI=1.0,SATSACRYPTO=1.0,JSR82=1.1,NOKIAUI=1.0,JSR226=1.0,capuchin=1.0,MIDP=2.1,JSR229=1.1.0,SATSAAPDU=1.0,CLDC=1.1,JSR177=1.0,JSR179=1.0.1,eSWT=1.1,J2MEWS=1.0,VSCL=2.1,WMA=2.0,JSR172=1.0,JSR256=1.1,SEMC_EXT_JP8=1.0,ColorScreen,NokiaUI=1.0,OBEX=1.0,JSR238=1.0,JSR239=1.0,JSR211=1.0,JSR234=1.0,ScreenWidth=240,MascotV3=1.0,JSR75=1.0,IAPInfo=1.0,SATSAPKI=1.0,JSR184=1.1,ScreenHeight=321,ScreenColorDepth=8,JSR180=1.0.1,J2MEXMLRPC=1.0,
|
||||
all.configurations=\
|
||||
application.args=
|
||||
application.description=
|
||||
application.description.detail=
|
||||
application.name=
|
||||
application.vendor=Vendor
|
||||
build.classes.dir=${build.dir}/compiled
|
||||
build.classes.excludes=**/*.java,**/*.form,**/*.class,**/.nbintdb,**/*.mvd,**/*.wsclient,**/*.vmd
|
||||
build.dir=build/${config.active}
|
||||
build.root.dir=build
|
||||
debug.level=debug
|
||||
deployment.copy.target=deploy
|
||||
deployment.instance=default
|
||||
deployment.jarurl=${dist.jar}
|
||||
deployment.method=NONE
|
||||
deployment.override.jarurl=false
|
||||
dist.dir=dist/${config.active}
|
||||
dist.jad=Praiser.jad
|
||||
dist.jar=Praiser.jar
|
||||
dist.javadoc.dir=${dist.dir}/doc
|
||||
dist.root.dir=dist
|
||||
extra.classpath=
|
||||
filter.exclude.tests=false
|
||||
filter.excludes=
|
||||
filter.more.excludes=**/overview.html,**/package.html
|
||||
filter.use.standard=true
|
||||
jar.compress=true
|
||||
javac.debug=true
|
||||
javac.deprecation=false
|
||||
javac.encoding=UTF-8
|
||||
javac.optimize=false
|
||||
javac.source=1.3
|
||||
javac.target=1.3
|
||||
javadoc.author=false
|
||||
javadoc.encoding=
|
||||
javadoc.noindex=false
|
||||
javadoc.nonavbar=false
|
||||
javadoc.notree=false
|
||||
javadoc.private=false
|
||||
javadoc.splitindex=true
|
||||
javadoc.use=true
|
||||
javadoc.version=false
|
||||
javadoc.windowtitle=
|
||||
libs.classpath=
|
||||
main.class=
|
||||
main.class.class=applet
|
||||
manifest.apipermissions=
|
||||
manifest.file=manifest.mf
|
||||
manifest.jad=
|
||||
manifest.manifest=
|
||||
manifest.midlets=MIDlet-1: Praiser,/icons/1.png,Main\n
|
||||
manifest.others=MIDlet-Vendor: aNNiMON\nMIDlet-Name: Praiser\nMIDlet-Version: 1.0\n
|
||||
manifest.pushregistry=
|
||||
name=Praiser
|
||||
no.dependencies=false
|
||||
nokiaS80.application.icon=
|
||||
nsicom.application.monitorhost=
|
||||
nsicom.application.runremote=
|
||||
nsicom.application.runverbose=
|
||||
nsicom.remoteapp.location=\\My Documents\\NetBeans Applications
|
||||
nsicom.remotevm.location=\\Windows\\creme\\bin\\CrEme.exe
|
||||
obfuscated.classes.dir=${build.dir}/obfuscated
|
||||
obfuscation.custom=-keep public class * extends javax.microedition.midlet.MIDlet \n-obfuscationdictionary compact.txt\n-dontusemixedcaseclassnames
|
||||
obfuscation.level=1
|
||||
obfuscator.destjar=${build.dir}/obfuscated.jar
|
||||
obfuscator.srcjar=${build.dir}/before-obfuscation.jar
|
||||
platform.active=Sony_Ericsson_SDK_2_5_0_4_for_the_Java_TM__ME_Platform_Emulator_
|
||||
platform.active.description=Sony Ericsson SDK 2.5.0.4 for the Java(TM) ME Platform(Emulator)
|
||||
platform.apis=JSR234-1.0,SATSA-APDU-1.0,capuchin-1.0,JSR211-1.0,JSR75-1.0,J2ME-WS-1.0,J2ME-XMLRPC-1.0,JSR82-1.1,SATSA-JCRMI-1.0,SATSA-CRYPTO-1.0,JSR239-1.0,JSR179-1.0.1,MascotV3-1.0,JSR184-1.1,JSR238-1.0,MMAPI-1.1,JSR256-1.1,NokiaUI-1.0,IAPInfo-1.0,JSR229-1.1.0,SATSA-PKI-1.0,JSR180-1.0.1,JSR226-1.0,JSR177-1.0,SEMC_EXT_JP8-1.0,VSCL-2.0,VSCL-2.1,WMA-2.0,eSWT-1.1
|
||||
platform.bootclasspath=${platform.home}/lib/eswt.jar:${platform.home}/lib/mascotv3.jar:${platform.home}/lib/jsr226.jar:${platform.home}/lib/jsr256.jar:${platform.home}/lib/satsa-crypto.jar:${platform.home}/lib/jsr229.jar:${platform.home}/lib/jsr238.jar:${platform.home}/lib/j2me-xmlrpc.jar:${platform.home}/lib/jsr211.jar:${platform.home}/lib/vscl21.jar:${platform.home}/lib/satsa-jcrmi.jar:${platform.home}/lib/jsr082.jar:${platform.home}/lib/satsa-apdu.jar:${platform.home}/lib/jsr184.jar:${platform.home}/lib/nokiaext.jar:${platform.home}/lib/capuchin.jar:${platform.home}/lib/jsr239.jar:${platform.home}/lib/jsr75.jar:${platform.home}/lib/satsa-pki.jar:${platform.home}/lib/jsr179.jar:${platform.home}/lib/jsr180.jar:${platform.home}/lib/iapinfo.jar:${platform.home}/lib/vscl.jar:${platform.home}/lib/mmapi.jar:${platform.home}/lib/j2me-ws.jar:${platform.home}/lib/wma20.jar:${platform.home}/lib/jsr234.jar:${platform.home}/lib/semc_ext_jp8.jar:${platform.home}/lib/cldcapi11.jar:${platform.home}/lib/midpapi20.jar
|
||||
platform.configuration=CLDC-1.1
|
||||
platform.device=SonyEricsson_JP8_240x320_Emu
|
||||
platform.fat.jar=true
|
||||
platform.profile=MIDP-2.0
|
||||
platform.trigger=CLDC
|
||||
platform.type=UEI-1.0.1
|
||||
preprocessed.dir=${build.dir}/preprocessed
|
||||
preverify.classes.dir=${build.dir}/preverified
|
||||
preverify.sources.dir=${build.dir}/preverifysrc
|
||||
resources.dir=resources
|
||||
ricoh.application.email=
|
||||
ricoh.application.fax=
|
||||
ricoh.application.icon=
|
||||
ricoh.application.target-jar=
|
||||
ricoh.application.telephone=
|
||||
ricoh.application.uid=68313297
|
||||
ricoh.application.version=
|
||||
ricoh.dalp.application-desc.auto-run=false
|
||||
ricoh.dalp.application-desc.energy-save=
|
||||
ricoh.dalp.application-desc.exec-auth=
|
||||
ricoh.dalp.application-desc.visible=true
|
||||
ricoh.dalp.argument=
|
||||
ricoh.dalp.codebase=
|
||||
ricoh.dalp.display-mode.color=true
|
||||
ricoh.dalp.display-mode.is-4line-support=false
|
||||
ricoh.dalp.display-mode.is-hvga-support=true
|
||||
ricoh.dalp.display-mode.is-vga-support=false
|
||||
ricoh.dalp.display-mode.is-wvga-support=false
|
||||
ricoh.dalp.information.abbreviation=
|
||||
ricoh.dalp.information.icon.basepath=
|
||||
ricoh.dalp.information.icon.location=
|
||||
ricoh.dalp.information.is-icon-used=true
|
||||
ricoh.dalp.install.destination=hdd
|
||||
ricoh.dalp.install.mode.auto=true
|
||||
ricoh.dalp.install.work-dir=hdd
|
||||
ricoh.dalp.is-managed=true
|
||||
ricoh.dalp.resources.dsdk.version=2.0
|
||||
ricoh.dalp.resources.jar.basepath=
|
||||
ricoh.dalp.resources.jar.version=
|
||||
ricoh.dalp.version=
|
||||
ricoh.icon.invert=false
|
||||
ricoh.platform.target.version=
|
||||
run.cmd.options=
|
||||
run.jvmargs=
|
||||
run.method=STANDARD
|
||||
run.security.domain=trusted
|
||||
run.use.security.domain=false
|
||||
savaje.application.icon=
|
||||
savaje.application.icon.focused=
|
||||
savaje.application.icon.small=
|
||||
savaje.application.uid=TBD
|
||||
savaje.bundle.base=
|
||||
savaje.bundle.debug=false
|
||||
savaje.bundle.debug.port=
|
||||
semc.application.caps=
|
||||
semc.application.icon=
|
||||
semc.application.icon.count=
|
||||
semc.application.icon.splash=
|
||||
semc.application.icon.splash.installonly=false
|
||||
semc.application.uid=E5591813
|
||||
semc.certificate.path=
|
||||
semc.private.key.password=
|
||||
semc.private.key.path=
|
||||
sign.alias=
|
||||
sign.enabled=false
|
||||
sign.keystore=
|
||||
src.dir=src
|
||||
use.emptyapis=true
|
||||
use.preprocessor=true
|
10
nbproject/project.xml
Normal file
10
nbproject/project.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.kjava.j2meproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/j2me-project">
|
||||
<name>Praiser</name>
|
||||
<minimum-ant-version>1.6</minimum-ant-version>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
31
src/About.java
Normal file
31
src/About.java
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
import javax.microedition.lcdui.*;
|
||||
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @author aNNiMON
|
||||
*/
|
||||
public class About extends Form implements CommandListener {
|
||||
|
||||
private Command back;
|
||||
private Displayable prev;
|
||||
|
||||
public About(Displayable prev) {
|
||||
super("О программе");
|
||||
this.prev = prev;
|
||||
back = new Command("Назад", Command.SCREEN, 1);
|
||||
append(new Reader().readText("about"));
|
||||
addCommand(back);
|
||||
setCommandListener(this);
|
||||
}
|
||||
|
||||
public void commandAction(Command c, Displayable d) {
|
||||
if(c==back) Main.midlet.dsp.setCurrent(prev);
|
||||
}
|
||||
|
||||
}
|
172
src/Main.java
Normal file
172
src/Main.java
Normal file
@ -0,0 +1,172 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
import java.util.*;
|
||||
import javax.microedition.lcdui.*;
|
||||
import javax.microedition.midlet.*;
|
||||
|
||||
/**
|
||||
* @author aNNiMON
|
||||
* JP-7.3
|
||||
*/
|
||||
public class Main extends MIDlet implements CommandListener, ItemStateListener {
|
||||
|
||||
public static Main midlet;
|
||||
public Display dsp;
|
||||
private NativeUI nui;
|
||||
private Reader rdr;
|
||||
private Form f;
|
||||
private Timer timer;
|
||||
private Random rnd;
|
||||
private TextField user, ttime;
|
||||
private ChoiceGroup type, out, time;
|
||||
private Command ok, exit, about;
|
||||
private String[] msgtype, all;
|
||||
private int[] delay = new int[] {2,5,10,15,20,30,45,60,90};
|
||||
|
||||
public Main() {
|
||||
midlet=this;
|
||||
rdr = new Reader();
|
||||
timer = new Timer();
|
||||
rnd = new Random();
|
||||
ok = new Command("Ok", Command.OK, 1);
|
||||
exit = new Command("Выход", Command.EXIT, 2);
|
||||
about = new Command("О программе", Command.SCREEN, 3);
|
||||
dsp = Display.getDisplay(this);
|
||||
}
|
||||
public void startApp() {
|
||||
Rms.restoreOptions();
|
||||
if(Rms.firstStart) {
|
||||
Rms.isUIActivity = NativeUI.hasUIActivity();
|
||||
}
|
||||
f = new Form("Хвалитель 1.0");
|
||||
//Имя пользователя
|
||||
user = new TextField("Имя пользователя", Rms.userName, 40, TextField.ANY);
|
||||
//Время вывода сообщения
|
||||
time = new ChoiceGroup("Время вывода", Choice.POPUP);
|
||||
time.append("2 минуты", null);
|
||||
for(int i=1; i<delay.length; i++) {
|
||||
time.append(String.valueOf(delay[i])+" минут", null);
|
||||
}
|
||||
time.append("Указать своё", null);
|
||||
//time.append("В пределах: ", null);
|
||||
time.setSelectedIndex(Rms.tilbl, true);
|
||||
ttime = new TextField("Время (в минутах)", String.valueOf(Rms.ttime), 2, TextField.NUMERIC);
|
||||
//Тип сообщений
|
||||
msgtype = rdr.read("type");
|
||||
Rms.selectedArray = new boolean[msgtype.length];
|
||||
if(Rms.firstStart) {
|
||||
Rms.selectedArray[0] = true;
|
||||
for (int i=1; i<msgtype.length; i++) {
|
||||
Rms.selectedArray[i] = false;
|
||||
}
|
||||
}
|
||||
type = new ChoiceGroup("Тип сообщений", Choice.MULTIPLE, msgtype, null);
|
||||
type.setSelectedFlags(Rms.selectedArray);
|
||||
//Добавление в форму
|
||||
f.append(user);
|
||||
f.append(type);
|
||||
f.append(time);
|
||||
if(Rms.isUIActivity) {
|
||||
out = new ChoiceGroup("Выводить в", Choice.POPUP);
|
||||
out.append("Меню событий", null);
|
||||
out.append("Форма", null);
|
||||
f.append(out);
|
||||
}
|
||||
//Добавляем команды
|
||||
f.addCommand(ok);
|
||||
f.addCommand(exit);
|
||||
f.addCommand(about);
|
||||
f.setCommandListener(this);
|
||||
f.setItemStateListener(this);
|
||||
dsp.setCurrent(f);
|
||||
}
|
||||
|
||||
public void pauseApp() {
|
||||
Rms.saveOptions();
|
||||
}
|
||||
|
||||
public void destroyApp(boolean un) {
|
||||
if(Rms.firstStart) Rms.firstStart=false;
|
||||
Rms.saveOptions();
|
||||
notifyDestroyed();
|
||||
}
|
||||
|
||||
public void commandAction(Command c, Displayable d) {
|
||||
if(d==f) {
|
||||
if(c==ok) {
|
||||
dsp.setCurrent(null);
|
||||
long sheduletime;
|
||||
//Имя пользователя
|
||||
String str = user.getString();
|
||||
if(str.length()>0) Rms.userName = str;
|
||||
//Время
|
||||
Rms.tilbl = time.getSelectedIndex();
|
||||
if(Rms.tilbl<delay.length) sheduletime = delay[Rms.tilbl]*60000;
|
||||
else {
|
||||
sheduletime = Integer.parseInt(ttime.getString());
|
||||
//if(Rms.tilbl==delay.length && sheduletime==0) sheduletime = 1;
|
||||
Rms.ttime = (int) sheduletime;
|
||||
sheduletime*=60000;
|
||||
if(Rms.tilbl==delay.length && sheduletime==0) sheduletime = 30000;
|
||||
}
|
||||
//init
|
||||
if(Rms.isUIActivity && out.getSelectedIndex()==0) {
|
||||
nui = new NativeUI(this);
|
||||
}else{
|
||||
f.deleteAll();
|
||||
}
|
||||
//Тип
|
||||
String[] tmp;
|
||||
Vector v = new Vector();
|
||||
for(int i=0; i<msgtype.length; i++) {
|
||||
if(Rms.selectedArray[i] = type.isSelected(i)) {
|
||||
if(Rms.isUIActivity && out.getSelectedIndex()==0) nui.setIcon(String.valueOf(i+1));
|
||||
tmp = rdr.read(String.valueOf(i+1));
|
||||
for(int j=0; j<tmp.length; j++) {
|
||||
v.addElement(tmp[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
all = new String[v.size()];
|
||||
v.copyInto(all);
|
||||
if(all.length<=1) all = rdr.read("1");
|
||||
timer.schedule(new TimerTask() {
|
||||
public void run() {
|
||||
int idx = (rnd.nextInt() >>> 1)%all.length;
|
||||
String msg = Rms.userName + ", " + all[idx];
|
||||
if(Rms.isUIActivity && out.getSelectedIndex()==0) {
|
||||
if(msg.length()<=9) nui.setMessage(msg);
|
||||
else if(msg.length()<=24) nui.setMessage(msg.substring(0, 9), msg.substring(9));
|
||||
else nui.setMessage(msg.substring(0, msg.length()-15), msg.substring(msg.length()-15));
|
||||
|
||||
/*if(msg.length()<=9) nui.setMessage(msg);
|
||||
else if(msg.length()<=25) nui.setMessage(msg.substring(0, 9), msg.substring(9));
|
||||
else nui.setMessage(msg.substring(0, 9), msg.substring(9,25)+"\n"+msg.substring(25));*/
|
||||
f.deleteAll();
|
||||
f.append(msg);
|
||||
}else{
|
||||
f.deleteAll();
|
||||
f.append(msg);
|
||||
dsp.setCurrent(f);
|
||||
}
|
||||
}
|
||||
}, sheduletime, sheduletime);
|
||||
}else if(c==exit) destroyApp(true);
|
||||
else if(c==about) dsp.setCurrent(new About(f));
|
||||
}
|
||||
}
|
||||
|
||||
public void itemStateChanged(Item item) {
|
||||
if (item == time) {
|
||||
f.deleteAll();
|
||||
f.append(user);
|
||||
f.append(type);
|
||||
f.append(time);
|
||||
if(time.getSelectedIndex() >= delay.length) f.append(ttime);
|
||||
f.append(out);
|
||||
}
|
||||
}
|
||||
}
|
49
src/NativeUI.java
Normal file
49
src/NativeUI.java
Normal file
@ -0,0 +1,49 @@
|
||||
|
||||
import com.sonyericsson.ui.UIActivityMenu;
|
||||
import javax.microedition.lcdui.*;
|
||||
import javax.microedition.midlet.MIDlet;
|
||||
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @author aNNiMON
|
||||
*/
|
||||
public class NativeUI {
|
||||
|
||||
private UIActivityMenu uam;
|
||||
private Image icon;
|
||||
|
||||
public NativeUI(MIDlet m) {
|
||||
uam = UIActivityMenu.getInstance(m);
|
||||
}
|
||||
|
||||
public static boolean hasUIActivity() {
|
||||
try {
|
||||
Class.forName("com.sonyericsson.ui.UIActivityMenu");
|
||||
return true;
|
||||
} catch (ClassNotFoundException ex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void setIcon(String path) {
|
||||
icon = null;
|
||||
try {
|
||||
icon = Image.createImage("/icons/" + path + ".png");
|
||||
} catch (Exception ex) {
|
||||
icon = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
uam.addEvent(message, icon);
|
||||
}
|
||||
|
||||
public void setMessage(String title, String message) {
|
||||
uam.addEvent(title, message, icon, null);
|
||||
}
|
||||
}
|
80
src/Reader.java
Normal file
80
src/Reader.java
Normal file
@ -0,0 +1,80 @@
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.Vector;
|
||||
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @author aNNiMON
|
||||
*/
|
||||
public class Reader {
|
||||
|
||||
private char[] win1251;
|
||||
|
||||
public Reader() {
|
||||
win1251 = new char[] {
|
||||
'\u0410', '\u0411', '\u0412', '\u0413', '\u0414', '\u0415', '\u0416',
|
||||
'\u0417', '\u0418', '\u0419', '\u041A', '\u041B', '\u041C', '\u041D',
|
||||
'\u041E', '\u041F', '\u0420', '\u0421', '\u0422', '\u0423', '\u0424',
|
||||
'\u0425', '\u0426', '\u0427', '\u0428', '\u0429', '\u042A', '\u042B',
|
||||
'\u042C', '\u042D', '\u042E', '\u042F', '\u0430', '\u0431', '\u0432',
|
||||
'\u0433', '\u0434', '\u0435', '\u0436', '\u0437', '\u0438', '\u0439',
|
||||
'\u043A', '\u043B', '\u043C', '\u043D', '\u043E', '\u043F', '\u0440',
|
||||
'\u0441', '\u0442', '\u0443', '\u0444', '\u0445', '\u0446', '\u0447',
|
||||
'\u0448', '\u0449', '\u044A', '\u044B', '\u044C', '\u044D', '\u044E',
|
||||
'\u044F'
|
||||
};
|
||||
}
|
||||
|
||||
public String[] read(String path) {
|
||||
return threshold(getText(getClass().getResourceAsStream("/data/"+path)));
|
||||
}
|
||||
|
||||
public String readText(String path) {
|
||||
return getText(getClass().getResourceAsStream("/data/"+path));
|
||||
}
|
||||
|
||||
private String[] threshold(String s)
|
||||
{
|
||||
Vector ml = new Vector();
|
||||
int len = s.length();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for(int i = 0; i < len; i++) {
|
||||
int c = s.charAt(i);
|
||||
if(c == '\n') {
|
||||
if(sb.length() > 0) {
|
||||
ml.addElement(sb.toString().trim());
|
||||
sb = new StringBuffer();
|
||||
}
|
||||
}else{
|
||||
sb.append((char)c);
|
||||
}
|
||||
}
|
||||
if(sb.length() > 0) ml.addElement(sb.toString().trim());
|
||||
String[] m;
|
||||
m = new String[ml.size()];
|
||||
ml.copyInto(m);
|
||||
return m;
|
||||
}
|
||||
|
||||
private String getText(InputStream is) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
int ch = 0;
|
||||
try {
|
||||
while ((ch = is.read()) != -1) sb.append(decodeWinChar((byte)ch));
|
||||
} catch (Exception e) {e.printStackTrace();}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private char decodeWinChar(byte b) {
|
||||
int ich = b & 0xff;
|
||||
if (ich == 0xb8) return 0x0451;// ё
|
||||
else if (ich == 0xa8) return 0x0401;// Ё
|
||||
else if (ich >= 0xc0) return win1251[ich-192];
|
||||
return (char)ich;
|
||||
}
|
||||
}
|
68
src/Rms.java
Normal file
68
src/Rms.java
Normal file
@ -0,0 +1,68 @@
|
||||
|
||||
import java.io.*;
|
||||
import javax.microedition.rms.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author aNNiMON
|
||||
*/
|
||||
public class Rms {
|
||||
|
||||
private static final String rmsName = "Praiser";
|
||||
private static RecordStore rmsStore;
|
||||
public static boolean firstStart = true;
|
||||
public static boolean isUIActivity = true;
|
||||
public static boolean[] selectedArray;
|
||||
public static String userName = "Пользователь";
|
||||
public static int ttime = 10;
|
||||
public static int tilbl = 2;
|
||||
|
||||
public static void saveOptions() {
|
||||
if (rmsStore != null) {
|
||||
byte[] options = null;
|
||||
try {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
DataOutputStream dos = new DataOutputStream(baos);
|
||||
dos.writeBoolean(firstStart);
|
||||
dos.writeBoolean(isUIActivity);
|
||||
dos.writeUTF(userName);
|
||||
dos.flush();
|
||||
options = baos.toByteArray();
|
||||
dos.close();
|
||||
rmsStore.setRecord(1, options, 0, options.length);
|
||||
} catch (InvalidRecordIDException ridex) {
|
||||
try {
|
||||
rmsStore.addRecord(options, 0, options.length);
|
||||
} catch (RecordStoreException ex) {
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
if (rmsStore != null) {
|
||||
try {
|
||||
rmsStore.closeRecordStore();
|
||||
rmsStore = null;
|
||||
} catch (RecordStoreException ex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void restoreOptions() {
|
||||
try {
|
||||
rmsStore = RecordStore.openRecordStore(rmsName, true);
|
||||
} catch (RecordStoreException ex) {
|
||||
rmsStore = null;
|
||||
}
|
||||
if (rmsStore != null) {
|
||||
try {
|
||||
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(rmsStore.getRecord(1)));
|
||||
firstStart = dis.readBoolean();
|
||||
isUIActivity = dis.readBoolean();
|
||||
userName = dis.readUTF();
|
||||
dis.close();
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
59
src/data/1
Normal file
59
src/data/1
Normal file
@ -0,0 +1,59 @@
|
||||
Вы гениальны!
|
||||
Вы так умны...
|
||||
доброго времени суток!
|
||||
Вы неотразимы!
|
||||
с Вас нужно брать пример!
|
||||
на Вас всегда можно положиться
|
||||
+стопяццот
|
||||
на Вас молиться надо
|
||||
дайте автограф пожалуйста :)
|
||||
нажмите на меня :)
|
||||
хотите анекдот? Я тоже...
|
||||
помнится, Вы тогда так отожгли... Хех)
|
||||
Вы - гений!
|
||||
какие у Вас красивые глаза...
|
||||
да Вы круты)))
|
||||
какое у вас имя красивое...
|
||||
сегодня Ваш день
|
||||
красава)
|
||||
Вы на правильном пути
|
||||
Великолепно!
|
||||
у Вас всё получается
|
||||
правильно!
|
||||
это хорошо
|
||||
супер!
|
||||
превосходно!
|
||||
Вы делаете это очень хорошо
|
||||
я горжусь Вами
|
||||
Вы делаете это лучше всех
|
||||
Вы близки к истине
|
||||
мои поздравления!
|
||||
это то, что надо!
|
||||
Вы быстро учитесь :)
|
||||
это получается у Вас всё лучше и лучше
|
||||
прекрасно!
|
||||
а это идея!
|
||||
сенсационно
|
||||
теперь Вас никто не остановит!
|
||||
Вы поработали на славу
|
||||
фантастика!
|
||||
Вы так успешны...
|
||||
ужасно здорово!
|
||||
Вы, наверное, долго практиковались?
|
||||
Вы так много сделали!
|
||||
Вы правы!
|
||||
поздравляю!
|
||||
так держать!
|
||||
мне очень нравится ход Ваших мыслей
|
||||
СПАСИБО!!!
|
||||
Вы превзошли сами себя
|
||||
вот этого я ещё не видел
|
||||
какие у тебя правильные мысли
|
||||
я от Вас в восторге!
|
||||
я ослеп от твоей неотразимости!
|
||||
весь мир скоро будет у Ваших ног!
|
||||
Царь!
|
||||
Русь-Матушка тебя будет помнить долго!
|
||||
да о тебе можно сказки писать!
|
||||
двенадцать из пяти!!
|
||||
твёрдая ПЯТЬ!
|
35
src/data/2
Normal file
35
src/data/2
Normal file
@ -0,0 +1,35 @@
|
||||
Вы прекрасны как червь
|
||||
фу, как так можно???
|
||||
эх, ты...:((
|
||||
ну что там еще??
|
||||
не правильно
|
||||
вообще не то что нужно
|
||||
да так никто не делает!
|
||||
Вы плохо поступили
|
||||
Вы не правы
|
||||
Вы не правы, как всегда...
|
||||
да кто Вы такой???
|
||||
правильно, Вы - никто
|
||||
мисс красота помойки 1953 года ;)
|
||||
да ты конь!!!
|
||||
минус тебе, минус
|
||||
я б убил бы Вас...
|
||||
да посмотрите на кого Вы похожи??
|
||||
хаха, обезьяна
|
||||
от Вас дурно пахнет...
|
||||
от Вас все отвернулись
|
||||
Вы кому-то нужны?
|
||||
Вы кому-то нужны? Не думаю.
|
||||
Вы хоть что-нибудь полезное сделали??
|
||||
это гадко!
|
||||
Вы отвратительны!
|
||||
мне не приятно с Вами находится
|
||||
не держи меня в руках! отдай хорошему человеку!
|
||||
не смотри на меня так!
|
||||
руки хотя бы помой...
|
||||
ты отстой!
|
||||
нулячий поступок...
|
||||
на двоечку...
|
||||
не суй свой нос не в своё дело!
|
||||
я и без тебя знаю!
|
||||
это не есть good!
|
41
src/data/3
Normal file
41
src/data/3
Normal file
@ -0,0 +1,41 @@
|
||||
я так люблю Вас!
|
||||
<3
|
||||
Вас все обожают.
|
||||
все балдеют от тебя
|
||||
да-да, Вы прекрасны!
|
||||
Вы, само очарование
|
||||
очаровашка
|
||||
я без ума от тебя
|
||||
смотри, все тебя любят
|
||||
если бы Вы были телефоном - мы были бы женаты))
|
||||
если бы я был человеком - мы были бы женаты)
|
||||
Вы как всегда прекрасны
|
||||
Вы как всегда прекрасны и любимы
|
||||
ангел - это Вы
|
||||
Вы ангел
|
||||
в мире никого так раньше не любили, как Вас
|
||||
любовь начинается с тебя
|
||||
люблю тебя, люблю, люблю, люблю...
|
||||
я вас полюбил еще до того как увидел!
|
||||
природа Вас любит
|
||||
смотри, это всё для тебя!
|
||||
весь мир для тебя!
|
||||
это не Вам ли я сердце дарил?
|
||||
Ваше сердце открыто для любви!
|
||||
14 февраля отныне Ваш день!
|
||||
ты теперь будешь во всех книгах о прекрасной любви!
|
||||
я люблю тебя больше жизни!
|
||||
Вы тот человек, кому можно отдать сердце!
|
||||
можно я Вас поцелую?
|
||||
оглянись, они все тебя любят!!
|
||||
я хочу с Вами встречаться!
|
||||
поделитесь со мной любовью =)
|
||||
Я ХОЧУ ТЕБЯ!!!!
|
||||
я бы всё ради тебя отдал!
|
||||
я бы всё отдал, лишь бы заслужить твою любовь.
|
||||
у тебя прекрасные глаза.
|
||||
я влюблён в твои глаза!
|
||||
ангелочек с красивыми глазками <3
|
||||
твоя улыбка... :)
|
||||
твоя улыбка прекрасна
|
||||
твои губы такие... ммм...
|
21
src/data/4
Normal file
21
src/data/4
Normal file
@ -0,0 +1,21 @@
|
||||
я тебя ненавижу!
|
||||
Вы предали всех!
|
||||
НЕ-НА-ВИ-ЖУ!!!
|
||||
как Вы могли???(((
|
||||
Вы растоптали мне сердце
|
||||
Вы - изверг!
|
||||
Вы - извращенец!
|
||||
как Вы могли так поступить????
|
||||
неужели Вас все разлюбили?
|
||||
Вас все разлюбили!
|
||||
да Вас и не любили никогда!
|
||||
все тебя ненавидят!
|
||||
все тебя ненавидят! Я тоже.
|
||||
уходите прочь, Вы причиняете всем боль!
|
||||
уйди прочь!
|
||||
никогда тебя не любил...
|
||||
ты - ноль
|
||||
тебя не любят
|
||||
Вы никому не нужны...
|
||||
тут тебе не место
|
||||
устал от тебя...
|
25
src/data/5
Normal file
25
src/data/5
Normal file
@ -0,0 +1,25 @@
|
||||
да мне всё равно
|
||||
я тоже так могу
|
||||
ни рыба ни мясо
|
||||
так себе
|
||||
50 на 50
|
||||
на троечку
|
||||
так все могут
|
||||
и что?
|
||||
и что дальше?
|
||||
а разницы???
|
||||
мне плевать
|
||||
тоже не выход.
|
||||
да! Хотя...
|
||||
врядли...
|
||||
ой, даже не знаю...
|
||||
возможно, но маловероятно
|
||||
да мне пофиг
|
||||
как бы не так...
|
||||
средне
|
||||
мне плевать на то, что ты делаешь!
|
||||
ты пока говори, а я посплю...
|
||||
мне безразлично на это..
|
||||
да могли бы и не смотреть сюда
|
||||
и да, и нет!
|
||||
я бы и без тебя справился
|
10
src/data/about
Normal file
10
src/data/about
Normal file
@ -0,0 +1,10 @@
|
||||
Praiser 1.0 от 23.06.2010
|
||||
|
||||
Автор: aNNiMON
|
||||
Автор идеи: Devey
|
||||
Автор компьютерной версии: miha
|
||||
Сайт разработчика: http://annimon.z83.ru/
|
||||
Сайт разработчика компьютерной версии: http://magazine-user.narod.ru/
|
||||
|
||||
Программа-прикол, через заданный промежуток времени выводит сообщение, тип которого тоже выбирается.
|
||||
Также возможно редактирование стандартных списков, все они лежат в папке data в архиве программы.
|
5
src/data/type
Normal file
5
src/data/type
Normal file
@ -0,0 +1,5 @@
|
||||
Хвальба
|
||||
Унижение
|
||||
Любовь
|
||||
Ненависть
|
||||
Безразличие
|
BIN
src/icons/1.png
Normal file
BIN
src/icons/1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 526 B |
BIN
src/icons/2.png
Normal file
BIN
src/icons/2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 457 B |
BIN
src/icons/3.png
Normal file
BIN
src/icons/3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 424 B |
BIN
src/icons/4.png
Normal file
BIN
src/icons/4.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 497 B |
BIN
src/icons/5.png
Normal file
BIN
src/icons/5.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 465 B |
Loading…
Reference in New Issue
Block a user