I'm completely new to the world of kernel building and everything. So after weeks of googling, reading, modifying, etc, I've managed to get the stock kernel of SM-G360T1. Now I've been looking on overclocking the kernel and am under the assumption that kernel max and min freq are in drivers/cpufreq/cpufreq_limit.c with it being defined on line 117. Am I correct in assuming that this is the correct one/area to modify or am I completely wrong. If so, guide me in the right direction.
Code:
struct cpufreq_limit_hmp hmp_param = {
.little_cpu_start = 4,
.little_cpu_end = 7,
.big_cpu_start = 0,
.big_cpu_end = 3,
.big_min_freq = 1036800,
.big_max_freq = 1497600,
.little_min_freq = 200000, // 400000 Khz
.little_max_freq = 556800, // 1113600 Khz
.little_min_lock = 400000, // 800000 Khz
.little_divider = 2,
.hmp_boost_type = 1,
.hmp_boost_active = 0,
};
Related
Hi,
how can I set the bearermode for a GSM to ISDN dataconnection?
If I connect with my tornado (SDA) smartephone (TAPI) to ISDN, the bearermode will be 3,1 KHz and not "unrestricted digital, V110".
How can I change this?
my code:
Code:
LPLINECALLPARAMS lpCallParams;
lpCallParams = (LPLINECALLPARAMS)malloc(sizeof(LINECALLPARAMS) + 1024); //Speicher reservieren
memset(lpCallParams,0,sizeof(LINECALLPARAMS) + 1024); //0en
lpCallParams->dwTotalSize = sizeof(LINECALLPARAMS) + 1024;
lpCallParams->dwMediaMode = mediaMode;
lpCallParams->dwBearerMode = LINEBEARERMODE_VOICE; //LINEBEARERMODE_VOICE;//LINEBEARERMODE_PASSTHROUGH; //LINEBEARERMODE_VOICE;
lpCallParams->dwCallParamFlags = LINECALLPARAMFLAGS_IDLE;
lpCallParams->dwAddressMode = LINEADDRESSMODE_ADDRESSID;
lpCallParams->dwAddressID = 0;
lpCallParams->dwDisplayableAddressOffset = sizeof(LINECALLPARAMS);
lpCallParams->dwDisplayableAddressSize = number.GetLength();
strcpy((LPSTR)lpCallParams + sizeof(LINECALLPARAMS), (const char*)num);
ret = lineMakeCall(line, &hCall, num, 0, lpCallParams);
Thanks
Thomas
tq said:
Hi,
how can I set the bearermode for a GSM to ISDN dataconnection?
If I connect with my tornado (SDA) smartephone (TAPI) to ISDN, the bearermode will be 3,1 KHz and not "unrestricted digital, V110".
How can I change this?
my code:
Code:
LPLINECALLPARAMS lpCallParams;
lpCallParams = (LPLINECALLPARAMS)malloc(sizeof(LINECALLPARAMS) + 1024); //Speicher reservieren
memset(lpCallParams,0,sizeof(LINECALLPARAMS) + 1024); //0en
lpCallParams->dwTotalSize = sizeof(LINECALLPARAMS) + 1024;
lpCallParams->dwMediaMode = mediaMode;
lpCallParams->dwBearerMode = LINEBEARERMODE_VOICE; //LINEBEARERMODE_VOICE;//LINEBEARERMODE_PASSTHROUGH; //LINEBEARERMODE_VOICE;
lpCallParams->dwCallParamFlags = LINECALLPARAMFLAGS_IDLE;
lpCallParams->dwAddressMode = LINEADDRESSMODE_ADDRESSID;
lpCallParams->dwAddressID = 0;
lpCallParams->dwDisplayableAddressOffset = sizeof(LINECALLPARAMS);
lpCallParams->dwDisplayableAddressSize = number.GetLength();
strcpy((LPSTR)lpCallParams + sizeof(LINECALLPARAMS), (const char*)num);
ret = lineMakeCall(line, &hCall, num, 0, lpCallParams);
Click to expand...
Click to collapse
I would think using LINEBEARERMODE_DATA would help, but the mediamode is also important, it could be LINEMEDIAMODE_DIGITALDATA or LINEMEDIAMODE_DATAMODEM.
bigmac
LINEBEARERMODE_DATA, LINEMEDIAMODE_DIGITALDATA
Hi,
if I set LINEBEARERMODE_DATA the result is the same (3,1 kHz audio). LINEMEDIAMODE_DIGITALDATA don't work with LINEBEARERMODE_DATA or LINEBEARERMODE_VOICE.
Today, I test it on an O2 XDA mini and I get 3,1KHz audio, too.
I found the function lineSetCallBarringState. But what is "lpszPassword ". What is the default setting?
Is the functioned helpful?
thx Thomas
Dear kernel developer on xda, I need a small help from you.
maybe you know, if you upload custom kernel on I9100 korean version (known as m250k, m250s...), the vibration will be weak than original.
I tried to change the kernel code to fix the problem.
I compiled the original code from samsungopensource, and fix the code like below, and it works.
But there are another problem is that the kernel I compiled was some power consuming.
So can you give me a hand to merge these code to your kernel and release them for korean hardware?
Thanks a lot.
----------------arch/arm/mach-exynos/mach-u1.c-----------------
-------------before(original code)----------------
#ifdef CONFIG_VIBETONZ
#ifdef CONFIG_TARGET_LOCALE_NTT
static struct max8997_motor_data max8997_motor = {
.max_timeout = 10000,
.duty = 43696,
.period = 44138,
.init_hw = NULL,
.motor_en = NULL,
.pwm_id = 1,
};
#elif defined(CONFIG_TARGET_LOCALE_KOR) || defined(CONFIG_TARGET_LOCALE_NA)
static struct max8997_motor_data max8997_motor = {
.max_timeout = 10000,
.duty = 44196,
.period = 44643,
.init_hw = NULL,
.motor_en = NULL,
.pwm_id = 1,
};
#elif defined(CONFIG_MACH_Q1_BD)
static struct max8997_motor_data max8997_motor = {
.max_timeout = 10000,
.duty = 37641,
.period = 38022,
.init_hw = motor_init_hw,
.motor_en = motor_en,
.pwm_id = 1,
};
#else
static struct max8997_motor_data max8997_motor = {
.max_timeout = 10000,
.duty = 37641,
.period = 38022,
.init_hw = NULL,
.motor_en = NULL,
.pwm_id = 1,
};
#endif
#endif
-------------after(code after change)----------------
#ifdef CONFIG_VIBETONZ
static struct max8997_motor_data max8997_motor = {
.max_timeout = 10000,
.duty = 44196,
.period = 44643,
.init_hw = NULL,
.motor_en = NULL,
.pwm_id = 1,
};
#endif
-----------------------------------------code end------------------------------------------------
Hi!
Can you help me, please? I'm working on an Android app. I get some characters from a file on the Internet and put it to a TextView. These characters are ASCII characters. Then I read these characters one by one and convert it to numbers with the following code:
Code:
char my_char2;
char my_char3;
int myNum = 0;
for (int k = 170; k < len; k++) {
if (c.charAt(k) == '0' && c.charAt(k+1) == '.') {
my_char2 = c.charAt(k+13);
my_char3 = c.charAt(k+14);
myNum = my_char2 * 256 + my_char3;
}
}
Then I write it to an another TextView:
Code:
crlNumber.setText("" + myNum);
The problem is that this can only convert standard ASCII characters(from 0 to 127) except of the new line character(character number 10), carriage return character(character number 13) and the cancel character(character number 24).
But I need to convert also the extended ASCII characters(from 128 to 255) and the 3 characters mentioned above.
What should I do?
Thanks for helping.
Do these help?
http://stackoverflow.com/questions/13826781/java-extended-ascii-table-usage
http://stackoverflow.com/questions/5535988/string-to-binary-and-vice-versa-extended-ascii
nikwen said:
Do these help?
http://stackoverflow.com/questions/13826781/java-extended-ascii-table-usage
http://stackoverflow.com/questions/5535988/string-to-binary-and-vice-versa-extended-ascii
Click to expand...
Click to collapse
A little. I have tried the following code below. It didn't show me the number of the extended ascii characters. But I think I should somehow read the text not as a String, but as a byte, and then I think, it should work(maybe I am wrong). If it is right, please, can you tell me, how should I do it?
Code:
final String textSource = "path to my file";
URL textUrl;
try {
textUrl = new URL(textSource);
BufferedReader bufferReader = new BufferedReader(
new InputStreamReader(textUrl.openStream()));
String StringBuffer;
String stringText = "";
while ((StringBuffer = bufferReader.readLine()) != null) {
stringText += StringBuffer;
}
bufferReader.close();
textMsg.setText(stringText);
String PT = textMsg.getText().toString();
CharSequence c = new String(PT);
String string0 = "";
String string1 = "";
char my_char2;
char my_char3;
String binary = "";
String binary2 = "";
int myNum2 = 0;
int decimalValue1 = 0;
int decimalValue2 = 0;
for (int k = 170; k < len; k++) {
if (c.charAt(k) == '0' && c.charAt(k+1) == '.') {
my_char2 = c.charAt(k+13);
my_char3 = c.charAt(k+14);
string0 = Character.toString(my_char2);
string1 = Character.toString(my_char3);
char[] buffer = string0.toCharArray();
byte[] b = new byte[buffer.length];
for (int i = 0; i < b.length; i++) {
b[i] = (byte) buffer[i];
binary = Integer,toBinaryString(b[i] & 0xFF);
decimalValue1 = Integer.parseInt(binary, 2);
}
char[] buffer2 = string1.toCharArray();
byte[] b2 = new byte[buffer2.length];
for (int i = 0; i < b2.length; i++) {
b2[i] = (byte) buffer2[i];
binary2 = Integer.toBinaryString(b2[i] & 0xFF);
decimalValue2 = Integer.parseInt(binary2, 2);
}
myNum2 = decimalValue1 * 256 + decimalValue2;
}
}
crlNumber.setText("" + binary2 + "," + decimalValue1 + "," + decimalValue2 + "," + myNum2);
}
adamhala007 said:
A little. I have tried the following code below. It didn't show me the number of the extended ascii characters. But I think I should somehow read the text not as a String, but as a byte, and then I think, it should work(maybe I am wrong). If it is right, please, can you tell me, how should I do it?
Code:
final String textSource = "path to my file";
URL textUrl;
try {
textUrl = new URL(textSource);
BufferedReader bufferReader = new BufferedReader(
new InputStreamReader(textUrl.openStream()));
String StringBuffer;
String stringText = "";
while ((StringBuffer = bufferReader.readLine()) != null) {
stringText += StringBuffer;
}
bufferReader.close();
textMsg.setText(stringText);
String PT = textMsg.getText().toString();
CharSequence c = new String(PT);
String string0 = "";
String string1 = "";
char my_char2;
char my_char3;
String binary = "";
String binary2 = "";
int myNum2 = 0;
int decimalValue1 = 0;
int decimalValue2 = 0;
for (int k = 170; k < len; k++) {
if (c.charAt(k) == '0' && c.charAt(k+1) == '.') {
my_char2 = c.charAt(k+13);
my_char3 = c.charAt(k+14);
string0 = Character.toString(my_char2);
string1 = Character.toString(my_char3);
char[] buffer = string0.toCharArray();
byte[] b = new byte[buffer.length];
for (int i = 0; i < b.length; i++) {
b[i] = (byte) buffer[i];
binary = Integer,toBinaryString(b[i] & 0xFF);
decimalValue1 = Integer.parseInt(binary, 2);
}
char[] buffer2 = string1.toCharArray();
byte[] b2 = new byte[buffer2.length];
for (int i = 0; i < b2.length; i++) {
b2[i] = (byte) buffer2[i];
binary2 = Integer.toBinaryString(b2[i] & 0xFF);
decimalValue2 = Integer.parseInt(binary2, 2);
}
myNum2 = decimalValue1 * 256 + decimalValue2;
}
}
crlNumber.setText("" + binary2 + "," + decimalValue1 + "," + decimalValue2 + "," + myNum2);
}
Click to expand...
Click to collapse
Hm, I don't know. According to this answer, you can change the encoding on the desktop, otherwise you will just see question marks.
But according to the accepted answer here, this should be done automatically on a Linux system. And Android is Linux based. Did you try it on an Android device or just on your computer?
Bytes shouldn't work. In Java they are signed, so their range is -128 ... 127.
nikwen said:
Hm, I don't know. According to this answer, you can change the encoding on the desktop, otherwise you will just see question marks.
But according to the accepted answer here, this should be done automatically on a Linux system. And Android is Linux based. Did you try it on an Android device or just on your computer?
Bytes shouldn't work. In Java they are signed, so their range is -128 ... 127.
Click to expand...
Click to collapse
Yes, I tried it on my Android device. Maybe, the best choice would be then to use that certificate code which you suggested me in one of my previous threads, but the problem is, that I am beginner in Android developing and I read it and I didn't know how to use it in my code. So I thougt, if I got the 2 ASCII characters and converted it to decimal numbers, it would also work. And it also works until I have the standard ASCII characters. When there is an extended ASCII character, it shows me the number 65533.
adamhala007 said:
Yes, I tried it on my Android device. Maybe, the best choice would be then to use that certificate code which you suggested me in one of my previous threads, but the problem is, that I am beginner in Android developing and I read it and I didn't know how to use it in my code. So I thougt, if I got the 2 ASCII characters and converted it to decimal numbers, it would also work. And it also works until I have the standard ASCII characters. When there is an extended ASCII character, it shows me the number 65533.
Click to expand...
Click to collapse
But I think I have found out something.
Code:
string0 = Character.toString(my_char2);
string1 = Character.toString(my_char3);
int one = 0;
int two = 0;
String ascii1="\u001f";
String ascii2="\u0018";
String aa = "";
String bb = "";
if(string0.equals(ascii1)){
one = one + 31;
aa = aa + one;
}else{
one = 1;
}
if(string1.equals(ascii2)){
two = two + 24;
bb = bb + two;
}else{
two = 1;
}
textPrompt.setText("" + aa + bb);
But this needs a little correction, because this way it doesn't show me anything, but if I write
Code:
textPrompt.setText("" + aa);
inside my first if statement it shows me correctly 31. What can be the mistake I have made?
convert ASCII character
I'm a self android learner. I want to convert ascii code to character. Here is the code I used.
String s = "1000001";
int num = Integer.parseInt(s, 2);
TextView textView = new TextView(this);
textView.setText(String.valueOf(num));
setContentView(textView);
Here s is 1000001(65 in decimal) 65 is ascii value of 'A'. I want to get 'A' in my output screen.variable num has the value 65. please help me
Hi,
I have a problem with my Game App: On my device all is working fine, but at other Devices it crashes at the start. I get these errors: (Pic 1/2 sry for bad pics :S)
My Database Handler looks as following:
Code:
//...
public class SQLHandler extends SQLiteOpenHelper
{
// Database Version
private static final int DATABASE_VERSION = 6;
// Database Name
private static final String DATABASE_NAME = "MRPIGDB";
public SQLHandler(Context context)
{
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db)
{
// SQL statement to create the table
String CREATE_MRPIG_TABLE = "CREATE TABLE IF NOT EXISTS mrpig ( " +
"id INTEGER PRIMARY KEY AUTOINCREMENT, " +
"points INTEGER )"; // +
//"name" DATA-TYPE )";
// create table
db.execSQL(CREATE_MRPIG_TABLE);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
{
// Drop older table if existed
db.execSQL("DROP TABLE IF EXISTS mrpig");
// create fresh table
this.onCreate(db);
initDB(0);
}
//table name ***
private static final String TABLE_MRPIG = "mrpig";
//Table Columns names ***
private static final String KEY_ID = "id";
private static final String KEY_POINTS = "points";
//private static final String KEY_ = "";
private static final String[] COLUMNS = {KEY_ID, KEY_POINTS /*,KEY_*/};
public void initDB(int points)
{
// 1. get reference to writable DB
SQLiteDatabase db = this.getWritableDatabase();
// 2. create ContentValues to add key "column"/value
ContentValues values = new ContentValues();
values.put(KEY_POINTS, points);
// 3. insert
db.insert(TABLE_MRPIG, // table
null, //nullColumnHack
values); // key/value -> keys = column names/ values = column values
// 4. close
db.close();
}
public int getpoints() //called at start to draw the highstore at screen
{
// 1. get reference to readable DB
SQLiteDatabase db = this.getReadableDatabase();
// 2. build query
Cursor cursor =
db.query(TABLE_MRPIG, // a. table
COLUMNS, // b. column names
" id = ?", // c. selections
new String[] { String.valueOf(1) }, // d. selections args
null, // e. group by
null, // f. having
null, // g. order by
null); // h. limit
// 3. if we got results get the first one
if (cursor != null)
cursor.moveToFirst();
// 4. get points !!!!!!!!!!ERROR HERE!!!!!!!
int points = (Integer.parseInt(cursor.getString(1)));
// 5. return points
return points;
}
public int updatePoints(int points)
{
// 1. get reference to writable DB
SQLiteDatabase db = this.getWritableDatabase();
// 2. create ContentValues to add key "column"/value
ContentValues values = new ContentValues();
values.put(KEY_POINTS, points);
// 3. updating row
int i = db.update(TABLE_MRPIG, //table
values, // column/value
KEY_ID + " = ?", // selections
new String[] { String.valueOf(1) }); //selection args
// 4. close
db.close();
return i;
}
}
I am sorry for so much code and i hOpe someone can help me.
Mfg
Lolxdfly
Try that, i hope it helps!
//...
// 3. if we got results get the first one
if (cursor != null) { //i dont know if you forgot the open bracket here after the if query, but if you did, then it always moved to first. I now put the whole thin inside that one if branch
cursor.moveToFirst();
// 4. get points
int points = null; //i declare it here already, this is better for later on
//you must try catch that as the value of getstring could be corrupt and not parseable to int
try {
points = (Integer.parseInt(cursor.getString(1)));
}
catch (Exception e) {
points = null;
}
// 5. return points (still in if-branch!
return points;
} //end of if
else {
return null; //if cursor = null return null
}
} // end of method
Click to expand...
Click to collapse
---------------------------------
Phone : Nexus 4
OS:
Pure KitKat 4.4.2 stock, no root, no mods
---------------------------------
4d 61 73 72 65 70 75 73 20 66 74 77
Gesendet von Tapatalk
Masrepus said:
Try that, i hope it helps!
---------------------------------
Phone : Nexus 4
OS:
Pure KitKat 4.4.2 stock, no root, no mods
---------------------------------
4d 61 73 72 65 70 75 73 20 66 74 77
Gesendet von Tapatalk
Click to expand...
Click to collapse
Thank you.
Now it works on other devices, but that dont fixed really. It dont crash. But there will be always shown 0 points, because getting the points is failing....
Mfg
Lolxdfly
Hmm... Well i have no idea about the sqlite stuff in android, but i have done a bit of dbs with microsoft access in sql and i think to remember that one has to explicitely format a specific column as int if you want to handle it as int later on. Do you have to do that in sqlite as well?
Also it would be good if you would debug my part and closely watch if:
1. The if branch or the else branch is being executed
2. If the if branch is being executed, does the try catch block exit via the catch section or runs without errors
---------------------------------
Phone : Nexus 4
OS:
Pure KitKat 4.4.2 stock, no root, no mods
---------------------------------
4d 61 73 72 65 70 75 73 20 66 74 77
Gesendet von Tapatalk
49965255 34
Masrepus said:
Hmm... Well i have no idea about the sqlite stuff in android, but i have done a bit of dbs with microsoft access in sql and i think to remember that one has to explicitely format a specific column as int if you want to handle it as int later on. Do you have to do that in sqlite as well?
Also it would be good if you would debug my part and closely watch if:
1. The if branch or the else branch is being executed
2. If the if branch is being executed, does the try catch block exit via the catch section or runs without errors
---------------------------------
Phone : Nexus 4
OS:
Pure KitKat 4.4.2 stock, no root, no mods
---------------------------------
4d 61 73 72 65 70 75 73 20 66 74 77
Gesendet von Tapatalk
Click to expand...
Click to collapse
Idk... i am new to do something with db :S
At my device he goes into the 1st if bracket and he excutes the try succesfully. At my friends phone he go also into the if bracket but he dont excutes the try succesfull and then he goes into the catch function...
So it returns 0..
Okay. Did you already try flooding the db with some random score data and then checking the output?
Another thing, at the try, the (cursor.getString(1))), what does the 1 mean there?
---------------------------------
Phone : Nexus 4
OS:
Pure KitKat 4.4.2 stock, no root, no mods
---------------------------------
4d 61 73 72 65 70 75 73 20 66 74 77
Gesendet von Tapatalk
Masrepus said:
Okay. Did you already try flooding the db with some random score data and then checking the output?
Another thing, at the try, the (cursor.getString(1))), what does the 1 mean there?
---------------------------------
Phone : Nexus 4
OS:
Pure KitKat 4.4.2 stock, no root, no mods
---------------------------------
4d 61 73 72 65 70 75 73 20 66 74 77
Gesendet von Tapatalk
Click to expand...
Click to collapse
Something crasy happend: i removed the try/catch. And i put initDB(0); at onCreate. He always inserts a 0 at start. But my friend said itvis working fine. It saves the right points and it works now.
Thank you for your ideas
Mfg
lolxdfly
When I use json_encode($response), it returns only the first row of the query, how to make it return all the rows?
main.php
Code:
$email = $_POST['email'];
$password = $_POST['password'];
$user = $db->getUserByEmailAndPassword($email, $password);
if ($user != false ) {
// user found
$response["error"] = FALSE;
$response["user"]["name"] = $user["name"];
$response["user"]["email"] = $user["email"];
$response["user"]["dega"] = $user["dega"];
$response["user"]["salla"] = $user["salla"];
$response["user"]["ora"] = $user["ora"];
$response["user"]["lenda"] = $user["lenda"];
$response["user"]["dita"] = $user["dita"];
echo json_encode($response);
}
method.php
Code:
public function getUserByEmailAndPassword($email, $password) {
$result = mysql_query("SELECT U.name, U.email, U.password, F.dega,
O.salla, O.ora, O.lenda, O.dita FROM users U
INNER JOIN fakulteti F on U.id = F.studenti
INNER JOIN orari O on F.id = O.fakulteti WHERE email = '$email'") or die(mysql_error());
$no_of_rows = mysql_num_rows($result);
if ($no_of_rows > 0) {
$result = mysql_fetch_array($result);
$encrypted_password = $result['password']
if ($encrypted_password == $password) {
return $result;
}
}
}
Android class and this is how I recieve a response on my android:
Code:
JSONObject user = jObj.getJSONObject("user");
String name = user.getString("name");
String email = user.getString("email");
String dega = user.getString("dega");
String salla = user.getString("salla");
String ora = user.getString("ora");
String lenda = user.getString("lenda");
String dita = user.getString("dita");
bump!!!!