peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@Majestics man when will you learn that proper problem description is like 75% probability of someone answering your question quickly and with explanation you looking for.
As for your question, yes there is way to control Android application life cycle, and it does depend on Intent (there is/was very good explanation in Professional Android 2 Application Development By Reto Meier chapter 5 - Intents, Broadcast Receivers, Adapters and Internet, but chapter availability depends on Google decision)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@john_beginner database does normally reside in /data/data directory. You can access it either from connected device or emulator by use of adb tool. Simple example of usage can be found here http://books.google.com/books?id=RuN0jb4YASwC&lpg=PP1&dq=pro%20android%203&pg=PA92#v=onepage&q&f=false (link is from book Pro Android 3 - Chapter 4: Understanding Content providers pg.92-96)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

1) Similar principle as used on servlets can be used on pages (sorry can't help more as I'm going away till Tuesday, but if you search for JSP URL mapping you should find something useful)

2) Same way as you get connection for your login page through data manager do it any other servlet where you need to communicate with database (one of the reason why it was put in separate class to avoid duplication of whole DB connect and close in every servlet that may have need for connectivity)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@Sadun89 forum rules require you use proper English. Either start typing properly or find some to teach you

@anand01 you can find working example of mapping in this post

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Why don't you get count at the beginning, store it in a variable and then simple refer to it instead of running query every time you refresh view.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

http://www.java2s.com/Code/Java/Swing-Components/AutocompleteComboBox.htm

I have used the example listed here. It work fine upto 100 items. but when i increase items to 1000 or above it speed get super slow, even my processor is 2.66 C2Q , so what i will expect from pentium 4 having 512 ram ... Major issue is performance... Any idea to enhance it????

And thank you for the above link...... You are a nice friend of mine... In todays world people like you are very rare...

If I see someone implementing such thing I'm ready to commit homicide. If you want to implement something like that then there is something seriously wrong with your design(side reading would be some article or book on HCI {Human_computer interaction}).
If you can explain what you trying to achieve we may come up with some more pleasant solution, example text box populating table in scroll pane, that is activated only when you type 3 or more letters, table get refreshed as you type more letters which will narrow search results...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Here is a link to an example solution

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Thanks guys :)

If you want to thank them properly you may want to up-vote their replies, and most importantly mark thread as solved, which is bellow of last post in section marked as "Has this thread been answered?" in large purple letters

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Nokia N81 specifications says that it is what you need

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Solution 1, use try and catch as mentioned previosly

private double Doublify(EditText editText){
     try {
       return Double.parseDouble(input.getText().toString());
     } catch (NumberFormatException e) {
        return 0;
     }
 }

Solution 2, configure EditText to accept numbers only

<EditText android:inputType="numberDecimal" />

by declaring inputType

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Well either you are entering non-numeric value and that is triggering exception or you are not able retrieve text input therefore input.getText().toString return null and that cause exception. Since you did not post enough code I can't say for sure what is wrong

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Most commonly know as observer pattern (Head First Design Pattern, very handy book for fresh developers)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

1. Your above post was moved from Java to Mobile Development, I do not understand why you posting there
2. As expected your are completely ignoring that parseDouble or valueOf can actually trow NumberFormatException.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Exact error that you get would be nice. Without it it is just guess work

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

There been some changes with Hibernate 3.5 and 3.6 so in many cases following many online tutorials will get you in trouble. My quick take on the problem:

  • With 3.5 and higher there is no more need for hibernate-annotations dependency as this is now packages as part of hibernate-core (check Hibernate documentation for setup and configuration)
  • With 3.6 AnnotationConfiguration is deprecate and you need to replace it with Configuration
    So previously used HibernateUtil class looking like
    import org.hibernate.SessionFactory;
    import org.hibernate.cfg.AnnotationConfiguration;
    
    public class HibernateUtil {
    
        private static final SessionFactory SESSION_FACTORY = buildSessionFactory();
    
        private static SessionFactory buildSessionFactory() {
            try {
                return new AnnotationConfiguration().configure().buildSessionFactory();
            } catch (Throwable ex) {
                throw new ExceptionInInitializerError(ex);
            }
        }
    
        public static SessionFactory getSessionFactory() {
            return SESSION_FACTORY;
        }
    }

    now looks as

    import org.hibernate.SessionFactory;
    import org.hibernate.cfg.Configuration;
    
    public class HibernateUtil {
    
        private static final SessionFactory SESSION_FACTORY = buildSessionFactory();
    
        private static SessionFactory buildSessionFactory() {
            try {
                return new Configuration().configure().buildSessionFactory();
            } catch (Throwable ex) {
                throw new ExceptionInInitializerError(ex);
            }
        }
    
        public static SessionFactory getSessionFactory() {
            return SESSION_FACTORY;
        }
    }
  • In case of following error
    java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/MetadataProvider

    make sure that you are not using

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-commons-annotations</artifactId>
        <version>3.3.0.ga</version>
    </dependency>

    that is reported as release by mistake with some bugs, but rather use

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-commons-annotations</artifactId>
        <version>3.2.0.Final</version>
    </dependency>
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Well then post your session coding attempt and I'm sure someone will look at it. Without code we are just hypothetically talking about issue... not really productive

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Ahhh this is why I wasn't aware of it (still on 3.3.2 ), there are some additional library now need it. Check this out

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Try to use this HibernateUtil

public class HibernateUtil {

    private static final SessionFactory SESSION_FACTORY = buildSessionFactory();

    private static SessionFactory buildSessionFactory() {
        try {
            return new AnnotationConfiguration().configure().buildSessionFactory();
        } catch (Throwable ex) {
            throw new ExceptionInInitializerError(ex);
        }
    }

    public static SessionFactory getSessionFactory() {
        return SESSION_FACTORY;
    }
}
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You would have to use some custom look & feel library as default available look&feel are dependent/influenced by underlying OS. There was for example Apple look and feel with Quaqua

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Session

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Get hosting plan with some company, create WAR/EAR file, deploy on hosted server

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Taken that aman rathi did not come back on this for last 2 days, arguing about minor details is pointless.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

What you mean by custom menu? Different look&feel? Different behaviour?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Thread closed as original poster doesn't show any interest in topic just expect spoon feeding.

Do provide evidence of having done some work yourself if posting questions from school or work assignments

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

k sir ,

i got it, am new donknow the rules... but am explained everylines in the above example...

Forum rules is first thing you should always check when joining any forum, it tell you what is expected of you and what you shouldn't do.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Ok I will take your word on it.
From above code nothing doesn't seems to be wrong. Can you post more of code? Your button handling? Array manipulation?

PS: I would recommend to use Vector as with array it is always size restriction battle

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Please post your latest code. Given that you asked this question 17 days ago there must been some changes to code, so we do not want to code something that you will come back moaning that you do not know how to use. Secondly it will show that you actually been trying to work on it and not just simply waiting for solution from us.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Not having experience in network programming, but playing games for me logical approach would be to look on commonly used socket by commercial game companies Activision, EA or similar as usually they can get their game set without change to firewall rules (for many security products).
If that doesn't work, then obvious approach would be include in your installation/readme file requirement for changing firewall or enabling XYZ application to access/receive internet connection
(Hoping for someone else inside view as this is interesting question)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Waste of time to give you any help, you just want to get solution without closing thread and saying thank you

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Google = >> Java random number tutorial and you get this explanation of usage(at the bottom). Next time please search before you post such basic question

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

1) Bad idea to reopen old thread
2) Little search and less excuses of being new and you would have found this code

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

They both fast track, first is for new comers to Java development, the second is targeting sort of experienced developers

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@Muralidharan.E

"We can remove particular object without using iterator also, In case if we dont know the size/contents of arraylist, then it is better to use iterator to avoid exception. So you have used iterator. Am i right peter_budo ? Or any other advantage is there to use Iterator in this scenario?"


Your approach would work properly only in case that you have no duplicates in collection so it would be safe to use in combination of any class implementing Set where there would be no duplicates. However in "raw" manner as you have now if you add second element ( Arrays.asList(23, 43, 40, 10, 43) )with same value you will only remove first instance

Muralidharan.E commented: Fine +3
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Very easy and fast start is Head First Servlet & JSP, then you may consider Pro JSP 2

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

That is one of the reasons I personally that website. They will take (more of stealing) someone else tutorial and fail to acknowledge it and include any related resources. Your application is looking for resources, you need to get some other files and replace these mentioned in code

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Use Iterator class

import java.util.*;

public class ArrayTest{

	public static void main(String[] args){
		List<Integer> numbers = new ArrayList<Integer>(Arrays.asList(23, 43, 40, 10));
		System.out.println("BEFORE DELETE " + numbers);
		for (Iterator<Integer> iterator = numbers.iterator(); iterator.hasNext();) {
		  Integer number = iterator.next();
		  if (number == 43) {
		      iterator.remove();
		  }
		}
		System.out.println("AFTER DELETE " + numbers);
	}
}
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

OK, I will need to see code to know what is happening. Can you post your code?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

1. You do want to submit form data from JSP page to servlet for processing and let servlet do what is supposed to do
2. Tool used for the task doesn't matter (posting that I want to do in NetBeans, Eclipse etc is just immature)
3. You may want to look at simple sample from top of this forum section JSP database connectivity according to Model View Controller (MVC) Model 2
4. To learn more get your hands on some good book like one of these mentioned in this post

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Can you please attach screen shot of the issue, just to be sure what we are talking about

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Possible is that you are using only Build Main Project(F11), where you should use Clean and Build Main Project(Shift+F11)

J-Dub commented: helped +1
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Is there any ide that could be used to make Java files for Android? It would be nice if you could test it out using the ide, if not then if there would be an Android emulator it would also be nice.

As mentioned in this post from Starting mobile development on top of the section, there are IDEs (Eclipse and IntelliJ)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Your question doesn't make sense. Project basic structure is usually generated by IDE or by Ant if you know how.

  • Project
    • src (java files)
    • res (folder containing resources drawable, animation, layout, menu, values etc)
    • AndroidManifest.xml
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Android API Display.getSize()

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

What is the main benifit of using GWT in web applications?
>> For me no need to do all low level Ajax/JavaScript hacking

Is there any popular sites which has been developed by using GWT?
>> Little out of date article, but you can see few names there

Which is the best website to learn about GWT with easy examples?
>> I used official tutorial that gave me quick start, after that API is your friend (or you can invest in some book)

Muralidharan.E commented: Usefull Links +1
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Thanx for sharing KadajXII

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

1) Welcome to form
2) It is rude to hijack someone else question with your own question
3) Post moved
4) Use TextField.PASSWORD | TextField.NUMERIC

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Here is a list of Java Flash open source projects maybe you can find something suitable there.
From my point of view I was only interested in Project Capuchine, that was to get flash on JME platform, plus little of Java-Flex stuff

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I'm not really keen on Flash in Android, but here you go. http://www.gotoandlearn.com/ has number of videos with tutorials, also there is new book in shops Flash Development for Android Cookbook that looks rather promissing

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

OK I'm corrected them, for some reason they got truncated, they are all tutorials

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster