Please HELP
I ported SIO,
THis is what i get:
Code:
block/sio-iosched.c:315:3: error: unknown field 'elevator_queue_empty_fn' specified in initializer
block/sio-iosched.c:315:3: warning: initialization from incompatible pointer type [enabled by default]
block/sio-iosched.c:315:3: warning: (near initialization for 'iosched_sio.ops.elevator_activate_req_fn') [enabled by default]
make[1]: *** [block/sio-iosched.o] Error 1
make: *** [block] Error 2
I only dont understand elevator queue empty. I think i should add a queue for it?
You porting SIO from where?
Do you know the basic of C language?
Read this GNU GCC.
nicholaschw said:
Please HELP
I ported SIO,
THis is what i get:
Code:
block/sio-iosched.c:315:3: error: [B]unknown field[/B] 'elevator_queue_empty_fn' [B]specified in initializer[/B]
block/sio-iosched.c:315:3: warning: initialization from incompatible pointer type [enabled by default]
block/sio-iosched.c:315:3: warning: (near initialization for 'iosched_sio.ops.elevator_activate_req_fn') [enabled by default]
make[1]: *** [block/sio-iosched.o] Error 1
make: *** [block] Error 2
I only dont understand elevator queue empty. I think i should add a queue for it?
Click to expand...
Click to collapse
I'll explain.
Code:
//Test Application
typedef struct _user{
const char* name;
const char* password;
char age;
} user;
int main(){
//And we initialize it
struct _user someUser = {
//Lets initialize the variables
.name = "James Bond",
.password = "007",
.age = 21,
//Lets be rebel and break it
.unkownVariable = "Unkown Value"
};
//You are calling a field thats not there
//Exit Gracefully
return 0;
}
The code you tried porting into your kernel is made for a different kernel (not 3.0.8) or you simply forgot a inlcude somewhere,
xonar_ said:
I'll explain.
Code:
//Test Application
typedef struct _user{
const char* name;
const char* password;
char age;
} user;
int main(){
//And we initialize it
struct _user someUser = {
//Lets initialize the variables
.name = "James Bond",
.password = "007",
.age = 21,
//Lets be rebel and break it
.unkownVariable = "Unkown Value"
};
//You are calling a field thats not there
//Exit Gracefully
return 0;
}
The code you tried porting into your kernel is made for a different kernel (not 3.0.8) or you simply forgot a inlcude somewhere,
Click to expand...
Click to collapse
Jackpot. I ported from 2. 6. 3. 5. Help me. Everything is ready in github
Sent from my LG-P970 using Tapatalk 2
nicholaschw said:
Jackpot. I ported from 2. 6. 3. 5. Help me. Everything is ready in github
Sent from my LG-P970 using Tapatalk 2
Click to expand...
Click to collapse
Try looking at what the headers look like to look for the difference that broke it. It's possible that they just changed the name and just renaming it could fix. Its also possible that they made crucial design changes and it will stay broken unless you port it from another kernel with very similar headers. I'm going to be busy now for a few hours so I can't check it now.
Sent from my LG-P970
Related
Hi everyone,
I cloned AOSP 2.2 sources
and then I replace Launcher2 folder in packages/apps with ADWLauncher from AndersWeb's github
Then "Make Launcher" returns me this:
Code:
target R.java/Manifest.java: Launcher2 (out/target/common/obj/APPS/Launcher2_intermediates/src/R.stamp)
target Java: Launcher2 (out/target/common/obj/APPS/Launcher2_intermediates/classes)
packages/apps/Launcher2/src/com/android/launcher/Launcher.java:1221: cannot find symbol
symbol : variable SOURCE
location: class android.app.SearchManager
appSearchData.putString(SearchManager.SOURCE, "launcher-search");
^
packages/apps/Launcher2/src/com/android/launcher/MyLauncherSettings.java:58: method does not override a method from its superclass
@Override
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
make: *** [out/target/common/obj/APPS/Launcher2_intermediates/classes-full-debug.jar] Erreur 41
Here is the result from standalone branch:
Code:
target R.java/Manifest.java: Launcher (out/target/common/obj/APPS/Launcher_intermediates/src/R.stamp)
aapt: warning: string 'pref_dialog_drawer_background_alpha' has no default translation in packages/apps/android_packages_apps_Launcher/res; found: el es
aapt: warning: string 'pref_summary_drawer_background_alpha' has no default translation in packages/apps/android_packages_apps_Launcher/res; found: el es
aapt: warning: string 'pref_title_drawer_background_alpha' has no default translation in packages/apps/android_packages_apps_Launcher/res; found: el es
Warning: AndroidManifest.xml already defines versionCode (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines versionName (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines minSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
target Java: Launcher (out/target/common/obj/APPS/Launcher_intermediates/classes)
packages/apps/android_packages_apps_Launcher/src/org/adw/launcher/Workspace.java:1773: method does not override a method from its superclass
@Override
^
packages/apps/android_packages_apps_Launcher/src/org/adw/launcher/Workspace.java:1778: method does not override a method from its superclass
@Override
^
packages/apps/android_packages_apps_Launcher/src/org/adw/launcher/Workspace.java:1784: method does not override a method from its superclass
@Override
^
packages/apps/android_packages_apps_Launcher/src/org/adw/launcher/Workspace.java:1793: method does not override a method from its superclass
@Override
^
packages/apps/android_packages_apps_Launcher/src/org/adw/launcher/DesktopIndicator.java:212: method does not override a method from its superclass
@Override
^
packages/apps/android_packages_apps_Launcher/src/org/adw/launcher/DesktopIndicator.java:217: method does not override a method from its superclass
@Override
^
packages/apps/android_packages_apps_Launcher/src/org/adw/launcher/DesktopIndicator.java:221: method does not override a method from its superclass
@Override
^
packages/apps/android_packages_apps_Launcher/src/org/adw/launcher/MyLauncherSettings.java:101: method does not override a method from its superclass
@Override
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
8 errors
make: *** [out/target/common/obj/APPS/Launcher_intermediates/classes-full-debug.jar] Erreur 41
Could you help me?
thx
You should remove the override lines,
And for froyo, there's no an official system branch made by myself. I'd need to remove a few code parts, cause in froyo, the search widget is no more needed inside the launcher.
AnderWeb said:
You should remove the override lines,
And for froyo, there's no an official system branch made by myself. I'd need to remove a few code parts, cause in froyo, the search widget is no more needed inside the launcher.
Click to expand...
Click to collapse
Okay.
Thank you very much.
Hope you'll release the sources for FroYo soon
leonnib4 said:
Okay.
Thank you very much.
Hope you'll release the sources for FroYo soon
Click to expand...
Click to collapse
The actual standalone branch is froyo compatible, you just need to remove the overrides if you don't build within eclipse.
AnderWeb said:
The actual standalone branch is froyo compatible, you just need to remove the overrides if you don't build within eclipse.
Click to expand...
Click to collapse
thanks!
10chars
Hi leo, its nice to see that we are working and struggling in the same stuff, great minds think alike and it seems they mess alike too ^^
Anyway nice work both of you.
Since the repo was updated,
I only had to remove some @overides as AndersWeb told me and everything was fine.
Hi. I want to ask some comparison problem in Android studio. I have implement a bluetooth data receiving code in Android studio to receive data from Arduino. If it receive "abcde", an audio should be play (mysound). But it can't play as expected. May I ask what is the problem in the below code? Thank you.
Arduino:
BT.println("abcde");
Android:
h = new Handler() {
public void handleMessage(android.os.Message msg) {
switch (msg.what) {
case RECIEVE_MESSAGE: // if receive massage
byte[ ] readBuf = (byte[ ]) msg.obj;
String strIncom = new String(readBuf, 0, msg.arg1); // create string from bytes array
sb.append(strIncom); // append string
int endOfLineIndex = sb.indexOf("\r\n"); // determine the end-of-line
//txtArduino.setText(strIncom);
if (endOfLineIndex > 0) { // if end-of-line,
String sbprint = sb.substring(0, endOfLineIndex); // extract string
sb.delete(0, sb.length()); // and clear
txtArduino.setText(sbprint); // update TextView
if(sbprint=="abcde"){
mySound.start();}
break;
}
};
};
I am trying to develop a register system in Android studio, however it registers users but the application closes down as it gives java.lang.NullPointerException error.
Errro Messages
> E/JSON Parser﹕ Error parsing data org.json.JSONException: Value
> 2015-12-09 of type java.lang.String cannot be converted to JSONObject
>
> E/AndroidRuntime﹕ FATAL EXCEPTION: mainPID: 2386
> java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.getString(java.lang.String)' on
> a null object reference
Code:
> at com.bradvisor.bradvisor.Register$ProcessRegister.onPostExecute(Register.java:214)
if (json.getString(KEY_SUCCESS) != null) { - Line 214: where I get an error message, not to sure why
> at com.bradvisor.bradvisor.Register$ProcessRegister.onPostExecute(Register.java:171)
private class ProcessRegister extends AsyncTask<String, String, JSONObject> { - Line 171: where I get an error message, not to sure why.
Register.java File.
Code:
private class ProcessRegister extends AsyncTask<String, String, JSONObject> { - Line 171: where I get an error message, not to sure why.
/**
* Defining Process dialog
**/
private ProgressDialog pDialog;
String email,password,fname,lname,uname;
@Override
protected void onPreExecute() {
super.onPreExecute();
inputUsername = (EditText) findViewById(R.id.uname);
inputPassword = (EditText) findViewById(R.id.pword);
fname = inputFirstName.getText().toString();
lname = inputLastName.getText().toString();
email = inputEmail.getText().toString();
uname= inputUsername.getText().toString();
password = inputPassword.getText().toString();
pDialog = new ProgressDialog(Register.this);
pDialog.setTitle("Contacting Servers");
pDialog.setMessage("Registering ...");
pDialog.setIndeterminate(false);
pDialog.setCancelable(true);
pDialog.show();
}
@Override
protected JSONObject doInBackground(String... args) {
UserFunctions userFunction = new UserFunctions();
JSONObject json = userFunction.registerUser(fname, lname, email, uname, password);
return json;
}
@Override
protected void onPostExecute(JSONObject json) {
/**
* Checks for success message.
**/
try {
if (json.getString(KEY_SUCCESS) != null) { - Line 214: where I get an error message, not to sure why.
registerErrorMsg.setText("");
String res = json.getString(KEY_SUCCESS);
String red = json.getString(KEY_ERROR);
if(Integer.parseInt(res) == 1){
pDialog.setTitle("Getting Data");
pDialog.setMessage("Loading Info");
registerErrorMsg.setText("Successfully Registered");
DatabaseHandler db = new DatabaseHandler(getApplicationContext());
JSONObject json_user = json.getJSONObject("user");
/**
* Removes all the previous data in the SQlite database
**/
UserFunctions logout = new UserFunctions();
logout.logoutUser(getApplicationContext());
db.addUser(json_user.getString(KEY_FIRSTNAME),json_user.getString(KEY_LASTNAME),json_user.getString(KEY_EMAIL),json_user.getString(KEY_USERNAME),json_user.getString(KEY_UID),json_user.getString(KEY_CREATED_AT));
/**
* Stores registered data in SQlite Database
* Launch Registered screen
**/
Intent registered = new Intent(getApplicationContext(), Registered.class);
/**
* Close all views before launching Registered screen
**/
registered.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
pDialog.dismiss();
startActivity(registered);
finish();
}
else if (Integer.parseInt(red) ==2){
pDialog.dismiss();
registerErrorMsg.setText("User already exists");
}
else if (Integer.parseInt(red) ==3){
pDialog.dismiss();
registerErrorMsg.setText("Invalid Email id");
}
}
else{
pDialog.dismiss();
registerErrorMsg.setText("Error occured in registration");
}
} catch (JSONException e) {
e.printStackTrace();
}
}}
public void NetAsync(View view){
new NetCheck().execute();
}}
deleted
Are you sure the object returned from doInBackground is not null ?
@override
protected JSONObject doInBackground(String... args) {
UserFunctions userFunction = new UserFunctions();
JSONObject json = userFunction.registerUser(fname, lname, email, uname, password);(json is null)
return json; ( return null )
}
@override
protected void onPostExecute(JSONObject json) { ( json is null )
/**
* Checks for success message.
**/
try {
if (json.getString(KEY_SUCCESS) != null) { - Line 214: where I get an error message, not to sure why. ( null getString cause exception )
Hello! I dont know much about coding so i decided to buy an app about quotes. The thing is i have opened it in android studio and want to make some changes. Specifically i want i want to change the button ''authors'' and instead of opening an activity i want to open a web link. How i am supposed to do that?
I hope this bit of code helps :
I think the button i want to change is this in the android manifest
<activity
android:name="com.axdev.quotes.AuteursActivity"
android:label="@string/title_activity_auteurs"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<!-- Points to searchable activity -->
<meta-data android:name="android.app.default_searchable"
android:value=".AuteursActivity" />
<!-- Points to searchable meta data -->
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"/>
</activity>
Hi!
Code:
author_button.setOnClickListener(buttonClick);
private View.OnClickListener buttonClick = new View.OnClickListener(){
public void onClick(View v){
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setData(Uri.parse("your link"));
startActivity(intent);
}
};
Where to put code
Ducktamine said:
Hi!
Code:
author_button.setOnClickListener(buttonClick);
private View.OnClickListener buttonClick = new View.OnClickListener(){
public void onClick(View v){
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.setData(Uri.parse("your link"));
startActivity(intent);
}
};
Click to expand...
Click to collapse
Thank you very much for your reply! Where do i have to put this code? In the android manifest? Also do i have to replace something first?
Looks like it should be in com.axdev.quotes.AuteursActivity, just find the place where click listener for button ''authors'' is setted. And replace code of listener.
Button
I cant find it. Here is th code
public class AuteursActivity extends ActionBarActivity {
private ArrayList<Quote> imageArry = new ArrayList<Quote>();
private AuthorsListAdapter adapter;
private DataBaseHandler db;
private ListView dataList;
SearchView searchView;
private AdView adView;
@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_auteurs);
final ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayShowHomeEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
getWindow().setStatusBarColor(getResources().getColor(R.color.colorPrimaryDark));
}
db = new DataBaseHandler(this);
List<Quote> authors = db.getAllAuthors("");
for (Quote cn : authors) {
imageArry.add(cn);
}
adapter = new AuthorsListAdapter(this, R.layout.author_items, imageArry);
dataList = (ListView) findViewById(R.id.listView1);
dataList.setAdapter(adapter);
dataList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@override
public void onItemClick(AdapterView<?> parent, View viewClicked,
int position, long idInDB) {
Quote srr = imageArry.get(position);
Intent i = new Intent(getApplicationContext(),
QuotesActivity.class);
i.putExtra("name", srr.getName());
i.putExtra("mode", "isAuthor");
startActivity(i);
}
});
Here it is:
Code:
@override
public void onItemClick(AdapterView<?> parent, View viewClicked,
int position, long idInDB) {
Quote srr = imageArry.get(position);
Intent i = new Intent(getApplicationContext(),
QuotesActivity.class);
i.putExtra("name", srr.getName());
i.putExtra("mode", "isAuthor");
startActivity(i);
}
});
cant build apk
Thank you! I made the changes but when i go to build the apk it gives the following errors
error: <identifier> expected
error: <identifier> expected
error: <;> expected
error: <identifier> expected
error: <identifier> expected
nickblu said:
Thank you! I made the changes but when i go to build the apk it gives the following errors
error: <identifier> expected
error: <identifier> expected
error: <;> expected
error: <identifier> expected
error: <identifier> expected
Click to expand...
Click to collapse
looks like errors in your syntax.
I strongly recommend to pick some basics skills in programming, study java and android development, if you really want to make good app by yourself.
Hi everyone:
how could I use View.inflate() to inflate a layout which is in the res directory of my own module? I want to add this layout into the target app’s view container.
I had tried to generate a fakeId for this layout xml resource file by this way:
Code:
fun initZygote(startupParam: IXposedHookZygoteInit.StartupParam?) {
MODULE_PATH = startupParam?.modulePath
}
fun handleInitPackageResources(resparam: XC_InitPackageResources.InitPackageResourcesParam?) {
val modRes = XModuleResources.createInstance(MODULE_PATH, resparam.res)
ID_MENU = resparam.res.addResource(modRes, R.layout.menu_littlespider)
}
then I use this ID_MENU to to inflate it:
Code:
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam?){
findAndHookMethod(C.View, "inflate", C.Context, C.Int, C.ViewGroup, object : XC_MethodHook() {
override fun afterHookedMethod(param: MethodHookParam?) {
if (param == null) return
val context = param.args[0] as Context
var targetViewId = param.args[1] as Int
if (targetViewId == 2130904238) {
var targetView = param.result as LinearLayout
val layoutParser = context.resources.getLayout(InitResourceHooker.ID_MENU)
val menu = LayoutInflater.from(context).inflate(layoutParser, null)
//val menu = View.inflate(context, InitResourceHooker.ID_MENU, null) as LinearLayout
targetView.addView(menu, 0)
}
}
})
}
sadly,it gives me an error,#0x7eb8f41b is my FakeId :
Code:
android.content.res.Resources$NotFoundException: Resource ID #0x7eb8f41b
can anyone show me is it possible to inflate this layout?
thanks a lot!
吃泡面的猫儿 said:
Hi everyone:
how could I use View.inflate() to inflate a layout which is in the res directory of my own module? I want to add this layout into the target app’s view container.
I had tried to generate a fakeId for this layout xml resource file by this way:
then I use this ID_MENU to to inflate it:
sadly,it gives me an error,#0x7eb8f41b is my FakeId :
can anyone show me is it possible to inflate this layout?
thanks a lot!
Click to expand...
Click to collapse
Hint: use getResourcesForApplication
Background: Xposed hooks run in the context of the hooked app.
Also, you can inflate layout without adding it to hooked app resources provided you create instance of LayoutInflater using your xposed app context.
Code:
Context ctx = context.createPackageContext("your_xposed_app_pkg_name", Context.CONTEXT_IGNORE_SECURITY);
LayoutInflater inflater = LayoutInflater.from(ctx);
inflater.inflate(R.layout.your_layout, parent);
The thing is, layout can contain only such elements that are known to hooked app classloader.
E.g. you won't be able to inflate layout that contains some custom views that were defined within your app, as inflater created within hooked app won't be able to resolve them.
C3C076 said:
Also, you can inflate layout without adding it to hooked app resources provided you create instance of LayoutInflater using your xposed app context.
Code:
Context ctx = context.createPackageContext("your_xposed_app_pkg_name", Context.CONTEXT_IGNORE_SECURITY);
LayoutInflater inflater = LayoutInflater.from(ctx);
inflater.inflate(R.layout.your_layout, parent);
The thing is, layout can contain only such elements that are known to hooked app classloader.
E.g. you won't be able to inflate layout that contains some custom views that were defined within your app, as inflater created within hooked app won't be able to resolve them.
Click to expand...
Click to collapse
Hi, i wonder if i can inflate layout which is in res directory of my app target?