peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@Hanif1993 you welcome

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Simplest way (well by me) is GSON (user guide and API). Create model of the class,

public class Movie {
    @SerializedName("id")
    int id;
    @SerializedName("name")
    String name;
    @SerializedName("link")
    String link;
    @SerializedName("image")
}

get your JSON (not sure if you fetching raw stream that you push to reader or you actually getting string) and tell GSON to parse it based on this sample would be

Gson gson = new Gson();
Movie[] movies = gson.fromJson(jsonString, Movie.class);
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

To understand your question better:

A. Are you asking about how to process JSON in Java?
or
B. Are you asking how to set button image URL from parsed/processed JSON?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

As per Android documentation you should use getExternalStoragePublicDirectory which will get you access to top-level public directory of specific type. Bellow snippet is getting access to pictore directory

public File getAlbumStorageDir(String albumName) {
    // Get the directory for the user's public pictures directory.
    File file = new File(Environment.getExternalStoragePublicDirectory(
            Environment.DIRECTORY_PICTURES), albumName);
    if (!file.mkdirs()) {
        Log.e(LOG_TAG, "Directory not created");
    }
    return file;
}

If you still wish to stick with your call getExternalStorageDirectory() then you need to chck if storage is available as per documentation description

Return the primary external storage directory. This directory may not currently be accessible if it has been mounted by the user on their computer, has been removed from the device, or some other problem has happened. You can determine its current state with getExternalStorageState().

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Glad to hear that!

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You are misunderstanding concept. This is not jar library that you add to your project, but rather expectation that user has this application installed on device and thereore with help of Android intent you can say "load this url with following application of this package name"

OsaMasw commented: thanks +2
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

There is no official API yet as this is still under development. However according to VLC forum you just need to do this

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setPackage("org.videolan.vlc.betav7neon"); // Use org.videolan.vlc for nightly builds
intent.setDataAndType(Uri.parse("http://example.com/media/test.mp4"), "application/mp4");
startActivity(intent);

My suggestion would be to check first for vlc in PackageManager to avoid crash if app not installed. You can follow discussion on intent here

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Well done

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Without seeing actual code hard to say...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Maybe better idea to join some mobile game development forum instead of generic coding forum. I'm Android dev, but I will not able to correctly answer your question as I do not have knowledge of the topic

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Do not make mistake of connecting mobile app to MYSQL direct. Setup rest service that will take request from app, it will query database and respond back to app with requested data. The most commont patern will consist from JSON or XML

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Register for Genymotion (It's free), far better then current Android SDK provided emulator

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Hard to judge what would be the targeted areas for improvements. Do you have any open source project we can have look?

Otherwise I would ask how confident you are with collectable, what sort of components/librarues you are using for networking, json parsing, image handling.
Did you do any code testing? JUnit, Mockito, Espresso, Robolectric, Instrumentation, UIAutomator, Monkey

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Yes, you can

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Add button
1. Setup new layout just with button
2. When adding button inflate this new layout to reduce all that mess with LinearLayout.LayoutParams
3. Then add button to parent (LinearLayout)

Buttons disapeared on fragment return - you need to apply some persistance to record your change, which should happen onPause and re-initiaded with onResume. You could do this with bundle that you pass around. However this will become more complicated as you move around app and other needs to be past to other components.
So you need to decide what storage is best for you http://developer.android.com/guide/topics/data/data-storage.html. For start you may want to use SharedPreferences, if you have more complex structure database would be better.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I need £1.000.000.000.000, damn nothing happend

Maybe good idea to reconsider for future how you phrase your question

But hey sometimes it drizzle even if you need it to rain, here the case. Follow link

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Ahhh, OK. Simple, lets examine code (sorry for cheeky comments)

if(new File("ATM.xls").exists()){ //check if file exists
    System.out.println("File exists"); //YES it does exist
    //but I failed to assigned to some object
}
else{
    File excel = new File("ATM.xls");//doesn't exist so I create new file
    //but this go no further because it is local variable
}

So the code should be something like

File excel = new File("ATM.xls");
if(!excel.exists()) {
    try {
        excel.createNewFile();
    } catch(IOException e) {
        Systemout.println("Failed to create new file, \n" + e.getMessage()); //Log framework would be much better instead of system print outs
}
//I have made sure file either exists or is created and now I can continue
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

That only creates WritableWorkbook, an object to which you have to write some data and then close in order for file to be generated. Check these examples http://www.programcreek.com/java-api-examples/index.php?api=jxl.write.WritableWorkbook

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Visual Basic???? Please specify what you doing because this does not sound like mobile development at all basid on used language

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Sorry, but it is unlikely to workout anything from that log. However any of these values un Tag column are part of your app? If so you should check call for them, any possiblity of looping or excesive use of memory(trying to read in memory same image which is already there -to do caching)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
  1. Increase allocated memory to device (You should have minimum 8gb ram on your pc/laptop or emulator will be always slow). Secondary you may want to install HAXM (you do have to run actually manual install once downloaded through Android SDK as it is 3rd party product) you will find it in your ANDROID_SDK_DIRECTORY/extras/intel/Hardware_Accelerated_Execution_Manager
  2. Use Genymotion instead, free registration for personal usage, way faster then default emulator
  3. Get real device, there is nothing better then real device and fast deployment. Motorola Moto G or Moto E cost about £100 ( I call it good investment)
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You need to be more precise in where is your issue, because we do not see what have you done so far, where are you stuck at.
Here are few resources I used in past (nevertheless my experience with BT was always related to mobile devices using J2ME and now Android)
https://today.java.net/pub/a/today/2004/07/27/bluetooth.html
http://www.oracle.com/technetwork/systems/bluetooth2-156149.html
http://www.jsr82.com/

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

@Dave he did but post it as code instead of simple text

@sabata mmoledi forum rules clear state Do provide evidence of having done some work yourself if posting questions from school or work assignments so time to show some effort we are not your coding monkeys

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Yes, but that post was Modified 19 June 2011
Also check this recent discussion on Reddit http://www.reddit.com/r/androiddev/comments/2wf2ge/android_sdk_vs_flash_builder_thoughts/

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@SimonIoa can we please keep discussion to single thread???

As I said in other thread I would not recommend Flash based appplication as it is not supported by Android neither iPhone. However you can do HTML 5, CSS and JavaScript and use stuff like cordova which should help you to create hybrid app that will run on both platforms(Android and iOS). Otherwise you need to do native development.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I do only native Android development so I will not be able to help you with this. Have look at http://www.adobe.com/devnet/air/air_for_android.html for articles in regards of this. Also they do have their own forum where you can ask questions and get answers...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You aware that Android and iPhones ditched support for Adobe Flash

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

[Path to my cobertura\cobertura-2.0.3-sources.jar]

Shouldn't that be cobertura/cobertura-2.0.3-sources.jar

Slash between Windows and Linux are not the same

BTW, why aren't you using Gradle or even Maven. Ant is horrible (in my opinion)

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

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

I suggest you read forum rules, here. We are not here to do your job or homework. You did not provide proper problem description just few random words that hardly make any sense. BTW OCR is is not simple task, I believe you have no idea what you are actually asking. Till you provide proper problem description and show some effort there is no point to have any discussion

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

That would be if you are executing your build from the line. Have you actually tried to build from command line? Or you just relay on IDE to do the work?

Either way, please run build with -e flag to get more info on that error

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

if anyone could help me to solve the issue here

What issue? You just uploaded large chunk of code that cannot be compiled because resources are missing and you did not mentioned any errors or problems that you are having

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Above error is often caused by unitentional spaces in executed command
Example
-Dfile = C:\app\Oracle11g\product\11.2.0\dbhome_1\owb\wf\lib\ojdbc14.jar
should be (extra spcates between equals = sign)
-Dfile=C:\app\Oracle11g\product\11.2.0\dbhome_1\owb\wf\lib\ojdbc14.jar

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Error is rather explicit org.apache.maven.plugins:maven-compiler-pluginis missing. Does your pom.xml on the line 17 looks something like

<dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.2</version>
</dependency>
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

What you mean "transfer"? Copy amd paste from one machine to other? Downloading from github/svn or similar?

Whatever you do, you will need to to execute again mvn clean install on the other machine so this machine fetches dependencies.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I'm getting confused by your reply. Purpose of Maven is to solve dependencies and fetch stuff eaither from dedicated company Nexus server or from publicly available repos. What you mean "i dont have ojdbc14.10.2.0.4.0.jar in my resperatory of maven"?
A) You are talking about your local .m2 directory
B) You mean you have restriction in maven to use only your company nexus to fetch dependencies
C) You are working in offline mode(not connected to internet) and obviously maven can't fetch dependencies

Please be more descriptive of situation, I cannot see what is happening on your machine so you need to provide as much data as necessary to get to root of the problem

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

To add up on previous replies, you may want to check if they have resources for developers or API that is publicly accessible.
example this forum has API https://www.daniweb.com/api/documentation#fetch-articles where you can get JSON of all forums https://www.daniweb.com/api/forums
If not check also loading of resources from browser consoleoften if you lucky they may be using REST service that returns structured content often in JSON format finding. Example DICE Battlelog, exposes player statistics here http://battlelog.battlefield.com/bf4/warsawoverviewpopulate/177958806/2/ and contains many other data that are publicly accessible.

HTML parsing with JSOUP should be last think on your mind as it is messy, time consuming and prone to webpage changes

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Do you have this in your pom file?

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc14</artifactId>
    <version>10.2.0.4.0</version>
</dependency>

If yes, then run your build with -e flag to get more info and post it back

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Without seing actual code it is hard to advice in order to avoid duplication

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Android app > send HTTP request (GET/POST/PUT/DELETE) > server listen for REST request > server ask DB for data > server sends reply. Do not try to do direct connect to DB as it is bad practice because it is data and time consuming

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Project > Clean but I have no idea where R class will be stored. (1. I hate Eclipse, 2. no need to know where is R located only that my refrences to R class are resolved fine)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You have duplicate id in some XML layout, mostlikely the one where you showing map fragment

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Generate you need to build Build > Rebuild Project

You will then find R class under your project module (most often called app), build > generated > source > r > debug > YOUR_PACKAGE_NAME > R.java

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Daniweb rules says

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

So post what you wrote so far and maybe will help you

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Daniweb rules says

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

So post what you wrote so far and maybe will help you

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Top of Java section thread created by James Java projects for learners pick any project from there, provide UI and post it here if you have any problems. I'm sure people will guide you

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

JavaScript is disabled by default on devices for last 2 years(you can enable it, but you will get warning that it is not advicable to do so). Therefore web site developers are adviced to avoid it in mobile sites as they loose functionality/features if they

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You need to run your music as servive, you can see example here http://developer.android.com/guide/topics/media/mediaplayer.html#mpandservices

jalpesh_007 commented: thanks.it is helpful. +4
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
  • Create custom listener
  • Register listener with component to receive update info
  • Call listener on touch and pass data to be received by listeneing component