w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
While Sending Html Mails from my web application Recieved Mails contains Symbols like &ldquo,&rdquo, ‘
Check with another constructor for htmlView: ContentType mimeType = new System.Net.Mime.ContentType("text/html"); var htmlView = AlternateView.CreateAlternateViewFromString(bodyMessage, mimeType);

Categories : Asp Net Mvc

Reuse java source code in android
You say you want to use this code as a library in multiple projects. The way to do this is to do what you're opposed to doing: make it a project, have it build as a JAR, and have the build technology you're using (which sounds like Eclipse) manage the fact that it needs to be packaged into the resulting final output. However, that doesn't mean that you'll build the JAR and drop it into your project's lib directory, which seems to be the thing you're afraid of. Eclipse/Maven/Ant can all be configured to rebuild the dependent libraries as needed and then package them automatically into the build artifact of the primary target, without any pain for you.

Categories : Java

How to implement double click event handling into Android SDK source code [PhoneWindow.java]
long lastClickTime = System.currentTimeMillis(); static final long MAX_DOUBLE_CLICK_TIME = 150; boolean isDoubleClick(){ boolean result = false; long now = System.currentTimeMillis(); if(now - lastClickTime <MAX_DOUBLE_CLICK_TIME){ result = true; } lastClickTime = now; return result; } Call that function in your onClick handler. It will return true for a double click.

Categories : Java

Remove all annotations in Java source code and get new source code
I ended up using JEdit which has brilliant regular expression support. I wanted to replace specific annotations (I wanted to keep stuff like @Override). You can easily do that for all buffers or a directory tree. Just write some simple expressions for the annotations you want to remove. For example ^s*@NamedQueries( {[^}]+})

Categories : Java

Open Source CMS in java for web content managment with source code to develop in eclipse for custom changes
Well, dotCMS provides the features that you are looking for like using servlets to build your own stuff on top of their API's. Have you tried their dotcms_2.3.1.exe windows installer? It includes the database stuff and everything and should work. If it doens't you can ask questions on their google group page (https://groups.google.com/group/dotcms) and most likely there will be somebody that can help you out.

Categories : Java

Serializing objects with changing class source code
Here are a few common ways of serializing an object that can be deserialized in a backwards-compatible way. 1. Store the data in the JSON format using import and export methods designed to save all fields needed to recreate the instance. This can be made backwards-compatible by including a version key that allows for an update algorithm to be called if the version is too low. A common library for this is the Google Gson library which can represent Java objects in JSON as well as normally editing a JSON file. 2. Use the built-in java Properties class in a way similar to the method described above. Properties objects can be later stored using a stream (store()) written as a regular Java Properties file, or saved in XML (storeToXML()). 3. Sometimes simple objects can be easily represented

Categories : Java

How can I make my source code invisible to others?
What you need is a private repository. As you may also see here, your project must be open source in order to be hosted in google code. However you can host your project in different providers, such as bitbucket that provides private repositories for free. Unfortunately though in bitbucket there is no svn, only git and mercurial. The choice is yours!

Categories : Android

If I use SSLSocket in Android and hard code the passcode to the truststore in the source code is that insecure?
I haven't tried on Android, but here is how it works in plain Java. You're using your keystore as a truststore here, so (hopefully) it doesn't contain any private key or secret material. In this case, the purpose of the password is to verify the integrity of the store. From the Keystore.load(InputStream, char[]) documentation: A password may be given to unlock the keystore (e.g. the keystore resides on a hardware token device), or to check the integrity of the keystore data. If a password is not given for integrity checking, then integrity checking is not performed. Either you use null as the password (in which case you'll always be able to load the certificates) or you use a non-null char array with the actual password (in which case an incorrect password will fail with some

Categories : Java

where is the tegra's hardware codec code in android source code(4.1)
The libstagefrighthw library is simply "glue" code that patches vendor proprietary media framework with libstagefright framework within Android. This approach is used to implement hardware specific custom codecs. The qcom, ti code you see, is the one that got sync-ed into the "mainline" Android repository quite sometime back. For tegra-specific code, you will need to get your hands on a proper Tegra development repository. (This maybe?) You may also want to checkout the Tegra3 libstagefrighthw code within the CM 10.2 repo.

Categories : Android

Android: changing an ImageView source makes my application close unexpectedly
So here: Intent i = new Intent(this,Imagen.class); i.putExtra("IMAGEN", view.getId()); startActivity(i); you just put view id in intent, but after: int id = i.getIntExtra("IMAGEN", -1); if(id != -1){ ImageView iv = (ImageView) findViewById(R.id.imageV1); iv.setImageResource(id); //Error setContentView(R.layout.imagen); } you try assign this R.id to image resource, this is wrong, because setImageResource expecting something like R.drawable.my_image. Please follow javadoc.

Categories : Java

Java Game Dev: How to put a timer around this code?
I'd say the "right" way to do this is to have a game loop that ticks x times per second. You decide to change the value of the enemylocation every x ticks. If you tick 60 times per second, that means 3 seconds will be 60 * 3 = 180. That means you can change the enemylocation when tickNumber % 180 == 0

Categories : Java

How do you make the Qt source code available when debugging an application in Qt Creator?
I meet the similar problem when using Emacs+gdb. The problem was that path to source code compiled in library was something like src/core/qobject.cpp or even core/qobject.cpp. So debuger can not find suitable source file when I walk up and down through call stack. I solve the problem just configure gdb's search path. In qt creator you can try fix it by finding option to configure "gdb" parameters and add "-d path/to/qt/source/code" to gdb command line arguments.

Categories : C++

Best approach to make android device a remote for C game
I would recommend either a socket connection, or if your computer has a Bluetooth receiver a Bluetooth connection. Bluetooth is more energy-efficient, and provides the necessary low-latency. There is an application on the market called "Bluetooth Remote PC" as proof of concept.

Categories : Android

How to make time restriction (limit) in android game?
Use a handler for this: // set this to true if user succeeds before time runs out. boolean userSucceeded = false; new Handler().postDelayed(new Runnable() { public void run() { if (!userSucceeded) { // write("you failed") } } }, 1000L); // 1 second

Categories : Android

Java word game with GUI. What is wrong with my code?
Use your newPaint API in the event, instead of directly setting the fields of NewClass. if (event.getActionCommand().equals(hiddenAnswer.getText())) { System.out.println("you got it right"); } else { System.out.println("sorry you got it wrong"); nc.newPaint(125, 120, 40, 100); } Edit: In the NewClass1, replace the repaint() with revalidate(). Here's the reference. Edit2: In your case, it is best that you don't create the NewClass panel outside of NewClass1. In the NewClass1 constructor you can do this: nc = new NewClass(); add(BorderLayout.CENTER, nc); before you add the hiddenAnswer, and then you can remove the NewClass from the entry point. The thing is, you weren't working on the instance of NewClass that you've created in the entry point, you were working with

Categories : Java

Where I can find the source code for the android document on developer.android.com/guide?
Open Android SDK Manager. Select an Android version, like Android 4.3. Check sources for Android SDK and install. Then you can find source code located at %ANDROID_HOME%sdksourcesandroid-18. Is this what you want?

Categories : Android

are there some tools to make macro codes debuggable like common source code
One idea would be to use gcc -E, then edit the resulting .i file and remove the #line directives around the affected area. Then compile the .i file. gcc+gdb could be made to debug macros as if they were inline functions, but I think that would be a fair amount of work in gcc.

Categories : Debugging

How to make a maven build fail if source code contains a keyword / regex
I would create a small program to run these checks and then execute it via the exec-maven-plugin. If you find the keyword in the main resources then just return a non-zero return code which will cause the plugin to fail the build.

Categories : Maven

How can i code a time limit in my android game
You should use a handler but in order to cancel the timeout you must remove the delayed message from the handler in your click listener code. public class EasyOne extends Activity { static private Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { super.handleMessage(msg); if (msg.what == 123) { ((EasyOne) msg.obj).onTimeout(); } } }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.easyone); a = (Button) findViewById(R.id.btn_ea1); b = (Button) findViewById(R.id.btn_eb1); c = (Button) findViewById(R.id.btn_ec1); Message msg = mHandler.obtainMessage(123,this); mHandler.sendMessageDelayed(msg,5000); a.s

Categories : Android

Trying to convert diagram of a chess game to java code (abstract)
+ and - refer to visibility: Symbol Visibility ------ ---------- + Public - Private # Protected / Derived (can be combined with one of the others) _ Static (source)

Categories : Java

How to modify android Source code and use that into Android device?
Your question is so generic. So I just suppose that you have already got to know how to build and flash your customized firmware. And here is the answer for your original requirement: To disable the navigation buttons, you should modify the file YOURANDORIDROOT/framework/base/core/res/res/values/config.xml and change the value <bool name="config_showNavigationBar">true</bool> to <bool name="config_showNavigationBar">false</bool> And some more information for your reference, you can go to framework/base/package/systemui directory and there you can find the source code of the status bar.

Categories : Android

HTML source field is also changing html code into escaped characters
Not sure I totally understand what you're saying, but try this to use the htmlEncode function as defined like this: function htmlEncode(value){ //create a in-memory div, set it's inner text(which jQuery automatically encodes) //then grab the encoded contents back out. The div never exists on the page. return $('<div/>').text(value).html(); } From HTML-encoding in JavaScript/jQuery

Categories : Javascript

Debugging using Java source code
Eclipse have built-in support for what you wanna do. All you have to do is set breakpoint and execute application in debugging mode. You can use these icons in Eclipse debugging perspective. Follow along Eclipse Debugging Tutorial for details.

Categories : Java

Trying to design Billiard game in HTML to make jQuery game - My First Project
If you want to work with what you currently have to continue to learn, you will have to think about the objects that you need when playing pool. One of the missing pieces that I would say that you could use is a holder - don't know what it is called in pool - that the balls will go into. You can see code that I have added for your review to see if it helps you: http://codepen.io/pertrai1/pen/mkKna

Categories : Javascript

How to get source code for android.jar
but I'd like to use the android java std lib for a project of mine I have no idea why you think that would work, any more than trying to use a Windows DLL on Linux. Is there any way to get the source code (in a jar or otherwise) for the android.jar so I can hook it up to the IDE so I can nicely browse the source code of the standard library? The source code for Android is at the Android Open Source Project. The source code for the android.jar is mostly in the platform_frameworks_base repo (GitHub mirror), but the JAR is really an output of a firmware build.

Categories : Java

How can I code my game to work on every resolution of Android devices? (with Unity)
The answer to your question largely depends on how you've implemented the game. If you've created it using GUI textures, then it largely depends on how you've placed/sized your objects versus screen size, which makes things a little tricky. If the majority of your game is done using objects (such as planes, cubes, etc) then there's two methods I usually choose to use. 1) First method is very easy to implement, though doesn't always look too good. You can simply change the camera's aspect ratio to match the one you've designed your game around. So in your case, since you've designed your game at 4:3, you'd do something like this: Camera.aspect = 4f/3f; However, if someone's playing on a screen meant for 16:9, the game will end up looking distorted and stretched. 2) The second method

Categories : Android

Source Code Repository Software Choice for Storing Source Code (Not for Dev)
Short answer: ANY Longer answer All mentioned SCMs support linear history without problems, have sufficient ACLs. DVCS, contrary to CVCS, just doesn't require from you to have and support additional central repository-server, independent from you workplace (if it matter)

Categories : GIT

How to convert linux/mac source code into windows vs2010 source code?
Maybe this resource may help you (I used it once): http://docs.opencv.org/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html Porting code is often a hard task that one has to face on some day :D

Categories : C++

parsing incomplete Java source code
Uhm... This question does not have anything even vaguely like a simple answer. Any of the above parser technologies will allow you to do what you wish to do, if you write the correct grammar and manipulate the parser to do fallback parsing unknown token passover sort of things. The least amount of work to get you where you're going is either to use ANTLR which has resumable parsing and comes with a reasonably complete java 7 grammar, or see what you can pull out of the eclipse JDT ( which is used for doing the error and intention notations and syntax highlighting in the eclipse IDE. ) Note that none of this stuff is easy -- you're writing klocs, not just importing a class and telling it to go. At a certain point of incorrect/incompleteness all of these strategies will fail just because

Categories : Java

Obfuscate my source code in android
your code is only obfuscated by proguard if you run ant in release mode through commandline ant release or through release build in eclipse (does the same), both result in a signed app. and only if you do this, proguard is enabled. so, the error says, there is no proguard.cfg in your app's directory, try this preconfigured proguard file instead: in project.properties: proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt or if you want a optimized build: proguard.config=${sdk.dir}/tools/proguard/proguard-android-optimize.txt:proguard-project.txt if you don't have a proguard-project.txt in your app's directory, just drop the :proguard-project.txt at the line ending. should work ;)

Categories : Android

What does @hide mean in the Android source code?
@hide is used for things that need to be visible for various reasons but are not part of the published API. They will not be included in the documentation when it automagically extracts the API from the source. You're right, you cannot override it. This is normal, that's by design, since it's marked as final. You should be able to use it, although an editor may not show it to you as one of the choices in whatever intellisense it uses because it's marked with @hide, and you should take note of point 3 below. You should not use it at all since it's not part of the API and the developers can remove it whenever they wish. They would even be within their rights, were they sadistically inclined, to replace it with a function that bricked the device it ran on (though maybe not in a strict legal

Categories : Android

Source code for Android MapView v2?
If you need to know when it's done rendering the map, this may help: GoogleMap.OnMapLoadedCallback Callback interface for when the map has finished rendering. This occurs after all tiles required to render the map have been fetched, and all labeling is complete. This event will not fire if the map never loads due to connectivity issues, or if the map is continuously changing and never completes loading due to the user constantly interacting with the map.

Categories : Android

Changing code from Java to C
This line: char A[9]={1,2,3,4,5,6,7,8,9}; should be: char A[9]={'1','2','3','4','5','6','7','8','9'}; In the first version what you're doing is creating an array of characters with their ascii values (you can find an ascii table here).

Categories : Java

How to port a Java game to an Android Application
It depends on how your game developed. if it's based on the game engine like: libGDX,OGRE,etc. you can easily remove to android. If it was not, i am afraid you may need develop it again based on ADK.

Categories : Java

How to Generate a Sequence Diagram from Java Source Code
There are many products that can generate sequence diagrams from Java source code. Unfortunately, all of the good ones cost a lot of money. If you are using the community edition of Visual Paradigm, it does not allow you to generate any diagrams. You must upgrade to one of the paid versions. You can compare the paid vs the free edition here http://www.visual-paradigm.com/product/vpuml/features/?edition=ce You need to buy standard edition of Visual Paradigm that support Code engineering. Check out some of these links for alternative programs which also can generate diagrams / source code. Posiden UML http://www.gentleware.com Argo UML http://argouml.tigris.org Other Resources How can I generate sequence diagrams from Java source code? Sequence Diagram Reverse Engineering http:

Categories : Java

Java source code generation: Eclipse JDT AST vs CodeModel
I don't know anything about CodeModel, so I can't say whether or not it is a good project. However, since you are creating an eclipse plugin, I would recommend going with JDT. The reason is mostly for compatibility with other Eclipse components. The JDT AST API works out of the box with other Eclipse APIs (the resource API, the Java Model API, the refactoring API, text manipulation API, and the Editor API, just to name a few). JDT is far from simple, but it is very powerful and fits nicely into the Eclipse model.

Categories : Java

C/C++/Java source code unicode character displaying in php
i have got answer to decode this string. $string="u00c3khku201eu2122ru00d5kfk fu00deku fkuu00bbk Wu00edu00c3kLu2122 fhu Au?"; $string=json_decode('"'.$string.'"'); echo $string; i prints original string.

Categories : PHP

Please anybody have an example of source code ESC/POS in Android to print receipt.
Try This eBook (PDF Type Format) Explanation about Printing from Android. http://thepapertreeacademy.files.wordpress.com/2012/10/epos-print_sdk_android_e_reva.pdf

Categories : Android

How to install Android after building source code
To rescue your device back, use fast boot to flash the factory image back. To check why you have this issue, please check: If you did not see ANYTHING after reboot, your boot.img (contains kernel) is not correct If you just see the boot animation but it goes on forever, your system.img is not correct You should: Make sure you have download the correct source code and switch to the correct branch Make sure you are using the correct build configuration by lunch and select correct product The AOSP does not contains everything, you have to download or pull out from your old system to get the proprietary binaries.

Categories : Android

Android source code Home sample
I am looking to alter the code to have an icon available on the stock home screen so that when it is selected the option is given to select between the home sample and TouchWiz. I am assuming that by "stock home screen" you mean "sample home screen". In that case, the "stock home screen" is an Activity. You would add an "icon" to the "stock home screen" the same way that you would in any other Android activity, such as by modifying the res/layout/home.xml layout file to contain an ImageButton.

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.