peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Not aware that PhoneGap has support for Sinhala, and neither Android supports it naitivelly as far I'm aware

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Did you use NetBeans wizard to setup project or you manually set it up? What server you use? (Tomcat, GlassFish, Jetty,JBoss)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Connect your phone with IDE(IntelliJ or Eclipse) or use DDMS tool

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Check exceptions and error log and post it back

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Yes, especialy since Android keep history when you move backwards

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

But my team lead asked me to reduce the number of classes because it effects the speed.

Could it be that he asked you to minimize number of classes where the array is passed through before used instead of reducing actual class count of the project?

Without knowing more about project, what sort of data are passed around and for what reason, it would be pointless to give some definetive answer.

If data are static you may want to place them in resource folder as array, if they dynamic, provided by user, you may consider use of SharedPreferences or database.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

No it doesn't. What it make slow is complex nested if-else statements

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I'm gone be rude and say: Why the hell you want to use Hibernate if you still place database connectivity code into JSP instead of Java class where it bellongs? Learn first proper MVC approach and add new frameworks

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

How can you have hashed password in database if you inserting with sql query plain text you got from user? (See end of the query)

String SQLQuery = "INSERT INTO Users(FirstName , MiddleName , LastName , Age , MobileNumber , Gender , City , EMail , Username , Password) VALUES ('" + FirstName + "' , '" + MiddleName + "' , '" + LastName + "' , '" + Age +"' , '" + MobileNumber + "' , '" + Gender +"' , '" + City + "' , '" + EMail + "' , '" + Username + "' , '" + Password + "')";

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Somebody configured server you trying to use and set it. That someone said when I call server1:81 I'm calling IP 192.168.0.1 (just example). It is like daniweb.com is actually 74.53.219.188. So find IP of that server for the network and use IP of it.

Sorry for confusion, but I misread your original post and asumed that we are talking about local server

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You need to provide IP of the machine on which server is running, and not some fictional IP that people mentioned on internet as example. When you get that IP you will be able to call localhost:8080/index.html as for example 192.168.0.1:8080/index.html

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Working in Android dev company, none of us have any certification. Our learning came purely from books, hacking on pet or open souerce projects.
There seem to be some wave of hype in Asia, more specifically Bangladesh, India, Pakistan that some companies are offering Android certification which in reality is more of course with some quez hacked together at the ned, but is is useles in western world.
Personally I think that experience of any size is worth more then certificate

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Is 10.0.0.2 what your ipconfig command returned in terminal? I would have expected something along the line of 192.168.1.x where x can be any number between 0-255.
Bellow is output from my Mac, en1 one shows that my IP on wireless network is 192.168.1.7

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    inet6 ::1 prefixlen 128 
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
    inet 127.0.0.1 netmask 0xff000000 
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 60:fb:42:f0:47:e4 
    media: autoselect
    status: inactive
fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078
    lladdr 60:fb:42:ff:fe:f0:47:e4 
    media: autoselect <full-duplex>
    status: inactive
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 00:26:bb:15:5c:e0 
    inet6 fe80::226:bbff:fe15:5ce0%en1 prefixlen 64 scopeid 0x6 
    inet 192.168.1.7 netmask 0xffffff00 broadcast 192.168.1.255
    media: autoselect
    status: active
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You need to give it your machine local IP not localhost or 127.0.0.1

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Well then you have to use anything above 4.0. Be aware emulators at this stage are very slow if you do not set them right

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
  1. Welcome back
  2. Disapointed to see that you are still using old ways (query string as add on of content instead of PreparedStatement, generating HTML inside servlet)
  3. Hashing password simple

    private String hashPassword(String password) {
      String hashword = null;
      try {
        MessageDigest md5 = MessageDigest.getInstance("MD5");
        md5.update(password.getBytes());
        BigInteger hash = new BigInteger(1, md5.digest());
        hashword = hash.toString(16);
    
      } catch (NoSuchAlgorithmException nsae) {
        //Log exception}
      return hashword;
    }
    

PS: I'm not doing web development any more, moved to Android world so I may not be so helpful in future...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

If you are using smulator prior 4.0 you will get this. Quite lot of similar based question on stackoverflow. Are you using real device or some emulator?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Did you set permissions in AndroidManifest?

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Sorry Windows development is not my forte

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You need to explain more in details what sort of data management/transfer you need. Often simple server request with return of JSON object is good approach

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Not really. The guy just created custom component that extends Fragment, so that is why you still able to pass some of the android paramenters, and then there are some custom things like colour of the tab, tab height that you could still manipulate through android params but it would be complicated and he provided easier way where you pass what you wish to change and all the stuff is handled internaly

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I wasn't aware of CalendarView that is available since version 3.0. From what I read this is not available to lower version as it is not part of so called Support Package unlike fragments and other stuff.

As for previous question, yes you can bring it to your project, just copy Java source files and include resources from original projects and then call them in your project as you need

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You should start reading more API documentation instead of trying to hack away solution from code you will find on internet as you are missing basic concepts. AsyncTask and Loader already acomodate threading, secondly while they are doing something you are able to show progress bar or any custom loading screen. Once data obtained you can on finish of either of them stop what ever notification you showed to user in mean time

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Yes and no. You may use some of the already available projects that been turned to libraries that can be included in the project or do your own coding like did this guy

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Telling layout manager that there is custom schema that is defined somewhere and swipeytabs will be used as reference signature to access it, like it is done just few lines bellow

swipeytabs:bottomBarColor="#ff96aa39"
swipeytabs:bottomBarHeight="2dip"
swipeytabs:tabIndicatorHeight="3dip"
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You can use either AsyncTask or even better Loader (unlike AsyncTask Loader is not restarted on orientation change that does trigger multiple requests) to to manage downloading process and in same time to indicate to user that this is downloaded content and it will be displayed once finished

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Read this for better solution

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You will have to create your own custom component/dialog, hence above is not used in any android forms. The only implementation is Calendar application, but that is application not a single component to just add to form and select date. If you insist on something like that consider use table or grid layout

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Have button or image button click event invoke DatePickerDialog or extend DialogFragment if using fragments and build own date picker (plenty of examples on the web)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Can you explay what you trying to do? I ask because getLocalActivityManager() is returning deprecated class LocalActivityManager that you shouldnot really use. You should replace it with fragments

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Exactly, that is the whole magic ;)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

SharedPreferences is what you looking for. Before leaving activity A save data in preferences and then in activity B read it out

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Should be possible with one of these mobile cross-platform frameworks like PHoneGap, rhomobile etc, but be warned that there aren't many free/open source, you will need to buy licence

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Here is quick leg-up. From code bellow you can see I used onClick parameter in layout. This will call same method for update, but may get heairy in adding more functionality to handle mathematical operations. So you may consider using listeners as I will show at the end where inside the onClick method you will provide logic for what ever has to happen

layout

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
        >
    <EditText
            android:id="@+id/display"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="0"
            android:gravity="right"
            />
    <TableLayout
            android:layout_height="fill_parent"
            android:layout_width="fill_parent"
            android:weightSum="4">
        <TableRow
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:layout_weight="1"
                android:weightSum="4">
            <Button
                    android:id="@+id/button1"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:text="1"
                    android:layout_weight="1"
                    android:onClick="updateDisplay"
                    />

            <Button
                    android:id="@+id/button2"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:text="2"
                    android:onClick="updateDisplay"
                    />

            <Button
                    android:id="@+id/button3"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:text="3"
                    android:onClick="updateDisplay"
                    />

            <Button
                    android:id="@+id/button_plus"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:text="+"
                    android:onClick="updateDisplay"
                    />
        </TableRow>
        <TableRow
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:layout_weight="1"
                android:weightSum="4">
            <Button
                    android:id="@+id/button4"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:text="4"
                    android:onClick="updateDisplay"
                    />

            <Button
                    android:id="@+id/button5"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:text="5"
                    android:onClick="updateDisplay"
                    />

            <Button
                    android:id="@+id/button6"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:text="6"
                    android:onClick="updateDisplay"
                    />

            <Button
                    android:id="@+id/button_minus"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:text="-"
                    android:onClick="updateDisplay"
                    />
        </TableRow>
        <TableRow
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:layout_weight="1"
                android:weightSum="4">
            <Button
                    android:id="@+id/button7"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:text="7"
                    android:onClick="updateDisplay"
                    />

            <Button
                    android:id="@+id/button8"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:text="8"
                    android:onClick="updateDisplay"
                    />

            <Button
                    android:id="@+id/button9"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:text="9"
                    android:onClick="updateDisplay"
                    />

            <Button
                    android:id="@+id/button_times"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:text="*"
                    android:onClick="updateDisplay"
                    />
        </TableRow>
        <TableRow
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:layout_weight="1"
                android:weightSum="4">
            <Button
                    android:id="@+id/button0"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:text="0"
                    android:onClick="updateDisplay"
                    />

            <Button
                    android:id="@+id/button_equals"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:text="="
                    android:onClick="updateDisplay"
                    />

            <Button
                    android:id="@+id/button_divide"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:text="/"
                    android:onClick="updateDisplay"
                    />

            <Button
                    android:id="@+id/button_clear"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1"
                    android:text="CE"
                    android:onClick="updateDisplay"
                    />
        </TableRow>
    </TableLayout>
</LinearLayout>

and activity

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import …
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You can write Word document with POI, you better to read documentation properly. Example Writing Microsoft Word Documents in Java With Apache POI (Part 1 – Writing Paragraphs)

Class XWPFDocument has methods addPictureData(byte[] pictureData, int format) and addPictureData(java.io.InputStream is, int format)

If you do not want open source solution, then I suggest you google for paid products as I'm not gone advertise those.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Depends how you did setOnCLickListener. Can you post your code?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Well you said you watched

about 90 videos on basic java, then another 30 videos on advanced java, and now I'm in the middle of watching the 200 video series on Android

surely something stuck on you...
Anyway, every project is about using knowledge we already acumulated and learning or searching out new stuff that we need to add or use. If you cannot get motivated to do above who should then?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

What kind of mini projects can I write?

Create small application to:

  • manage your music/video/game/book collection
  • manage your to-do/shopping/note list
  • aggregate news/post from your favourite website/forum
  • look at github/bitbucket and similar open repositories for interesting projects and try help them with fixing bugs, attending to TO-DOs etc

For example, I'm helping with Battlefield 2 - Battlelog application that is on github

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You want so much and willing too do so little. Why do you presume SVN wouldn't work for Eclipse or Mac, they do not care. There is a free SVN if you signup with sourceforge, but if you want to be little more cool or up to date you can go with git on github or bitbucket . Both are free as long you run it with public repos, as soon you want private repo you have to pay

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

NO you should be writing your mini projects and that way you will learn basic components by heart and will have some general idea about existence of other components or general packages in API.Watching video or reading books is not enough, you need to practice especially in Android development. If you can not prove you are able to write application and have something on market or at least something publicly accesible like github, you are less likely to get offer or even catch attention

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Reinstall NetBeans, there is something wrong with your installation as this action of adding new connection should be working, I had no problems at all with NB 7.1.1

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Sorry I do not see any issue there. You just failing to express what is problem.

To set database in NetBeans right click on Databases in Service tab, select if you want to use NetBeans provided connector or you want to use your connecter in which case you need to point the file.
Next one is plain simple, if local installation leave localhost if remote you need to provide IP address. set new user name and password and you ready to use (can always test your connection with "Test Connection" button). NewConnectionWizard

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

As stultuske you need to say what you did and what you getting. I'm not telepath to read your mind

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Did you try this?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

1)yes
2)yes
3)yes, given more then thousands applications on Android market
4)possible if public bus service has some interface you can communicate with, example TFL - Transport for London. This is however research you need to do on your own

You already got answer for this in following thread http://www.daniweb.com/software-development/mobile-development/threads/416500/android-project-ideas

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I was able to modify/use this example from Swing - A Beginner's Guide in the past to get it working with text area

import javax.swing.*;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class CaretDemo {
    JLabel labelAll;
    JLabel labelSelected;
    
    JTextField textField;
    
    JButton buttonCut;
    JButton buttonPaste;
    final String allText = "All text: ";
    final String selectedText = "Selected text: ";
    
    public CaretDemo(){
        JFrame frame = new JFrame("Caret Demo");
        frame.getContentPane().setLayout(new FlowLayout());
        frame.setSize(200, 150);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        labelAll = new JLabel(allText);
        labelSelected = new JLabel(selectedText);
        
        textField = new JTextField("This is a test", 15);
        
        textField.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
                labelAll.setText((allText + textField.getText()));
                labelSelected.setText(selectedText + textField.getSelectedText());
            }
        });
        
        buttonCut = new JButton("Cut");
        buttonPaste = new JButton("Paste");
        
        buttonCut.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
                textField.cut();
                labelAll.setText(allText + textField.getText());
                labelSelected.setText(selectedText + textField.getSelectedText());
            }
        });

        buttonPaste.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
                textField.paste();
            }
        });

        textField.addCaretListener(new CaretListener() {
            public void caretUpdate(CaretEvent caretEvent) {
                labelAll.setText(allText + textField.getText());
                labelSelected.setText(selectedText + textField.getSelectedText());
            }
        });

        frame.getContentPane().add(textField);
        frame.getContentPane().add(buttonCut);
        frame.getContentPane().add(buttonPaste);
        frame.getContentPane().add(labelAll);
        frame.getContentPane().add(labelSelected);
        
        textField.setCaretPosition(5);
        textField.moveCaretPosition(7);
        
        frame.setVisible(true);
    }
    
    public  static void main(String[] args){
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                new CaretDemo();
            }
        });
    }
}
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You could locally use visualVM, but you will never reach level of usage as your costumers.
I do not want to be rude but your company got screwed now and still didn't get that they are loosing face.
The reasonable solution, that will show pro-active approach from you, would be provide updated version of software for selected user group (hospitals/doctors having/reporting most problems) and use proper error reporting not silly system print outs.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Would be nice if you actually sorted your previous posts (for example mark it as solved) or people will start ignoring your questions.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

System messages => bad idea
Logger messages => good idea (example slf4j)